]> SALOME platform Git repositories - tools/solverlab.git/commitdiff
Salome HOME
Prepare the integration of petsc4py and slepc4py into swig module
authormichael <michael@localhost.localdomain>
Thu, 20 Jan 2022 16:49:51 +0000 (17:49 +0100)
committermichael <michael@localhost.localdomain>
Thu, 20 Jan 2022 16:49:51 +0000 (17:49 +0100)
CDMATH/swig/CMakeLists.txt
CDMATH/swig/cdmath_with_petsc.i
CoreFlows/swig/CMakeLists.txt
CoreFlows/swig/CoreFlows.i

index 664a2611a06509848bafbdab23d1acc92b0c6ca7..71fc96f477ca8c2fcd059793476ce233dcfad4a1 100755 (executable)
@@ -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)
index 131d23553a2e9a6d375ac69ba9bfd4709c0c31f7..155e33571cc5e28e23b35a705f864db435bc2ca4 100644 (file)
@@ -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"
index ad245967fe40f47272e0c2213b9073410ce8b01b..b83bc477a9bbbddb8132f1b12c479da97af412a2 100755 (executable)
@@ -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)
index e426b486631b7eacc7658861f1e43b2cff9ef170..26cadc0e449453d71dce2cb843ec248fcb86921b 100755 (executable)
@@ -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);