]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
config files and compil scipts for petsc-3.19.4 and petsc-3.20.5 gk782450/spns_37342
authorGuytri KASTANE <guytri.kastane@cea.fr>
Wed, 24 Apr 2024 09:22:57 +0000 (11:22 +0200)
committerGuytri KASTANE <guytri.kastane@cea.fr>
Wed, 24 Apr 2024 09:22:57 +0000 (11:22 +0200)
applications/SALOME-master-native.pyconf
applications/SALOME-master.pyconf
products/compil_scripts/fftw-3.3.10.sh [new file with mode: 0755]
products/compil_scripts/petsc-3.19.4.sh [new file with mode: 0755]
products/compil_scripts/petsc-3.20.5.sh [new file with mode: 0755]
products/env_scripts/fftw.py
products/patches/petsc-3.19.4-libpath.patch [new file with mode: 0644]
products/patches/petsc-3.19.4-mpi4py.patch [new file with mode: 0644]
products/petsc.pyconf

index f16d5f4e2bc702273ed1439b0bacbce6365a8bd9..99719540f0f7a348198279e2a4bc495910a50f42 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 : 'f386013d'
-        petsc : {tag : '3.16.0', section: 'version_3_16_0'}
+        petsc : '3.20.5'
         Pillow : 'native'
         planegcs : '0.18-3cb6890'
         psutil : 'native'
index 884a1aef6ea4e74d836f5c2a7cf8653022e363f3..5f56672c5fdde5d01b46de98ddd56ab553133700 100644 (file)
@@ -58,6 +58,7 @@ APPLICATION :
         doxygen : '1.8.14'
         eigen : '3.3.4'
         embree : '3.12.2'
+        fftw : '3.3.10'
         FMILibrary : '2.0.3'
         fonttools : '4.48.1'
         freeimage : '3.16.0'
@@ -108,7 +109,7 @@ APPLICATION :
         patsy : '0.5.4'
         ParaView : {tag:'5.11.0', base: 'no',  section: 'version_5_11_0_MPI', hpc: 'yes'}
         PERSALYS: 'f386013d'
-        petsc : {tag : '3.16.0', base: 'no', section: 'version_3_16_0', hpc: 'yes'}
+        petsc : '3.19.4'
         Pillow : '8.4.0'
         planegcs : '0.18-3cb6890'
         psutil : '5.9.8'
