From: Guytri KASTANE Date: Wed, 24 Apr 2024 09:22:57 +0000 (+0200) Subject: config files and compil scipts for petsc-3.19.4 and petsc-3.20.5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fgk782450%2Fspns_37342;p=tools%2Fsat_salome.git config files and compil scipts for petsc-3.19.4 and petsc-3.20.5 --- diff --git a/applications/SALOME-master-native.pyconf b/applications/SALOME-master-native.pyconf index f16d5f4..9971954 100644 --- a/applications/SALOME-master-native.pyconf +++ b/applications/SALOME-master-native.pyconf @@ -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' diff --git a/applications/SALOME-master.pyconf b/applications/SALOME-master.pyconf index 884a1ae..5f56672 100644 --- a/applications/SALOME-master.pyconf +++ b/applications/SALOME-master.pyconf @@ -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 index 0000000..82728f9 --- /dev/null +++ b/products/compil_scripts/fftw-3.3.10.sh @@ -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 index 0000000..6853e37 --- /dev/null +++ b/products/compil_scripts/petsc-3.19.4.sh @@ -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 index 0000000..0c32499 --- /dev/null +++ b/products/compil_scripts/petsc-3.20.5.sh @@ -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" + diff --git a/products/env_scripts/fftw.py b/products/env_scripts/fftw.py index e985216..84bbfba 100644 --- a/products/env_scripts/fftw.py +++ b/products/env_scripts/fftw.py @@ -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 index 0000000..df61286 --- /dev/null +++ b/products/patches/petsc-3.19.4-libpath.patch @@ -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 index 0000000..a4aecaa --- /dev/null +++ b/products/patches/petsc-3.19.4-mpi4py.patch @@ -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) diff --git a/products/petsc.pyconf b/products/petsc.pyconf index 3bad8c3..3eefc52 100644 --- a/products/petsc.pyconf +++ b/products/petsc.pyconf @@ -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"