From: michael Date: Wed, 24 Nov 2021 12:26:52 +0000 (+0100) Subject: Allowed use of pip installation of mpi4y X-Git-Tag: V9_8_0~34 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c9538a037f655c3b0a05ba043351b14f118076d3;p=tools%2Fsolverlab.git Allowed use of pip installation of mpi4y --- diff --git a/CMakeLists.txt b/CMakeLists.txt index bc97a93..c50d414 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/CoreFlows/swig/CMakeLists.txt b/CoreFlows/swig/CMakeLists.txt index 553b8a1..e78beb4 100755 --- a/CoreFlows/swig/CMakeLists.txt +++ b/CoreFlows/swig/CMakeLists.txt @@ -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") diff --git a/CoreFlows/swig/CoreFlows.i b/CoreFlows/swig/CoreFlows.i index d659bac..e426b48 100755 --- a/CoreFlows/swig/CoreFlows.i +++ b/CoreFlows/swig/CoreFlows.i @@ -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