ecbuild_find_mpi

Find MPI and check if MPI compilers successfully compile C/C++/Fortran.

ecbuild_find_mpi( [ COMPONENTS <component1> [ <component2> ... ] ]
                  [ REQUIRED ] )

Options

COMPONENTSoptional, defaults to C

list of required languages bindings

REQUIREDoptional

fail if MPI was not found

Input variables

ECBUILD_FIND_MPIoptional, defaults to TRUE

test C/C++/Fortran MPI compiler wrappers (assume working if FALSE)

Output variables

The following CMake variables are set if MPI was found:

MPI_FOUND
MPI_LIBRARY
MPI_EXTRA_LIBRARY

The following CMake variables are set if C bindings were found:

MPI_C_FOUND
MPI_C_COMPILER
MPI_C_COMPILE_FLAGS
MPI_C_INCLUDE_PATH
MPI_C_LIBRARIES
MPI_C_LINK_FLAGS

The following CMake variables are set if C++ bindings were found:

MPI_CXX_FOUND
MPI_CXX_COMPILER
MPI_CXX_COMPILE_FLAGS
MPI_CXX_INCLUDE_PATH
MPI_CXX_LIBRARIES
MPI_CXX_LINK_FLAGS

The following CMake variables are set if Fortran bindings were found:

MPI_Fortran_FOUND
MPI_Fortran_COMPILER
MPI_Fortran_COMPILE_FLAGS
MPI_Fortran_INCLUDE_PATH
MPI_Fortran_LIBRARIES
MPI_Fortran_LINK_FLAGS

ecbuild_enable_mpi

Find MPI, add include directories and set compiler flags.

ecbuild_enable_mpi( [ COMPONENTS <component1> [ <component2> ... ] ]
                    [ REQUIRED ] )

For each MPI language binding found, set the corresponding compiler flags and add the include directories.

See ecbuild_find_mpi for input and output variables.

Options

COMPONENTSoptional, defaults to C

list of required languages bindings

REQUIREDoptional

fail if MPI was not found

ecbuild_include_mpi

Add MPI include directories and set compiler flags, assuming MPI was found.

For each MPI language binding found, set corresponding compiler flags and add include directories. ecbuild_find_mpi must have been called before.