1

I am trying to compile Trilinos with MPI capabilities. But to specify the cmake command, i need to also specify the MPI base directory:

cmake \
-DTPL_ENABLE_MPI=ON \
-DMPI_BASE_DIR:FILEPATH="" \
-DTrilinos_ENABLE_PyTrilinos:BOOL=ON \
-DTrilinos_ENABLE_ALL_PACKAGES=ON \
-DTrilinos_ENABLE_TESTS:BOOL=ON \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DCMAKE_INSTALL_PREFIX:STRING="$HOME/trilinos-install" \
$SOURCE_DIR

However, I am unable to find any base directory even though MPI is installed on my machine. When i enter commands like mpirun --version, I get:

mpirun (Open MPI) 2.1.1

or ompi_info:

 Package: Open MPI buildd@lcy01-amd64-009 Distribution
                Open MPI: 2.1.1
  Open MPI repo revision: v2.1.0-100-ga2fdb5b
   Open MPI release date: May 10, 2017
                Open RTE: 2.1.1
...

I am running Ubuntu 18.04 LTS on WSL if that is useful info.

Kevin
  • 16,549
  • 8
  • 60
  • 74
Pavan Inguva
  • 65
  • 1
  • 7
  • How did you install Open MPI? Using `apt-get install`? If that is the case, you should see the Open MPI files in these directories `/usr/include/openmpi/` and `/usr/lib/openmpi/lib`. – Kevin Jan 29 '20 at 12:48

1 Answers1

0

The command "which mpich" can give you the default directory of mpi installation. Another way is to use mpic++ as the compiler in the CMake.

ztdep
  • 343
  • 1
  • 4
  • 17