CMake/Modules/FindMPI.cmake

38 lines
1.3 KiB
CMake
Raw Normal View History

# - Find MPI
# This module looks for MPI (Message Passing Interface) support
2001-05-03 01:07:09 +04:00
# it will define the following values
# MPI_INCLUDE_PATH = where mpi.h can be found
2005-12-15 22:17:43 +03:00
# MPI_LIBRARY = the library to link in (mpi mpich etc)
2001-05-03 01:07:09 +04:00
FIND_PATH(MPI_INCLUDE_PATH NAMES mpi.h
PATH_SUFFIXES mpi mpi/include
PATHS
"$ENV{ProgramFiles}/MPICH/SDK/Include"
"$ENV{ProgramFiles}/MPICH2/include"
"C:/Program Files/MPICH/SDK/Include"
)
2001-05-03 01:07:09 +04:00
FIND_LIBRARY(MPI_LIBRARY
2007-06-22 18:22:27 +04:00
NAMES mpich2 mpi mpich mpich.rts
PATH_SUFFIXES mpi/lib
PATHS
"$ENV{ProgramFiles}/MPICH/SDK/Lib"
"$ENV{ProgramFiles}/MPICH2/Lib"
"C:/Program Files/MPICH/SDK/Lib"
)
2001-05-03 01:07:09 +04:00
FIND_LIBRARY(MPI_EXTRA_LIBRARY
NAMES mpi++
PATH_SUFFIXES mpi/lib
PATHS
"$ENV{ProgramFiles}/MPICH/SDK/Lib"
"C:/Program Files/MPICH/SDK/Lib"
DOC "If a second mpi library is necessary, specify it here.")
2007-06-22 18:22:27 +04:00
# on BlueGene/L the MPI lib is named libmpich.rts.a, there also these additional libs are required
IF("${MPI_LIBRARY}" MATCHES "mpich.rts")
SET(MPI_EXTRA_LIBRARY msglayer.rts devices.rts rts.rts devices.rts CACHE STRING "Additional MPI libs" FORCE)
ENDIF("${MPI_LIBRARY}" MATCHES "mpich.rts")
MARK_AS_ADVANCED(MPI_INCLUDE_PATH MPI_LIBRARY MPI_EXTRA_LIBRARY)