]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
*** empty log message ***
authoradam <adam>
Tue, 13 Jul 2010 13:46:16 +0000 (13:46 +0000)
committeradam <adam>
Tue, 13 Jul 2010 13:46:16 +0000 (13:46 +0000)
salome_adm/cmake_files/FindMPI.cmake

index 548b01b772c0d6b1b0bec59069baeb31f3c795d0..51536665f0263d06e33bd9812841d816a30aad4f 100644 (file)
@@ -80,6 +80,7 @@ IF(MPI_STATUS)
   
   MESSAGE(STATUS "MPI include ${MPI_INCLUDE_TO_FIND} found in ${MPI_INCLUDES}")
 
+  SET(MPI_INCLUDE_DIR ${MPI_INCLUDES})
   SET(MPI_INCLUDES -I${MPI_INCLUDES})
   
   # ------
@@ -91,9 +92,13 @@ IF(MPI_STATUS)
     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)
     ENDFOREACH(lib mpi_cxx mpi mpich)
     IF(NOT MPI_LIB)
@@ -110,6 +115,18 @@ ENDIF(MPI_STATUS)
   
 # ------
 
+IF(MPI_STATUS)
+  include(CheckSymbolExists)
+  SET(CMAKE_REQUIRED_LIBRARIES ${MPI_LIBS})
+  CHECK_SYMBOL_EXISTS(MPI_Publish_name ${MPI_INCLUDE_DIR}/mpi.h HAVE_MPI2)
+  IF(HAVE_MPI2)
+    MESSAGE(STATUS "Your mpi implemtentation is compatible with mpi2 ... adding -DHAVE_MPI2")
+    SET(MPI_INCLUDES ${MPI_INCLUDES} -DHAVE_MPI2)
+  ENDIF(HAVE_MPI2)
+ENDIF(MPI_STATUS)
+
+# ------
+
 IF(MPI_STATUS)
   SET(MPI_IS_OK ON)
 ELSE(MPI_STATUS)