]> SALOME platform Git repositories - tools/solverlab.git/commitdiff
Salome HOME
Simplified use of variables for MATPLOTLIB, PyQt and paraview variables
authorndjinga <michael.ndjinga@cea.fr>
Mon, 5 Oct 2020 11:29:22 +0000 (13:29 +0200)
committerndjinga <michael.ndjinga@cea.fr>
Mon, 5 Oct 2020 11:29:22 +0000 (13:29 +0200)
CDMATH/tests/CMakeLists.txt
CDMATH/tests/examples/BurgersEquation1D/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/HeatEquation1DExplicit/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/Poisson2DVF_DISK/FiniteVolumes2DPoisson_DISK.py
CDMATH/tests/examples/TransportEquation1DCenteredExplicit/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/TransportEquation1DCenteredImplicit/CMakeLists.txt
CDMATH/tests/examples/TransportEquation1DUpwindExplicit/CMakeLists.txt [changed mode: 0644->0755]
CDMATH/tests/examples/TransportEquation1DUpwindImplicit/CMakeLists.txt
CMakeLists.txt

index 78b8002c4c2dc10f1b080914630ca51407eb64a4..e343ec9accd99b88d71a2c7784600c3bf45b11e7 100755 (executable)
@@ -33,7 +33,7 @@ IF (CDMATH_WITH_TESTS)
   endif(CDMATH_WITH_PETSC)
 
   if   (CDMATH_WITH_PYTHON)
-    SET(TESTS_PYTHON_PATH ${CMAKE_BINARY_DIR}/CDMATH/swig:${CMAKE_BINARY_DIR}/CDMATH/postprocessing:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${PARAVIEW_ROOT_DIR}/lib/:${PARAVIEW_ROOT_DIR}/lib/python3.6/site-packages/:${PARAVIEW_ROOT_DIR}/lib/python3.6/site-packages/vtkmodules/:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${MATPLOTLIB_ROOT_DIR}/lib/python3.6/site-packages:${PYQT5_ROOT_DIR}:${PYQT5_ROOT_DIR}/lib/python3.6/site-packages:${PYTHONPATH} ) 
+    SET(TESTS_PYTHON_PATH ${CMAKE_BINARY_DIR}/CDMATH/swig:${CMAKE_BINARY_DIR}/CDMATH/postprocessing:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PV_PYTHON_DIR} ) 
   endif(CDMATH_WITH_PYTHON)
 
   TARGET_LINK_LIBRARIES(TestCDMATH TestMesh base mesh ${CPPUNIT_LIBS} ${_extra_lib_TESTS})
old mode 100644 (file)
new mode 100755 (executable)
index a19b719..ec3f10b
@@ -2,7 +2,12 @@
 if (CDMATH_WITH_PYTHON )
 
     ADD_TEST(ExampleBurgersEquation_1DFV_shock_formation ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DBurgersEquation_shock_formation.py )
