]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
add modifications for native compilation
authorGuytri KASTANE <guytri.kastane@cea.fr>
Thu, 21 Sep 2023 11:31:28 +0000 (13:31 +0200)
committerGuytri KASTANE <guytri.kastane@cea.fr>
Thu, 21 Sep 2023 11:31:28 +0000 (13:31 +0200)
applications/SALOME-master-native.pyconf
products/compil_scripts/petsc-3.19.4.sh
products/env_scripts/fftw.py
products/env_scripts/lapack.py
products/env_scripts/metis.py
products/patches/petsc-3.19.4-libpath.patch [new file with mode: 0644]
products/petsc.pyconf

index 69ed64ddc282693e2d2894b8657507764370443e..e481b23f6c60ebf7058c14fa708cfbcf8d7e63c6 100644 (file)
@@ -99,7 +99,7 @@ APPLICATION :
         pandas : 'native'
         ParaView : {tag:'5.11.0', base: 'no',  section: 'version_5_11_0_MPI', hpc: 'yes'}
         PERSALYS: 'v14.0.1'
-        petsc : {tag : '3.16.0', section: 'version_3_16_0'}
+        petsc : {tag : '3.19.4', base: 'no', section: 'version_3_19_4'}
         Pillow : 'native'
         planegcs : '0.18-3cb6890'
         psutil : 'native'
