FIND_LIBRARY(MPI_LIB_THREAD libboost_thread-vc90-mt-gd-1_35 ${MPI_ROOT}/lib)
FIND_LIBRARY(MPI_LIB_DATE_TIME libboost_date_time-vc90-mt-gd-1_35 ${MPI_ROOT}/lib)
ELSE(WINDOWS)
+ SET(MPI_LIB_FOUND 0)
FOREACH(lib mpi_cxx mpi mpich)
- FIND_LIBRARY(MPI_LIB ${lib} ${MPI_ROOT}/lib)
- IF(MPI_LIB)
- IF(lib STREQUAL mpi_cxx)
- SET(MPI_INCLUDES ${MPI_INCLUDES} -DOMPI_IGNORE_CXX_SEEK)
- ENDIF(lib STREQUAL mpi_cxx)
- IF(lib STREQUAL mpich)
- SET(MPI_INCLUDES ${MPI_INCLUDES} -DMPICH_IGNORE_CXX_SEEK)
- ENDIF(lib STREQUAL mpich)
- BREAK()
- ENDIF(MPI_LIB)
+ FIND_LIBRARY(MPI_LIB_${lib} ${lib} ${MPI_ROOT}/lib)
+ IF(MPI_LIB_${lib})
+ SET(MPI_LIB_FOUND 1)
+ ENDIF(MPI_LIB_${lib})
ENDFOREACH(lib mpi_cxx mpi mpich)
- IF(NOT MPI_LIB)
+ IF(MPI_LIB_FOUND)
+ IF(MPI_LIB_mpi_cxx AND MPI_LIB_mpi)
+ SET(MPI_LIBS ${MPI_LIB_mpi_cxx} ${MPI_LIB_mpi})
+ SET(MPI_INCLUDES ${MPI_INCLUDES} -DOMPI_IGNORE_CXX_SEEK)
+ ELSEIF(MPI_LIB_mpi_cxx)
+ SET(MPI_LIBS ${MPI_LIB_mpi_cxx})
+ SET(MPI_INCLUDES ${MPI_INCLUDES} -DOMPI_IGNORE_CXX_SEEK)
+ ELSEIF(MPI_LIB_mpi)
+ SET(MPI_LIBS ${MPI_LIB_mpi})
+ SET(MPI_INCLUDES ${MPI_INCLUDES} -DOMPI_IGNORE_CXX_SEEK)
+ ELSEIF(MPI_LIB_mpich)
+ SET(MPI_LIBS ${MPI_LIB_mpich})
+ SET(MPI_INCLUDES ${MPI_INCLUDES} -DMPICH_IGNORE_CXX_SEEK)
+ ENDIF()
+ ELSE(MPI_LIB_FOUND)
MESSAGE(STATUS "MPI lib not found, check your MPI installation.")
SET(MPI_STATUS 0)
- ENDIF(NOT MPI_LIB)
- MESSAGE(STATUS "MPI lib : ${MPI_LIB}")
+ ENDIF(MPI_LIB_FOUND)
ENDIF(WINDOWS)
-
- SET(MPI_LIBS ${MPI_LIB})
-
MESSAGE(STATUS "MPI libs: ${MPI_LIBS}")
ENDIF(MPI_STATUS)