+    SET_PROPERTY(TEST ExampleBurgersEquation_1DFV_shock_formation        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleBurgersEquation_1DFV_shock_formation APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
+
     ADD_TEST(ExampleBurgersEquation_1DFV_rarefaction_wave ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DBurgersEquation_rarefaction_wave.py )
+    SET_PROPERTY(TEST ExampleBurgersEquation_1DFV_rarefaction_wave        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleBurgersEquation_1DFV_rarefaction_wave APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON )
 
old mode 100644 (file)
new mode 100755 (executable)
index 117a131..33ac254
@@ -6,10 +6,14 @@ if (CDMATH_WITH_PYTHON )
     SET(CFL  0.99  )#Courant Friedrichs Lewy number
 
     ADD_TEST(ExampleHeatEquation_1DFV_Explicit_CFL1 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/HeatEquation1DExplicit.py ${NX} ${CFL})
+    SET_PROPERTY(TEST ExampleHeatEquation_1DFV_Explicit_CFL1        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleHeatEquation_1DFV_Explicit_CFL1 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(CFL  2  )#Courant Friedrichs Lewy number
 
     ADD_TEST(ExampleHeatEquation_1DFV_Explicit_CFL2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/HeatEquation1DExplicit.py ${NX} ${CFL})
+    SET_PROPERTY(TEST ExampleHeatEquation_1DFV_Explicit_CFL2        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleHeatEquation_1DFV_Explicit_CFL2 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON )
 
index e003ed6e6ad0da033bb0996342d4b38b53ff456a..9a923cdb342e2e2ebed4546fc58b5c653165801a 100755 (executable)
@@ -69,7 +69,7 @@ for i in range(nbCells):
                        Ck=my_mesh.getCell(k)
                        distance=Ci.getBarryCenter().distance(Ck.getBarryCenter())
                        coeff=Fj.getMeasure()/Ci.getMeasure()/distance
-                       Rigidite.setValue(i,k,-coeff) # terme extradiagonal
+                       Rigidite.addValue(i,k,-coeff) # terme extradiagonal
                else:
                        coeff=Fj.getMeasure()/Ci.getMeasure()/Ci.getBarryCenter().distance(Fj.getBarryCenter())
                        #For the particular case where the mesh boundary does not coincide with the domain boundary
old mode 100644 (file)
new mode 100755 (executable)
index c28588d..5b6ef87
@@ -8,20 +8,29 @@ if (CDMATH_WITH_PYTHON )
     SET(CFL  0.99  )#Courant Friedrichs Lewy number
 
     ADD_TEST(ExampleTransportEquation_1DFV_CenteredExplicit_Stiff_CFL1 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationCenteredExplicit.py ${NX} ${CFL} ${SMOOTHNESS} )
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_CenteredExplicit_Stiff_CFL1         PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_CenteredExplicit_Stiff_CFL1  APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
-    SET(CFL  0.5  )#Courant Friedrichs Lewy number
+   SET(CFL  0.5  )#Courant Friedrichs Lewy number
+
+    ADD_TEST(ExampleTransportEquation_1DFV_CenteredExplicit_Stiff_CFL0.5 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationCenteredExplicit.py ${NX} ${CFL} ${SMOOTHNESS} ) 
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_CenteredExplicit_Stiff_CFL0.5         PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_CenteredExplicit_Stiff_CFL0.5  APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
-    ADD_TEST(ExampleTransportEquation_1DFV_CenteredExplicit_Stiff_CFL0.5 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationCenteredExplicit.py ${NX} ${CFL} ${SMOOTHNESS} )
 
     SET(SMOOTHNESS  1 )
 
     SET(CFL  0.99  )#Courant Friedrichs Lewy number
 
     ADD_TEST(ExampleTransportEquation_1DFV_CenteredExplicit_Smooth_CFL1 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationCenteredExplicit.py ${NX} ${CFL} ${SMOOTHNESS} )
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_CenteredExplicit_Smooth_CFL1         PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_CenteredExplicit_Smooth_CFL1  APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(CFL  0.5  )#Courant Friedrichs Lewy number
 
     ADD_TEST(ExampleTransportEquation_1DFV_CenteredExplicit_Smooth_CFL0.5 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationCenteredExplicit.py ${NX} ${CFL} ${SMOOTHNESS} )
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_CenteredExplicit_Smooth_CFL0.5         PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_CenteredExplicit_Smooth_CFL0.5  APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON )
 
index a243a0ad4f933e98f8decd2203ff423e728b1611..2498e77807ce2415f6f9d98cb02017f364b2c2a9 100755 (executable)
@@ -6,14 +6,14 @@ if (CDMATH_WITH_PYTHON )
     SET(CFL  1  )#Courant Friedrichs Lewy number
 
     ADD_TEST(ExampleTransportEquation_1DFV_Centered_Implicit_CFL1 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationCenteredImplicit.py ${NX} ${CFL})
-    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL1 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}:${Python_ROOT_DIR}/lib")
-    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL1 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${MATPLOTLIB_ROOT_DIR}/lib/python3.6/site-packages:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL1         PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL1  APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(CFL  2  )#Courant Friedrichs Lewy number
 
     ADD_TEST(ExampleTransportEquation_1DFV_Centered_Implicit_CFL2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationCenteredImplicit.py ${NX} ${CFL})
