]> SALOME platform Git repositories - tools/solverlab.git/commitdiff
Salome HOME
Allowed use of pip installation of mpi4y
authormichael <michael@localhost.localdomain>
Wed, 24 Nov 2021 12:26:52 +0000 (13:26 +0100)
committermichael <michael@localhost.localdomain>
Wed, 24 Nov 2021 12:26:52 +0000 (13:26 +0100)
CMakeLists.txt
CoreFlows/swig/CMakeLists.txt
CoreFlows/swig/CoreFlows.i

index bc97a93d0123d3c72b35de5c1187c6e5bef8e9e0..c50d4143e1f8f83010ee2f104b2430864ee55bda 100644 (file)
@@ -43,7 +43,7 @@ set (DOWNLOAD_OPENMPI       https://download.open-mpi.org/release/open-mpi/v3.1/
      CACHE STRING           "OPENMPI tarball path/url" )
 set (DOWNLOAD_HYPRE         https://github.com/hypre-space/hypre/archive/v2.23.0.zip
      CACHE STRING           "HYPRE tarball path/url" )
-set (DOWNLOAD_MPI4PY         https://bitbucket.org/mpi4py/mpi4py/downloads/mpi4py-3.1.1.tar.gz
+set (DOWNLOAD_MPI4PY         https://bitbucket.org/mpi4py/mpi4py/downloads/mpi4py-3.1.2.tar.gz
      CACHE STRING           "MPY4PY tarball path/url" )
 
 set (CMAKE_BUILD_TYPE Release CACHE STRING "Installation mode")
@@ -79,11 +79,11 @@ endif( DEFINED ENV{MPI_HOME} OR MPI_HOME )
 # Definition of MPI4PY_ROOT_DIR
 if(   ${SOLVERLAB_WITH_PYTHON} AND ${SOLVERLAB_WITH_MPI} AND NOT ${MPI4PY_ROOT_DIR})
   message(STATUS "Defining MPI4PY directory" )
-  if(    DEFINED $ENV{MPI4PY_ROOT_DIR})
+  if(    DEFINED ENV{MPI4PY_ROOT_DIR})
     set(MPI4PY_ROOT_DIR $ENV{MPI4PY_ROOT_DIR})
-  else(  DEFINED $ENV{MPI4PY_ROOT_DIR})
+  else(  DEFINED ENV{MPI4PY_ROOT_DIR})
     set(MPI4PY_ROOT_DIR ${PETSC_DIR}/${PETSC_ARCH}/lib/mpi4py)
-  endif( DEFINED $ENV{MPI4PY_ROOT_DIR})
+  endif( DEFINED ENV{MPI4PY_ROOT_DIR})
 endif(${SOLVERLAB_WITH_PYTHON} AND ${SOLVERLAB_WITH_MPI} AND NOT ${MPI4PY_ROOT_DIR})
 
 if(    MPI4PY_ROOT_DIR)
index 553b8a1d401f0dd73d8e990a83c62ba70dab933f..e78beb490114a26d45416a8b1a0da263d8509115 100755 (executable)
@@ -17,10 +17,17 @@ IF(    ${SOLVERLAB_WITH_MPI} )
     ${CoreFlows_INCLUDES}                                                                                          #
     ${PETSC_INCLUDES}
     ${SLEPC_INCLUDES}
-    ${MPI4PY_ROOT_DIR}/include/
   ) 
 ENDIF( ${SOLVERLAB_WITH_MPI} )
 
+if(EXISTS ${MPI4PY_ROOT_DIR}/mpi4py/include/mpi4py/mpi4py.i)
+  INCLUDE_DIRECTORIES( ${MPI4PY_ROOT_DIR}/mpi4py/include
+                       ${MPI4PY_ROOT_DIR}/mpi4py/include/mpi4py )
+elseif (EXISTS ${MPI4PY_ROOT_DIR}/include/mpi4py/mpi4py.i )
+  INCLUDE_DIRECTORIES( ${MPI4PY_ROOT_DIR}/include
+                       ${MPI4PY_ROOT_DIR}/include/mpi4py )
+endif()
+
 IF   (${CMAKE_VERSION} VERSION_LESS "3.8.0") 
   SWIG_ADD_MODULE(CoreFlows python CoreFlows.i)
 ELSE (${CMAKE_VERSION} VERSION_LESS "3.8.0") 
index d659bacfde85098029a563c2a9013143cc31d566..e426b486631b7eacc7658861f1e43b2cff9ef170 100755 (executable)
@@ -5,7 +5,7 @@
 %include std_map.i
 
 #ifdef MPI4PY_ROOT_DIR
-%include MPI4PY_ROOT_DIR/include/mpi4py/mpi4py.i
+%include mpi4py.i
 %mpi4py_typemap(Comm, MPI_Comm);
 #endif