]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
Add config file and compilation script for petsc 3.19.4
authorGuytri KASTANE <guytri.kastane@cea.fr>
Wed, 13 Mar 2024 14:32:30 +0000 (15:32 +0100)
committerGuytri KASTANE <guytri.kastane@cea.fr>
Mon, 22 Apr 2024 09:32:09 +0000 (11:32 +0200)
products/compil_scripts/petsc-3.17.0.sh
products/petsc.pyconf

index 605f727e9aa8d1319c317914bae2432cd8da6374..25f6dbc507e29d1316fdc7ab5c35f0d70269d752 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 echo "##########################################################################"
-echo "Petsc" $VERSION
+echo "PETSc" $VERSION
 echo "##########################################################################"
 
 # ensure that build directory is really deleted
@@ -14,7 +14,7 @@ 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-dir=${NATIVE_PATH}"
+   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
@@ -30,6 +30,14 @@ 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
@@ -44,16 +52,15 @@ then
   else
       CONFIGURE_FLAGS+=" --download-mpi4py=ext/mpi4py-3.1.4.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}
+
+  CONFIGURE_FLAGS+=" --with-mpi-dir=${MPI_ROOT_DIR}"
+
 else
-  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}
+   CONFIGURE_FLAGS+=" --with-mpi=0"
 fi
 
-if [ $? -ne 0 ]
-then
+echo "*** configure --prefix=${PRODUCT_INSTALL} ${CONFIGURE_FLAGS}"
+if ! ./configure --prefix="${PRODUCT_INSTALL}" "${CONFIGURE_FLAGS}"; then
     echo "ERROR on configure"
     exit 1
 fi
@@ -61,10 +68,8 @@ fi
 MAKE_OPTIONS="PETSC_DIR=${BUILD_DIR}"
 
 echo
-echo "*** make" $MAKE_OPTIONS
-make $MAKE_OPTIONS
-if [ $? -ne 0 ]
-then
+echo "*** make $MAKE_OPTIONS"
+if ! make "$MAKE_OPTIONS"; then
     echo "ERROR on make"
     exit 2
 fi
@@ -73,19 +78,15 @@ fi
 # MAKE_OPTIONS=$MAKE_OPTIONS" PETSC_ARCH=arch-linux-c-debug"
 
 echo
-echo "*** make install"
-make $MAKE_OPTIONS install
-if [ $? -ne 0 ]
-then
+echo "*** make $MAKE_OPTIONS install"
+if ! make "$MAKE_OPTIONS" install; then
     echo "ERROR on make install"
     exit 3
 fi
 
 echo
-echo "*** make check"
-make $MAKE_OPTIONS check
-if [ $? -ne 0 ]
-then
+echo "*** make $MAKE_OPTIONS check"
+if ! make "$MAKE_OPTIONS" check; then
     echo "ERROR on make check"
     exit 4
 fi
index d9bbd830d2b1bed43ed27139974c80a05ea34cde..78fa630fa2dec8e9c31020d4c8b2e849de83aae7 100644 (file)
@@ -21,10 +21,16 @@ default :
     post_script: "fix_permissions.sh"
 }
 
+version_3_20_0 :
+{
+    compil_script :  "petsc-3.20.0.sh"
+    depend : ["hdf5", "Python", "lapack","fftw", "llvm", "metis", "medfile" ]
+}
+
 version_3_19_4 :
 {
     compil_script :  "petsc-3.19.4.sh"
-    depend : ["hdf5", "Python", "lapack","fftw", "llvm"]
+    depend : ["hdf5", "Python", "lapack","fftw", "llvm", "metis", "medfile" ]
     patches: ['petsc-3.19.4-mpi4py.patch','petsc-3.19.4-libpath.patch']
 }