-    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL2 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}:${Python_ROOT_DIR}/lib")
-    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL2 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${MATPLOTLIB_ROOT_DIR}/lib/python3.6/site-packages:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL2         PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Centered_Implicit_CFL2  APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 
 endif (CDMATH_WITH_PYTHON )
old mode 100644 (file)
new mode 100755 (executable)
index f1fe640..4ff0efc
@@ -6,14 +6,20 @@ if (CDMATH_WITH_PYTHON )
     SET(CFL  0.9999  )#Courant Friedrichs Lewy number
 
     ADD_TEST(ExampleTransportEquation_1DFV_Upwind_Explicit_CFL1 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationUpwindExplicit.py ${NX} ${CFL})
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Explicit_CFL1         PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Explicit_CFL1  APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(CFL  0.5  )#Courant Friedrichs Lewy number
 
     ADD_TEST(ExampleTransportEquation_1DFV_Upwind_Explicit_CFL0.5 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationUpwindExplicit.py ${NX} ${CFL})
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Explicit_CFL0.5         PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Explicit_CFL0.5  APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(CFL  2  )#Courant Friedrichs Lewy number
 
     ADD_TEST(ExampleTransportEquation_1DFV_Upwind_Explicit_CFL2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationUpwindExplicit.py ${NX} ${CFL})
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Explicit_CFL2         PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Explicit_CFL2  APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 endif (CDMATH_WITH_PYTHON )
 
index de2b44d110c6b2c43f46c40c95725e5c5d841ce7..cad8f72cdae109e15bd571c3cef76c721a1fa8ae 100755 (executable)
@@ -6,15 +6,14 @@ if (CDMATH_WITH_PYTHON )
     SET(CFL  1  )#Courant Friedrichs Lewy number
 
     ADD_TEST(ExampleTransportEquation_1DFV_Upwind_Implicit_CFL1 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationUpwindImplicit.py ${NX} ${CFL})
-    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL1 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}:${Python_ROOT_DIR}/lib")
-    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL1 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${MATPLOTLIB_ROOT_DIR}/lib/python3.6/site-packages:${PV_PYTHON_DIR}")
-
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL1        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL1 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
     SET(CFL  2  )#Courant Friedrichs Lewy number
 
     ADD_TEST(ExampleTransportEquation_1DFV_Upwind_Implicit_CFL2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/1DTransportEquationUpwindImplicit.py ${NX} ${CFL})
-    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL2 PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib:${MEDCOUPLING_ROOT_DIR}/lib:${MEDFILE_ROOT_DIR}/lib:${CMAKE_INSTALL_PREFIX}/lib/medcoupling:${CMAKE_INSTALL_PREFIX}/lib/med:${PETSC_DIR}/${PETSC_ARCH}/lib:${HDF5_ROOT_DIR}/lib:${PV_LIB_DIR}:${Python_ROOT_DIR}/lib")
-    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL2 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath:${CMAKE_INSTALL_PREFIX}/bin/cdmath/postprocessing:${CMAKE_INSTALL_PREFIX}/${MEDCOUPLING_INSTALL_PYTHON}:${MATPLOTLIB_ROOT_DIR}/lib/python3.6/site-packages:${PV_PYTHON_DIR}")
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL2        PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=${TESTS_LIBRARY_PATH}:${PV_LIB_DIR}")
+    SET_PROPERTY(TEST ExampleTransportEquation_1DFV_Upwind_Implicit_CFL2 APPEND PROPERTY ENVIRONMENT "PYTHONPATH=${TESTS_PYTHON_PATH}:${PV_PYTHON_DIR}")
 
 
 endif (CDMATH_WITH_PYTHON )
index 0856bdefb210028edf36960bd1df86d19794577b..bcc58c2c3006d745106960948cc259d1e94ba42f 100644 (file)
@@ -42,12 +42,6 @@ list (APPEND CMAKE_MODULE_PATH "${SOLVERLAB_SOURCE_DIR}/cmake_files")
 
 include(ExternalProject)#For PETSc, MED and MEDCoupling
 
