]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
Split Numpy and Scipy detection
authorageay <ageay>
Tue, 26 Nov 2013 10:44:09 +0000 (10:44 +0000)
committerageay <ageay>
Tue, 26 Nov 2013 10:44:09 +0000 (10:44 +0000)
src/MEDCalculator/Swig/CMakeLists.txt
src/MEDCouplingCorba_Swig/CMakeLists.txt
src/MEDCouplingCorba_Swig/Client/CMakeLists.txt
src/MEDCoupling_Swig/CMakeLists.txt
src/MEDCoupling_Swig/MEDCouplingRefCountObject.i
src/MEDCoupling_Swig/MEDCouplingRemapperTest.py
src/MEDLoader/Swig/CMakeLists.txt
src/ParaMEDMEM_Swig/CMakeLists.txt
src/RENUMBER_Swig/CMakeLists.txt

index db42f32c150c026e903ba492d27991edc6628f4f..b10981ba3e4e3316f973d1077cc079e8dbafeed3 100644 (file)
@@ -48,9 +48,7 @@ INSTALL(TARGETS medcalculatorspython DESTINATION ${SALOME_INSTALL_LIBS})
 
 SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES CPLUSPLUS ON)
 SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
-  SET(SWIG_MODULE_MEDCalculator_EXTRA_FLAGS -DWITH_NUMPY)
-ENDIF(NUMPY_FOUND)
+SET(SWIG_MODULE_MEDCalculator_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY})
 SWIG_ADD_MODULE(MEDCalculator python MEDCalculator.i)
 SWIG_LINK_LIBRARIES(MEDCalculator ${PYTHON_LIBRARIES} medcalculator)
 
index bd523c13d4a65246ebcc49046216c6d0c2f878a2..35eb37f18b9cf4fe8cd893cd1bc6649824399cbc 100644 (file)
@@ -27,9 +27,7 @@ INCLUDE(${SWIG_USE_FILE})
 
 SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES CPLUSPLUS ON)
 SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
-  SET(SWIG_MODULE_MEDCouplingCorba_EXTRA_FLAGS -DWITH_NUMPY)
-ENDIF(NUMPY_FOUND)
+SET(SWIG_MODULE_MEDCouplingCorba_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY})
 
 SET(MEDCouplingCorba_SWIG_DPYS_FILES
     MEDCouplingCorbaTypemaps.i)
index 03a46a352a4f688b12fe91a503f669d0cd5ade3b..dfde63bfbf540baf1c0362dbc7957f294ce92d14 100644 (file)
@@ -25,9 +25,7 @@ INCLUDE(${SWIG_USE_FILE})
 
 SET_SOURCE_FILES_PROPERTIES(MEDCouplingClient.i PROPERTIES CPLUSPLUS ON)
 SET_SOURCE_FILES_PROPERTIES(MEDCouplingClient.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
-  SET(SWIG_MODULE_MEDCouplingClient_EXTRA_FLAGS -DWITH_NUMPY)
-ENDIF(NUMPY_FOUND)
+SET(SWIG_MODULE_MEDCouplingClient_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY})
 
 INCLUDE_DIRECTORIES(
   ${PYTHON_INCLUDE_DIRS}
index e6454ece2c75e24d9a030e044f05b79e01dba0c1..d136337d2fcc93b1244db3e92b2d320630d1a5cd 100644 (file)
@@ -23,9 +23,7 @@ ADD_DEFINITIONS(${PYTHON_DEFINITIONS})
 
 SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES CPLUSPLUS ON)
 SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
-  SET(SWIG_MODULE_MEDCoupling_EXTRA_FLAGS -DWITH_NUMPY)
-ENDIF(NUMPY_FOUND)
+SET(SWIG_MODULE_MEDCoupling_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY})
 
 SET (MEDCoupling_SWIG_DPYS_FILES
     MEDCouplingCommon.i
@@ -57,9 +55,7 @@ SWIG_LINK_LIBRARIES(MEDCoupling ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medcoupling
 
 SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES CPLUSPLUS ON)
 SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
-  SET(SWIG_MODULE_MEDCouplingRemapper_EXTRA_FLAGS -DWITH_NUMPY)
-ENDIF(NUMPY_FOUND)
+SET(SWIG_MODULE_MEDCouplingRemapper_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY})
 
 # _ABR_ Ensure dependency mechanism on all SWIG files and headers
 SET (SWIG_MODULE_MEDCouplingRemapper_EXTRA_DEPS ${MEDCoupling_SWIG_DPYS_FILES}
index 71394bd1d7dd468f64d81a2d54d452bff39cc83e..4bdb8a68ca90701194fc4c89a18e09037bef4b08 100644 (file)
@@ -129,6 +129,15 @@ namespace ParaMEDMEM
 #endif
   }
 