index 9a578754d0df351353690c2a08c4f91556506e10..c30c7602a7b7c228201e1f8e166443e2022d7cd5 100755 (executable)
@@ -7,34 +7,33 @@ echo "##########################################################################
 cp -r $SOURCE_DIR/* .
 
 CONFIGURE_FLAGS=
+CONFIGURE_FLAGS+=" --download-slepc=ext/slepc-3.19.2.tar.gz"
 CONFIGURE_FLAGS+=" --with-blaslapack-dir=${LAPACK_ROOT_DIR}"
 CONFIGURE_FLAGS+=" --with-python-dir=${PYTHON_ROOT_DIR}"
-CONFIGURE_FLAGS+=" --download-slepc=ext/slepc-3.19.2.tar.gz"
 CONFIGURE_FLAGS+=" --with-hdf5-dir=${HDF5_ROOT_DIR}"
 CONFIGURE_FLAGS+=" --with-fftw-dir=${FFTW_ROOT_DIR}"
 CONFIGURE_FLAGS+=" --with-cuda=0" # 
 CONFIGURE_FLAGS+=" --with-debugging=0" # by default Petsc is build in debug mode
 CONFIGURE_FLAGS+=" --with-petsc4py=yes"
 CONFIGURE_FLAGS+=" --download-slepc-configure-arguments=--with-slepc4py=yes "
-CONFIGURE_FLAGS+=" --CFLAGS=-fPIC" # 
 echo
 if [ -n "${SAT_HPC}" ]
 then
-  CONFIGURE_FLAGS+=" --download-hypre=ext/hypre-2.27.0.tar.gz"
-  CONFIGURE_FLAGS+=" --download-parms=ext/parms-3.2-p5.tar.gz"
-  CONFIGURE_FLAGS+=" --download-metis=ext/metis-5.1.0-p10.tar.gz"
-  CONFIGURE_FLAGS+=" --download-parmetis=ext/parmetis-4.0.3-p6.tar.gz"
-  CONFIGURE_FLAGS+=" --download-ptscotch=ext/scotch_6.1.0.tar.gz"
+  CONFIGURE_FLAGS+=" --download-hypre=ext/hypre-2.28.0.tar.gz"
+  CONFIGURE_FLAGS+=" --download-metis=ext/metis-5.1.0-p11.tar.gz"
+  CONFIGURE_FLAGS+=" --download-ptscotch=ext/scotch_7.0.3.tar.gz"
+
   if [ -n "${MPI4PY_ROOT_DIR}" ]
   then
       CONFIGURE_FLAGS+=" --with-mpi4py-dir=${MPI4PY_ROOT_DIR}"
   else
-      CONFIGURE_FLAGS+=" --download-mpi4py=ext/mpi4py-3.0.3.tar.gz"
+      CONFIGURE_FLAGS+=" --download-mpi4py=yes" #ext/mpi4py-3.0.3.tar.gz"
   fi
   echo "*** configure --prefix=${PRODUCT_INSTALL} --with-mpi-dir=${MPI_ROOT_DIR} ${CONFIGURE_FLAGS}"
   ./configure --prefix=${PRODUCT_INSTALL} --with-mpi-dir=${MPI_ROOT_DIR} ${CONFIGURE_FLAGS}
 else
-  CONFIGURE_FLAGS+=" --with-metis-dir=${METIS_ROOT_DIR}"
+  #CONFIGURE_FLAGS+=" --with-metis-dir=${METIS_ROOT_DIR}"
+  CONFIGURE_FLAGS+=" --download-metis=ext/metis-5.1.0-p11.tar.gz"
   echo "*** configure --prefix=${PRODUCT_INSTALL} --with-mpi=0 ${CONFIGURE_FLAGS}"
   ./configure --prefix=${PRODUCT_INSTALL} --with-mpi=0 ${CONFIGURE_FLAGS}
 fi
@@ -68,6 +67,15 @@ then
     exit 3
 fi
 
+echo
+echo "*** make check"
+make $MAKE_OPTIONS check
+if [ $? -ne 0 ]
+then
+    echo "ERROR on make check"
+    exit 4
+fi
+
 echo
 echo "########## END"
 
index e985216fe93f592af5ef28e9ae1c4977719ff928..84bbfba0439c8ad4735cf05ddd7ef2c7d2d9821f 100644 (file)
@@ -13,4 +13,22 @@ def set_env(env, prereq_dir, version):
         env.prepend('LD_LIBRARY_PATH', os.path.join(prereq_dir, 'lib'))
 
 def set_nativ_env(env):
-    pass
+    prereq_dir='/usr'
+    prereq_bin='/usr/bin'
+    prereq_inc='/usr/include'
+    try:
+        import distro
+        if any(distribution in distro.name().lower() for distribution in ["rocky", "centos", "fedora"]) :
+            prereq_dir='/usr'
+            prereq_bin='/usr/bin'
+            prereq_inc='/usr/include/fftw'
+        elif any(distribution in distro.name().lower() for distribution in ["debian", "ubuntu"]) :
+            prereq_dir='/usr/lib/x86_64-linux-gnu'
+            prereq_inc='/usr/include'
+    except:
+        import patform
+        #FIXME
+
+    env.set('FFTW_ROOT_DIR', prereq_dir)
+    env.set('FFTW_INCLUDE_DIR', prereq_inc)
+    env.prepend('LD_LIBRARY_PATH', prereq_dir)
index 26ecc76d3985306563055901cd63d90e8cedf794..e4d0c6780326a6141f59c4a68ffb695d76b12846 100644 (file)
@@ -21,6 +21,9 @@ def set_env(env, prereq_dir, version):
     env.prepend('PATH', os.path.join(prereq_dir, 'bin'))
 
 def set_nativ_env(env):
-    env.set('LAPACKHOME', '/usr')
-    env.set('LAPACK_ROOT_DIR', '/')
+    prereq_dir='/usr/lib/x86_64-linux-gnu'
+    env.set('LAPACKHOME', prereq_dir)
+    env.set('LAPACK_ROOT_DIR', prereq_dir)
+    env.prepend('LD_LIBRARY_PATH', prereq_dir)
+
 
index 09f763bbb1d0b021c7f55c66b98c7a8a098ae05e..07bdb090e0e2d1cbc38a68ab6455b6f1f1870037 100755 (executable)
@@ -17,5 +17,26 @@ def set_env(env, prereq_dir, version):
         env.prepend('PATH', os.path.join(prereq_dir, 'bin'))
     
 def set_nativ_env(env):
-    env.set('METISDIR', '/usr')
-    env.set('METIS_ROOT_DIR', '/usr')  # update for cmake    
+    #env.set('METISDIR', '/usr')
+    #env.set('METIS_ROOT_DIR', '/usr')  # update for cmake    
+    prereq_dir='/usr'
+    prereq_bin='/usr/bin'
+    prereq_inc='/usr/include'
+    try:
+        import distro
+        if any(distribution in distro.name().lower() for distribution in ["rocky", "centos", "fedora"]) :
+            prereq_dir='/usr'
+            prereq_bin='/usr/bin'
+            prereq_inc='/usr/include'
+        elif any(distribution in distro.name().lower() for distribution in ["debian", "ubuntu"]) :
+            prereq_dir='/usr/lib/x86_64-linux-gnu'
+            prereq_inc='/usr/include'
+    except:
+        import patform
+        #FIXME    
+
+    env.set('METISDIR', prereq_dir)
+    env.set('METIS_ROOT_DIR', prereq_dir)
+    env.set('METIS_INCLUDE_DIR', prereq_inc)
+    env.prepend('LD_LIBRARY_PATH', prereq_dir)
+
diff --git a/products/patches/petsc-3.19.4-libpath.patch b/products/patches/petsc-3.19.4-libpath.patch
new file mode 100644 (file)
index 0000000..df61286
--- /dev/null
@@ -0,0 +1,16 @@
+--- petsc_ref/config/BuildSystem/config/package.py     2023-07-31 17:00:27.000000000 +0200
++++ petsc_dev/config/BuildSystem/config/package.py     2023-09-18 16:49:13.546128117 +0200
+@@ -595,8 +595,11 @@
+       for libdir in [self.libdir, self.altlibdir]:
+         libdirpath = os.path.join(d, libdir)
+         if not os.path.isdir(libdirpath):
+-          self.logPrint(self.PACKAGE+': UserSpecified DirPath not found.. skipping: '+libdirpath)
+-          continue
++          if os.path.isdir(d):
++            libdirpath = d
++          else:
++            self.logPrint(self.PACKAGE+': UserSpecified DirPath not found.. skipping: '+libdirpath)
++            continue
+         for l in self.generateLibList(libdirpath):
+           yield('User specified root directory '+self.PACKAGE, d, l, self.getIncludeDirs(d, self.includedir))
index d11eba6e6d44f076911b3c2812e5cc4c1b51bdaf..26a5cb615bb37de66ac14ff73b935d50f7d3a65f 100644 (file)
@@ -25,7 +25,7 @@ version_3_19_4 :
 {
     compil_script :  "petsc-3.19.4.sh"
     depend : ["hdf5", "Python", "lapack","fftw", "llvm"]
-    patches: ['petsc-3.19.4-mpi4py.patch']
+    patches: ['petsc-3.19.4-mpi4py.patch','petsc-3.19.4-libpath.patch']
 }
 
 version_3_17_0 :