-set(Python_ROOT_DIR $ENV{PYTHON_ROOT_DIR} )
-set(PYQT5_ROOT_DIR $ENV{PYQT5_ROOT_DIR} )
-set(PARAVIEW_ROOT_DIR $ENV{PARAVIEW_ROOT_DIR} )
-set(MATPLOTLIB_ROOT_DIR $ENV{MATPLOTLIB_ROOT_DIR} )
-set(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR} )
-
 ######################################################
 # Detection or compilation of PETSc+SLEPc+HDF5       #
 ######################################################
@@ -362,26 +356,26 @@ endif(TARGET PETSc AND TARGET MEDCoupling)
 ####################                                  
 
 # Paraview variables to choose python version and for env_SOLVERLAB.sh  
+if  ( DEFINED PARAVIEW_ROOT_DIR OR DEFINED ENV{PARAVIEW_ROOT_DIR})
+  if  ( DEFINED PARAVIEW_ROOT_DIR )
+    set( PARAVIEW_INCLUDE_DIR   ${PARAVIEW_ROOT_DIR}/include)
+    set( PARAVIEW_LIBRARIES_DIR ${PARAVIEW_ROOT_DIR}/lib)
+  else( DEFINED PARAVIEW_ROOT_DIR )
+    set( PARAVIEW_INCLUDE_DIR   $ENV{PARAVIEW_ROOT_DIR}/include)
+    set( PARAVIEW_LIBRARIES_DIR $ENV{PARAVIEW_ROOT_DIR}/lib)
+  endif( DEFINED PARAVIEW_ROOT_DIR )
+else( DEFINED PARAVIEW_ROOT_DIR OR DEFINED ENV{PARAVIEW_ROOT_DIR})
+  message(STATUS "PARAVIEW_ROOT_DIR not set. Trying to detect paraview.")
+  set( PARAVIEW_INCLUDE_DIR /usr/include/paraview/)
+  set( PARAVIEW_LIBRARIES_DIR /usr/lib/paraview/:/usr/lib64/paraview/:/usr/lib64/vtk/:/usr/lib/vtk/)
+endif( DEFINED PARAVIEW_ROOT_DIR OR DEFINED ENV{PARAVIEW_ROOT_DIR})
+
 if  ( DEFINED PARAVIEW_VERSION OR DEFINED ENV{PARAVIEW_VERSION} )
   if   ( NOT DEFINED PARAVIEW_VERSION )
     set( PARAVIEW_VERSION  $ENV{PARAVIEW_VERSION})
   endif( NOT DEFINED PARAVIEW_VERSION )
   message(STATUS "ParaView version is ${PARAVIEW_VERSION}" )
 else( DEFINED PARAVIEW_VERSION OR DEFINED ENV{PARAVIEW_VERSION} )
-  if  ( DEFINED PARAVIEW_ROOT_DIR OR DEFINED ENV{PARAVIEW_ROOT_DIR})
-    if  ( DEFINED PARAVIEW_ROOT_DIR )
-      set( PARAVIEW_INCLUDE_DIR   ${PARAVIEW_ROOT_DIR}/include)
-      set( PARAVIEW_LIBRARIES_DIR ${PARAVIEW_ROOT_DIR}/lib)
-    else( DEFINED PARAVIEW_ROOT_DIR )
-      set( PARAVIEW_INCLUDE_DIR   $ENV{PARAVIEW_ROOT_DIR}/include)
-      set( PARAVIEW_LIBRARIES_DIR $ENV{PARAVIEW_ROOT_DIR}/lib)
-    endif( DEFINED PARAVIEW_ROOT_DIR )
-  else( DEFINED PARAVIEW_ROOT_DIR OR DEFINED ENV{PARAVIEW_ROOT_DIR})
-    message(STATUS "PARAVIEW_VERSION and PARAVIEW_ROOT_DIR not set. Trying to detect paraview.")
-    set( PARAVIEW_INCLUDE_DIR /usr/include/paraview/)
-    set( PARAVIEW_LIBRARIES_DIR /usr/lib/paraview/:/usr/lib64/paraview/:/usr/lib64/vtk/:/usr/lib/vtk/)
-  endif( DEFINED PARAVIEW_ROOT_DIR OR DEFINED ENV{PARAVIEW_ROOT_DIR})
-
   set( PARAVIEW_SUFFIXES paraview-5.0 paraview-5.1 paraview-5.2 paraview-5.3 paraview-5.4 paraview-5.5 paraview-5.6 paraview-5.7 paraview-5.8 paraview-5.9 )
   find_file( vtkConfig_file vtkPVConfig.h HINTS ${PARAVIEW_INCLUDE_DIR} PATH_SUFFIXES ${PARAVIEW_SUFFIXES})
 