+  bool MEDCouplingHasSciPyBindings()
+  {
+#ifdef WITH_SCIPY
+    return true;
+#else
+    return false;
+#endif
+  }
+
   std::string MEDCouplingCompletionScript() throw(INTERP_KERNEL::Exception)
   {
     static const char script[]="import rlcompleter,readline\nreadline.parse_and_bind('tab:complete')";
index 3b9dc6b52f693640da05bb863e03094de0cc71f4..9c463ca08e3b7710fa094977c2f84801de8e8dd5 100644 (file)
@@ -587,7 +587,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         self.assertAlmostEqual(0.3521445110626687 ,m[6][170],12)
         pass
 
-    @unittest.skipUnless(MEDCouplingHasNumPyBindings(),"requires numpy")
+    @unittest.skipUnless(MEDCouplingHasNumPyBindings() and MEDCouplingHasSciPyBindings(),"requires numpy AND scipy")
     def testGetCrudeCSRMatrix1(self):
         """ testing CSR matrix output using numpy/scipy.
         """
@@ -644,7 +644,7 @@ class MEDCouplingBasicsTest(unittest.TestCase):
         self.assertEqual(m_1.getnnz(),7)
         pass
     
-    @unittest.skipUnless(MEDCouplingHasNumPyBindings(),"requires numpy")
+    @unittest.skipUnless(MEDCouplingHasNumPyBindings() and MEDCouplingHasSciPyBindings(),"requires numpy AND scipy")
     def testP0P1Bary_1(self):
         a=MEDCouplingUMesh("a",2)
         a.allocateCells()
index 513cd99f1fb1ed806ebce89025000680c767aa76..c011c3ce46175bcc4992a345d1a1b8005da33f93 100644 (file)
@@ -25,9 +25,7 @@ ADD_DEFINITIONS(${PYTHON_DEFINITIONS})
 
 SET_SOURCE_FILES_PROPERTIES(MEDLoader.i PROPERTIES CPLUSPLUS ON)
 SET_SOURCE_FILES_PROPERTIES(MEDLoader.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
-  SET(SWIG_MODULE_MEDLoader_EXTRA_FLAGS -DWITH_NUMPY)
-ENDIF(NUMPY_FOUND)
+SET(SWIG_MODULE_MEDLoader_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY})
 
 SET (MEDLoader_SWIG_DPYS_FILES
     MEDLoaderCommon.i
index 57a82a540963fb264c4d03e5a5749b82079493ee..a9912718127b9c0559e67e57ab079ed7d259b0d6 100644 (file)
@@ -24,9 +24,7 @@ INCLUDE(${SWIG_USE_FILE})
 
 SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES CPLUSPLUS ON)
 SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
-  SET(SWIG_MODULE_ParaMEDMEM_EXTRA_FLAGS -DWITH_NUMPY)
-ENDIF(NUMPY_FOUND)
+SET(SWIG_MODULE_ParaMEDMEM_EXTRA_FLAGS ${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY})
 
 SET (ParaMEDMEM_SWIG_DPYS_FILES
     ParaMEDMEM.typemap)
@@ -57,9 +55,6 @@ SWIG_LINK_LIBRARIES(ParaMEDMEM ${PYTHON_LIBRARIES} paramedmem medloader)
 
 SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES CPLUSPLUS ON)
 SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
-  SET(SWIG_MODULE_ParaMEDMEM_EXTRA_FLAGS -DWITH_NUMPY)
-ENDIF(NUMPY_FOUND)
 
 INSTALL(TARGETS _ParaMEDMEM DESTINATION ${SALOME_INSTALL_PYTHON})
 INSTALL(FILES ParaMEDMEM.i DESTINATION ${SALOME_INSTALL_HEADERS})
index a879a874c07f83843d9f6d8b72004e0eab4b9454..128e365f56dead5d09d4bcaf40440b46b69d338c 100644 (file)
@@ -23,11 +23,7 @@ ADD_DEFINITIONS(${PYTHON_DEFINITIONS})
 
 SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES CPLUSPLUS ON)
 SET_SOURCE_FILES_PROPERTIES(MEDRenumber.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-IF(NUMPY_FOUND)
-  SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DWITH_NUMPY -DWITHOUT_AUTOFIELD)
-ELSE(NUMPY_FOUND)
-  SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DWITHOUT_AUTOFIELD)
-ENDIF(NUMPY_FOUND)
+SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS "${SWIG_EXTRA_FLAGS_FOR_NUMPYANDSCIPY};-DWITHOUT_AUTOFIELD")
 
 IF(Boost_FOUND)
   SET(SWIG_MODULE_MEDRenumber_EXTRA_FLAGS -DHAS_BOOST ${SWIG_MODULE_MEDRenumber_EXTRA_FLAGS})