diff --git a/products/compil_scripts/fftw-3.3.10.sh b/products/compil_scripts/fftw-3.3.10.sh
new file mode 100755 (executable)
index 0000000..82728f9
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+echo "##########################################################################"
+echo "FFTW" $VERSION
+echo "##########################################################################"
+
+echo
+echo "*** configure --libdir=${MPI_ROOT_DIR} --prefix=${PRODUCT_INSTALL} "
+${SOURCE_DIR}/configure \
+    --enable-mpi \
+    --prefix=${PRODUCT_INSTALL} \
+    CFLAGS=-fPIC
+
+if [ $? -ne 0 ]; then
+    echo "ERROR on configure"
+    exit 1
+fi
+
+echo 
+echo "*** make"
+make
+if [ $? -ne 0 ]; then
+    echo "ERROR on make"
+    exit 2
+fi
+
+echo 
+echo "*** make install"
+make install
+if [ $? -ne 0 ]; then
+    echo "ERROR on make install"
+    exit 3
+fi
+
+echo
+echo "########## END"
diff --git a/products/compil_scripts/petsc-3.19.4.sh b/products/compil_scripts/petsc-3.19.4.sh
new file mode 100755 (executable)
index 0000000..6853e37
--- /dev/null
@@ -0,0 +1,127 @@
+#!/bin/bash
+
+echo "##########################################################################"
+echo "Petsc" $VERSION
+echo "##########################################################################"
+
+NATIVE_PATH="/usr"
+LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION"
+echo "WARNING: "
+case $LINUX_DISTRIBUTION in
+    UB*|DB*)
+        NATIVE_PATH="/usr/lib/x86_64-linux-gnu"
+        ;;
+    *)
+        ;;
+esac
+
+cp -r $SOURCE_DIR/* .
+
+CONFIGURE_FLAGS=
+CONFIGURE_FLAGS+=" --download-slepc=ext/slepc-3.19.2.tar.gz"
+
+if [ -f "${NATIVE_PATH}/liblapack.a" ] && [ "${SAT_lapack_IS_NATIVE}" == "1" ]; then
+   CONFIGURE_FLAGS+=" --with-blaslapack=1"
+elif [ -n "${LAPACK_ROOT_DIR}" ] && [ "${SAT_lapack_IS_NATIVE}" != "1" ]; then
+   CONFIGURE_FLAGS+=" --with-blaslapack-dir=${LAPACK_ROOT_DIR}"
+else
+   CONFIGURE_FLAGS+=" --download-f2cblaslapack=ext/f2cblaslapack-3.8.0.q2.tar.gz"
+fi
+
+CONFIGURE_FLAGS+=" --with-python-dir=${PYTHON_ROOT_DIR}"
+CONFIGURE_FLAGS+=" --with-hdf5-dir=${HDF5_ROOT_DIR}"
+
+if [ -f "${NATIVE_PATH}/libfftw3.a" ] && [ "${SAT_fftw_IS_NATIVE}" == "1" ]; then
+   CONFIGURE_FLAGS+=" --with-fftw=1"
+elif [ -n "${FFTW_ROOT_DIR}" ] && [ "${SAT_fftw_IS_NATIVE}" != "1" ]; then
+   CONFIGURE_FLAGS+=" --with-fftw-dir=${FFTW_ROOT_DIR}"
+else
+   CONFIGURE_FLAGS+=" --download-fftw=ext/fftw-3.3.10.tar.gz"
+fi
+
+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 "
+
+if [ -f "${NATIVE_PATH}/libmetis.so" ] && [ "${SAT_metis_IS_NATIVE}" == "1" ]; then
+    CONFIGURE_FLAGS+=" --with-metis=1"
+elif [ -n "${METIS_ROOT_DIR}" ] && [ "${SAT_metis_IS_NATIVE}" != "1" ]; then
+    CONFIGURE_FLAGS+=" --with-metis-dir=${METIS_ROOT_DIR}"
+else
+    CONFIGURE_FLAGS+=" --download-metis=ext/metis-5.1.0-p11.tar.gz"
+fi
+
+echo
+if [ -n "${SAT_HPC}" ]; then
+  CONFIUGRE_FLAGS+=" --with-med-dir=${MEDFILE_ROOT_DIR}"
+  
+  if [ -f "${NATIVE_PATH}/libHYPRE_core.so" ]; then
+      CONFIGURE_FLAGS+=" --with-hypre=1"
+  else
+      CONFIGURE_FLAGS+=" --download-hypre=ext/hypre-2.28.0.tar.gz"
+  fi
+  
+  if [ -f "${NATIVE_PATH}/libptscotch.so"] && [ "${SAT_ptscotch_IS_NATIVE}"]; then
+      CONFIGURE_FLAGS+=" --with-ptscotch=1"
+  elif [ -n "${PTSCOTCH_ROOT_DIR}"] && [ "${SAT_ptscotch_IS_NATIVE}" != "1" ]; then 
+      CONFIGURE_FLAGS+=" --with-ptscoth=${PTSCOTCH_ROOT_DIR}"
+  else
+      CONFIGURE_FLAGS+=" --download-ptscotch=ext/scotch_7.0.3.tar.gz"
+  fi
+
+  if [ -n "${MPI4PY_ROOT_DIR}" ]; then
+      CONFIGURE_FLAGS+=" --with-mpi4py-dir=${MPI4PY_ROOT_DIR}"
+  else
+      CONFIGURE_FLAGS+=" --download-mpi4py=ext/mpi4py-3.1.4.tar.gz"
+  fi
+
+  CONFIGURE_FLAGS+=" --with-mpi-dir=${MPI_ROOT_DIR}"
+
+else
+   CONFIGURE_FLAGS+=" --with-mpi=0"
+fi
+
+echo "*** configure --prefix=${PRODUCT_INSTALL} ${CONFIGURE_FLAGS}"
+./configure --prefix=${PRODUCT_INSTALL} ${CONFIGURE_FLAGS}
+if [ $? -ne 0 ]
+then
+    echo "ERROR on configure"
+    exit 1
+fi
+
+MAKE_OPTIONS="PETSC_DIR=${BUILD_DIR}"
+
+echo
+echo "*** make" $MAKE_OPTIONS
+make $MAKE_OPTIONS
+if [ $? -ne 0 ]
+then
+    echo "ERROR on make"
+    exit 2
+fi
+
+# CentOS 6 automatically set PETSC_ARCH to arch-linux2-c-debug : remove arch specification
+# MAKE_OPTIONS=$MAKE_OPTIONS" PETSC_ARCH=arch-linux-c-debug"
+
+echo
+echo "*** make install"
+make $MAKE_OPTIONS install
+if [ $? -ne 0 ]
+then
+    echo "ERROR on make install"
+    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"
+
diff --git a/products/compil_scripts/petsc-3.20.5.sh b/products/compil_scripts/petsc-3.20.5.sh
new file mode 100755 (executable)
index 0000000..0c32499
--- /dev/null
@@ -0,0 +1,128 @@
+#!/bin/bash
+
+echo "##########################################################################"
+echo "Petsc" $VERSION
+echo "##########################################################################"
+
+NATIVE_PATH="/usr"
+LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION"
+echo "WARNING: "
+case $LINUX_DISTRIBUTION in
+    UB*|DB*)
+        NATIVE_PATH="/usr/lib/x86_64-linux-gnu"
+        ;;
+    *)
+        ;;
+esac
+
+cp -r $SOURCE_DIR/* .
+
+CONFIGURE_FLAGS=
+CONFIGURE_FLAGS=" --PETSC_DIR$=${BUILD_DIR}"
+CONFIGURE_FLAGS=" --PETSC_ARCH=installed-arch-linux2-c-opt"
+
+CONFIGURE_FLAGS+=" --download-slepc=ext/slepc-3.20.1.tar.gz"
+
+if [ -f "${NATIVE_PATH}/liblapack.a" ] && [ "${SAT_lapack_IS_NATIVE}" == "1" ]; then
+   CONFIGURE_FLAGS+=" --with-blaslapack=1"
+elif [ -n "${LAPACK_ROOT_DIR}" ] && [ "${SAT_lapack_IS_NATIVE}" != "1" ]; then
+   CONFIGURE_FLAGS+=" --with-blaslapack-dir=${LAPACK_ROOT_DIR}"
+else
+   CONFIGURE_FLAGS+=" --download-f2cblaslapack=ext/f2cblaslapack-3.8.0.q2.tar.gz"
+fi
+
+CONFIGURE_FLAGS+=" --with-python-dir=${PYTHON_ROOT_DIR}"
+CONFIGURE_FLAGS+=" --with-hdf5-dir=${HDF5_ROOT_DIR}"
+
+if [ -f "${NATIVE_PATH}/libfftw3.a" ] && [ "${SAT_fftw_IS_NATIVE}" == "1" ]; then
+   CONFIGURE_FLAGS+=" --with-fftw=1"
+elif [ -n "${FFTW_ROOT_DIR}" ] && [ "${SAT_fftw_IS_NATIVE}" != "1" ]; then
+   CONFIGURE_FLAGS+=" --with-fftw-dir=${FFTW_ROOT_DIR}"
+else
+   CONFIGURE_FLAGS+=" --download-fftw=ext/fftw-3.3.10.tar.gz"
+fi
+
+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 "
+
+if [ -f "${NATIVE_PATH}/libmetis.so" ] && [ "${SAT_metis_IS_NATIVE}" == "1" ]; then
+    CONFIGURE_FLAGS+=" --with-metis=1"
+elif [ -n "${METIS_ROOT_DIR}" ] && [ "${SAT_metis_IS_NATIVE}" != "1" ]; then
+    CONFIGURE_FLAGS+=" --with-metis-dir=${METIS_ROOT_DIR}"
+else
+    CONFIGURE_FLAGS+=" --download-metis=ext/metis-5.1.0-p11.tar.gz"
+fi
+
+echo
+if [ -n "${SAT_HPC}" ]; then
+  CONFIUGRE_FLAGS+=" --with-med-dir=${MEDFILE_ROOT_DIR}"
+  
+  if [ -f "${NATIVE_PATH}/libHYPRE_core.so" ]; then
+      CONFIGURE_FLAGS+=" --with-hypre=1"
+  else
+      CONFIGURE_FLAGS+=" --download-hypre=ext/hypre-2.29.0.tar.gz"
+  fi
+  
+  if [ -f "${NATIVE_PATH}/libptscotch.so"] && [ "${SAT_ptscotch_IS_NATIVE}"]; then
+      CONFIGURE_FLAGS+=" --with-ptscotch=1"
+  elif [ -n "${PTSCOTCH_ROOT_DIR}"] && [ "${SAT_ptscotch_IS_NATIVE}" != "1" ]; then 
+      CONFIGURE_FLAGS+=" --with-ptscoth=${PTSCOTCH_ROOT_DIR}"
+  else
+      CONFIGURE_FLAGS+=" --download-ptscotch=ext/scotch_7.0.3.tar.gz"
+  fi
+
+  if [ -n "${MPI4PY_ROOT_DIR}" ]; then
+      CONFIGURE_FLAGS+=" --with-mpi4py-dir=${MPI4PY_ROOT_DIR}"
+  else
+      CONFIGURE_FLAGS+=" --download-mpi4py=ext/mpi4py-3.1.5.tar.gz"
+  fi
+
+  CONFIGURE_FLAGS+=" --with-mpi-dir=${MPI_ROOT_DIR}"
+
+else
+   CONFIGURE_FLAGS+=" --with-mpi=0"
+fi
+
+echo "*** configure --prefix=${PRODUCT_INSTALL} ${CONFIGURE_FLAGS}"
+./configure --prefix=${PRODUCT_INSTALL} ${CONFIGURE_FLAGS}
+if [ $? -ne 0 ]
+then
+    echo "ERROR on configure"
+    exit 1
+fi
+
+echo
+echo "*** make" $MAKE_OPTIONS
+make $MAKE_OPTIONS
+if [ $? -ne 0 ]
+then
+    echo "ERROR on make"
+    exit 2
+fi
+
+# CentOS 6 automatically set PETSC_ARCH to arch-linux2-c-debug : remove arch specification
+# MAKE_OPTIONS=$MAKE_OPTIONS" PETSC_ARCH=arch-linux-c-debug"
+
+echo
+echo "*** make install"
+make $MAKE_OPTIONS install
+if [ $? -ne 0 ]
+then
+    echo "ERROR on make install"
+    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)
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))
diff --git a/products/patches/petsc-3.19.4-mpi4py.patch b/products/patches/petsc-3.19.4-mpi4py.patch
new file mode 100644 (file)
index 0000000..a4aecaa
--- /dev/null
@@ -0,0 +1,21 @@
+diff -Naur petsc_ref/config/BuildSystem/config/packages/mpi4py.py  petsc/config/BuildSystem/config/packages/mpi4py.py
+--- petsc_ref/config/BuildSystem/config/packages/mpi4py.py     2021-11-18 23:17:43.058783475 +0100
++++ petsc/config/BuildSystem/config/packages/mpi4py.py 2021-11-18 23:58:42.759826515 +0100
+@@ -22,7 +22,7 @@
+     return
+   def Install(self):
+-    installLibPath = os.path.join(self.installDir, 'lib')
++    installLibPath = os.path.join(self.installDir)
+     if self.setCompilers.isDarwin(self.log):
+       apple = 'You may need to\n (csh/tcsh) setenv MACOSX_DEPLOYMENT_TARGET 10.X\n (sh/bash) MACOSX_DEPLOYMENT_TARGET=10.X; export MACOSX_DEPLOYMENT_TARGET\nbefore running make on PETSc'
+     else:
+@@ -73,7 +73,7 @@
+         raise RuntimeError('mpi4py unreconginzed mode of building mpi4py! Suggest using --download-mpi4py!')
+     if self.directory:
+-      installLibPath = os.path.join(self.directory, 'lib')
++      installLibPath = os.path.join(self.directory)
+       if not os.path.isfile(os.path.join(installLibPath,'mpi4py','__init__.py')):
+         raise RuntimeError('mpi4py not found at %s' % installLibPath)
+       self.addMakeMacro('PETSC_MPI4PY_PYTHONPATH',installLibPath)
index 3bad8c3f7ef2e5c103b773f949ebf3f4183a164c..3eefc52053e66654db4d75c87dc34c6a6231cc3d 100644 (file)
@@ -21,6 +21,19 @@ default :
     post_script: "fix_permissions.sh"
 }
 
+version_3_20_5 :
+{
+    compil_script :  "petsc-3.20.5.sh"
+    depend : ["hdf5", "Python", "lapack","fftw", "llvm", "metis", "medfile", "mpi4py", "scotch" ]
+}
+
+version_3_19_4 :
+{
+    compil_script :  "petsc-3.19.4.sh"
+    depend : ["hdf5", "Python", "lapack","fftw", "llvm", "metis", "medfile" ]
+    patches: ['petsc-3.19.4-mpi4py.patch','petsc-3.19.4-libpath.patch']
+}
+
 version_3_17_0 :
 {
     compil_script :  "petsc-3.17.0.sh"