@@ -436,9 +430,21 @@ ELSE (${CMAKE_VERSION} VERSION_GREATER "3.12.0")
   set(Python_VERSION_MINOR ${PYTHON_VERSION_MINOR})
 ENDIF(${CMAKE_VERSION} VERSION_GREATER "3.12.0")
 
+IF  ( PYTHON_ROOT_DIR OR ENV{PYTHON_ROOT_DIR})
+  IF  ( PYTHON_ROOT_DIR )
+    set(PYQT5_ROOT_DIR ${PYQT5_ROOT_DIR} )
+  ELSE( PYTHON_ROOT_DIR })
+    set(PYQT5_ROOT_DIR $ENV{PYQT5_ROOT_DIR} )
+  ENDIF( PYTHON_ROOT_DIR })
+ENDIF(PYTHON_ROOT_DIR OR ENV{PYTHON_ROOT_DIR})
+set(PARAVIEW_ROOT_DIR $ENV{PARAVIEW_ROOT_DIR} )
+set(MATPLOTLIB_ROOT_DIR $ENV{MATPLOTLIB_ROOT_DIR} )
+set(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR} )
+
+
 #Paraview library paths
-set (PV_LIB_DIR    /usr/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/dist-packages/paraview/:/usr/lib64/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/vtk/:${PARAVIEW_LIBRARIES_DIR})
-set (PV_PYTHON_DIR /usr/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/dist-packages/paraview/:/usr/lib64/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/vtk/:/usr/lib64/paraview/site-packages/:/usr/lib64/paraview/site-packages/paraview/:/usr/lib64/paraview/site-packages/vtk/:/usr/lib64/paraview/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/:/usr/lib64/paraview/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/paraview/:/usr/lib64/paraview/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/vtkmodules:/usr/lib/paraview/site-packages/paraview:/usr/lib/paraview/site-packages/paraview/vtk:${PARAVIEW_LIBRARIES_DIR}/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/vtkmodules/)
+set (PV_LIB_DIR    /usr/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/dist-packages/paraview/:/usr/lib64/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/vtk/:${MATPLOTLIB_ROOT_DIR}/lib/:${PARAVIEW_LIBRARIES_DIR})
+set (PV_PYTHON_DIR /usr/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/dist-packages/paraview/:/usr/lib64/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/vtk/:/usr/lib64/paraview/site-packages/:/usr/lib64/paraview/site-packages/paraview/:/usr/lib64/paraview/site-packages/vtk/:/usr/lib64/paraview/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/:/usr/lib64/paraview/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/paraview/:/usr/lib64/paraview/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/vtkmodules:/usr/lib/paraview/site-packages/paraview:/usr/lib/paraview/site-packages/paraview/vtk:${PARAVIEW_ROOT_DIR}/lib/:${PARAVIEW_ROOT_DIR}/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/:${PARAVIEW_ROOT_DIR}/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages/vtkmodules/:${MATPLOTLIB_ROOT_DIR}/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages:${PYQT5_ROOT_DIR}:${PYQT5_ROOT_DIR}/lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages)
 
 message(STATUS "Python version found is ${Python_VERSION}")
 find_package (SWIG 3.0 REQUIRED)