From: michael Date: Thu, 20 Jan 2022 16:49:51 +0000 (+0100) Subject: Prepare the integration of petsc4py and slepc4py into swig module X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=91f0be4c74e66b3db62df6d9e8c81ca12ea4658a;p=tools%2Fsolverlab.git Prepare the integration of petsc4py and slepc4py into swig module --- diff --git a/CDMATH/swig/CMakeLists.txt b/CDMATH/swig/CMakeLists.txt index 664a261..71fc96f 100755 --- a/CDMATH/swig/CMakeLists.txt +++ b/CDMATH/swig/CMakeLists.txt @@ -14,6 +14,22 @@ if (CDMATH_WITH_PETSC) ${SLEPC_INCLUDES} ${LINEARSOLVER_DIR}/inc ) + if( EXISTS ${PETSC4PY_ROOT_DIR}/petsc4py/include/petsc4py/petsc4py.i) + INCLUDE_DIRECTORIES( ${PETSC4PY_ROOT_DIR}/petsc4py/include + ${PETSC4PY_ROOT_DIR}/petsc4py/include/petsc4py ) + elseif (EXISTS ${PETSC4PY_ROOT_DIR}/include/petsc4py/petsc4py.i ) + INCLUDE_DIRECTORIES( ${PETSC4PY_ROOT_DIR}/include + ${PETSC4PY_ROOT_DIR}/include/petsc4py ) + endif( EXISTS ${PETSC4PY_ROOT_DIR}/petsc4py/include/petsc4py/petsc4py.i) + + if( EXISTS ${SLEPC4PY_ROOT_DIR}/slepc4py/include/slepc4py/slepc4py.i) + INCLUDE_DIRECTORIES( ${SLEPC4PY_ROOT_DIR}/slepc4py/include + ${SLEPC4PY_ROOT_DIR}/slepc4py/include/slepc4py ) + elseif (EXISTS ${SLEPC4PY_ROOT_DIR}/include/slepc4py/slepc4py.i ) + INCLUDE_DIRECTORIES( ${SLEPC4PY_ROOT_DIR}/include + ${SLEPC4PY_ROOT_DIR}/include/slepc4py ) + endif( EXISTS ${SLEPC4PY_ROOT_DIR}/slepc4py/include/slepc4py/slepc4py.i) + file(COPY cdmath_with_petsc.i DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/cdmath_with_petsc.i ${CMAKE_CURRENT_BINARY_DIR}/cdmath.i) else (CDMATH_WITH_PETSC) diff --git a/CDMATH/swig/cdmath_with_petsc.i b/CDMATH/swig/cdmath_with_petsc.i index 131d235..155e335 100644 --- a/CDMATH/swig/cdmath_with_petsc.i +++ b/CDMATH/swig/cdmath_with_petsc.i @@ -78,6 +78,8 @@ def VectorIdiv(self,*args): %include "MEDCouplingCommon.i" %include std_string.i +/* %include slepc4py.i */ + %include "GenericMatrix.hxx" %include "Matrix.hxx" %include "Vector.hxx" diff --git a/CoreFlows/swig/CMakeLists.txt b/CoreFlows/swig/CMakeLists.txt index ad24596..b83bc47 100755 --- a/CoreFlows/swig/CMakeLists.txt +++ b/CoreFlows/swig/CMakeLists.txt @@ -12,13 +12,6 @@ INCLUDE_DIRECTORIES( ) IF( ${SOLVERLAB_WITH_MPI} ) - INCLUDE_DIRECTORIES( - ${Python_INCLUDE_DIRS} - ${CoreFlows_INCLUDES} # - ${PETSC_INCLUDES} - ${SLEPC_INCLUDES} - ) - if(EXISTS ${MPI4PY_ROOT_DIR}/mpi4py/include/mpi4py/mpi4py.i) INCLUDE_DIRECTORIES( ${MPI4PY_ROOT_DIR}/mpi4py/include ${MPI4PY_ROOT_DIR}/mpi4py/include/mpi4py ) @@ -28,21 +21,21 @@ IF( ${SOLVERLAB_WITH_MPI} ) endif() ENDIF( ${SOLVERLAB_WITH_MPI} ) -if(EXISTS ${PETSC4PY_ROOT_DIR}/petsc4py/include/petsc4py/petsc4py.i) +if( EXISTS ${PETSC4PY_ROOT_DIR}/petsc4py/include/petsc4py/petsc4py.i) INCLUDE_DIRECTORIES( ${PETSC4PY_ROOT_DIR}/petsc4py/include ${PETSC4PY_ROOT_DIR}/petsc4py/include/petsc4py ) elseif (EXISTS ${PETSC4PY_ROOT_DIR}/include/petsc4py/petsc4py.i ) INCLUDE_DIRECTORIES( ${PETSC4PY_ROOT_DIR}/include ${PETSC4PY_ROOT_DIR}/include/petsc4py ) -endif() +endif( EXISTS ${PETSC4PY_ROOT_DIR}/petsc4py/include/petsc4py/petsc4py.i) -if(EXISTS ${SLEPC4PY_ROOT_DIR}/slepc4py/include/slepc4py/slepc4py.i) +if( EXISTS ${SLEPC4PY_ROOT_DIR}/slepc4py/include/slepc4py/slepc4py.i) INCLUDE_DIRECTORIES( ${SLEPC4PY_ROOT_DIR}/slepc4py/include ${SLEPC4PY_ROOT_DIR}/slepc4py/include/slepc4py ) elseif (EXISTS ${SLEPC4PY_ROOT_DIR}/include/slepc4py/slepc4py.i ) INCLUDE_DIRECTORIES( ${SLEPC4PY_ROOT_DIR}/include ${SLEPC4PY_ROOT_DIR}/include/slepc4py ) -endif() +endif( EXISTS ${SLEPC4PY_ROOT_DIR}/slepc4py/include/slepc4py/slepc4py.i) IF (${CMAKE_VERSION} VERSION_LESS "3.8.0") SWIG_ADD_MODULE(CoreFlows python CoreFlows.i) diff --git a/CoreFlows/swig/CoreFlows.i b/CoreFlows/swig/CoreFlows.i index e426b48..26cadc0 100755 --- a/CoreFlows/swig/CoreFlows.i +++ b/CoreFlows/swig/CoreFlows.i @@ -4,6 +4,8 @@ %include std_vector.i %include std_map.i +/* %include slepc4py.i */ + #ifdef MPI4PY_ROOT_DIR %include mpi4py.i %mpi4py_typemap(Comm, MPI_Comm);