From 41d1feb86909efcafe590d5dbf6a3c95281d8a8c Mon Sep 17 00:00:00 2001 From: ageay Date: Fri, 10 Feb 2012 15:49:01 +0000 Subject: [PATCH] In openmpi need to link with libmpi_cxx and libmpi.so --- salome_adm/cmake_files/FindMPI.cmake | 37 ++++++++++++++++------------ 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/salome_adm/cmake_files/FindMPI.cmake b/salome_adm/cmake_files/FindMPI.cmake index 9a38f5c1e..49ff14d74 100644 --- a/salome_adm/cmake_files/FindMPI.cmake +++ b/salome_adm/cmake_files/FindMPI.cmake @@ -93,27 +93,32 @@ IF(MPI_STATUS) 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) -- 2.39.2