From e5e3c2ab48c5e802e81704800208a26d74e18301 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Fri, 19 Nov 2021 00:27:18 +0100 Subject: [PATCH] spns #26662: SOLVERLAB: update PETSc + SLEPc and link against mpi4py used by MEDCOUPLING --- applications/SALOME-9.8.0-MPI.pyconf | 4 ++-- applications/SALOME-9.8.0-int32.pyconf | 4 ++-- applications/SALOME-9.8.0-native.pyconf | 4 ++-- applications/SALOME-9.8.0-windows.pyconf | 2 +- applications/SALOME-9.8.0.pyconf | 4 ++-- applications/SALOME-master-int32.pyconf | 4 ++-- applications/SALOME-master-native.pyconf | 4 ++-- applications/SALOME-master-windows.pyconf | 2 +- applications/SALOME-master.pyconf | 2 +- products/compil_scripts/petsc-3.16.0.sh | 3 ++- products/env_scripts/mpi4py.py | 15 +++++++++++++++ products/mpi4py.pyconf | 2 +- products/patches/petsc-3.16-mpi4py.patch | 21 +++++++++++++++++++++ products/petsc.pyconf | 1 + 14 files changed, 55 insertions(+), 17 deletions(-) create mode 100644 products/env_scripts/mpi4py.py create mode 100644 products/patches/petsc-3.16-mpi4py.patch diff --git a/applications/SALOME-9.8.0-MPI.pyconf b/applications/SALOME-9.8.0-MPI.pyconf index e578dbd..7d04f74 100644 --- a/applications/SALOME-9.8.0-MPI.pyconf +++ b/applications/SALOME-9.8.0-MPI.pyconf @@ -31,7 +31,7 @@ APPLICATION : alabaster : '0.7.6' Babel : '2.7.0' boost : '1.71.0' - CAS : {tag: 'b08cd044f9', section: 'version_7_5_3p1'} + CAS : 'V7_5_3p1' certifi : '2018.8.24' cgns : {tag : '4.1.1', hpc : 'yes'} chardet : '3.0.4' @@ -85,7 +85,7 @@ APPLICATION : pandas : '0.25.2' patsy : '0.5.2' ParaView : {tag : '5.9.0', hpc : 'yes', section: 'version_5_9_0_MPI'} - petsc : {tag : '3.15.0', section: 'version_3_15_0'} + petsc : {tag : '3.16.0', section: 'version_3_16_0'} Pillow : '7.1.1' planegcs : '0.18-3cb6890' psutil : '5.7.2' diff --git a/applications/SALOME-9.8.0-int32.pyconf b/applications/SALOME-9.8.0-int32.pyconf index 65f81a0..c4aafd3 100644 --- a/applications/SALOME-9.8.0-int32.pyconf +++ b/applications/SALOME-9.8.0-int32.pyconf @@ -29,7 +29,7 @@ APPLICATION : alabaster : '0.7.6' Babel : '2.7.0' boost : '1.71.0' - CAS : {tag: 'b08cd044f9', section: 'version_7_5_3p1'} + CAS : 'V7_5_3p1' certifi : '2018.8.24' cgns : '4.1.1' chardet : '3.0.4' @@ -81,7 +81,7 @@ APPLICATION : pandas : '0.25.2' patsy : '0.5.2' ParaView : '5.9.0' - petsc : {tag : '3.15.0', section: 'version_3_15_0'} + petsc : {tag : '3.16.0', section: 'version_3_16_0'} Pillow : '7.1.1' planegcs : '0.18-3cb6890' psutil : '5.7.2' diff --git a/applications/SALOME-9.8.0-native.pyconf b/applications/SALOME-9.8.0-native.pyconf index a859c41..015acd7 100644 --- a/applications/SALOME-9.8.0-native.pyconf +++ b/applications/SALOME-9.8.0-native.pyconf @@ -31,7 +31,7 @@ APPLICATION : alabaster : 'native' Babel : 'native' boost : 'native' - CAS : {tag: 'b08cd044f9', section: 'version_7_5_3p1'} + CAS : 'V7_5_3p1' certifi : 'native' # Standalone native cgns works well. Unfortunately, it's directly linked to native hdf which uses a higher version than us. # Rollback to embedded version to avoid versions mismatch between both of them (see imp_1538_cgns_export_import.py) @@ -84,7 +84,7 @@ APPLICATION : packaging : 'native' pandas : 'native' ParaView : '5.9.0' - petsc : {tag : '3.15.0', section: 'version_3_15_0'} + petsc : {tag : '3.16.0', section: 'version_3_16_0'} Pillow : 'native' # 'native' not exists : freeCAD part but not delivered with it from package handler planegcs : '0.18-3cb6890' diff --git a/applications/SALOME-9.8.0-windows.pyconf b/applications/SALOME-9.8.0-windows.pyconf index b7c7bd6..4c60a68 100644 --- a/applications/SALOME-9.8.0-windows.pyconf +++ b/applications/SALOME-9.8.0-windows.pyconf @@ -36,7 +36,7 @@ APPLICATION : alabaster : '0.7.6' Babel : '2.7.0' boost : '1.67.0' - CAS : {tag: 'b08cd044f9', section: 'version_7_5_3p1_win'} + CAS : 'V7_5_3p1' certifi : '2019.6.16' cgns : '4.1.1' chardet : '3.0.4' diff --git a/applications/SALOME-9.8.0.pyconf b/applications/SALOME-9.8.0.pyconf index 3034b22..94dd8ba 100644 --- a/applications/SALOME-9.8.0.pyconf +++ b/applications/SALOME-9.8.0.pyconf @@ -31,7 +31,7 @@ APPLICATION : alabaster : '0.7.6' Babel : '2.7.0' boost : '1.71.0' - CAS : {tag: 'b08cd044f9', section: 'version_7_5_3p1'} + CAS : 'V7_5_3p1' certifi : '2018.8.24' cgns : '4.1.1' chardet : '3.0.4' @@ -83,7 +83,7 @@ APPLICATION : pandas : '0.25.2' patsy : '0.5.2' ParaView : '5.9.0' - petsc : {tag : '3.15.0', section: 'version_3_15_0'} + petsc : {tag : '3.16.0', section: 'version_3_16_0'} Pillow : '7.1.1' planegcs : '0.18-3cb6890' psutil : '5.7.2' diff --git a/applications/SALOME-master-int32.pyconf b/applications/SALOME-master-int32.pyconf index 01ca6a3..afbaadc 100644 --- a/applications/SALOME-master-int32.pyconf +++ b/applications/SALOME-master-int32.pyconf @@ -29,7 +29,7 @@ APPLICATION : alabaster : '0.7.6' Babel : '2.7.0' boost : '1.71.0' - CAS : {tag: 'b08cd044f9', section: 'version_7_5_3p1'} + CAS : 'V7_5_3p1' certifi : '2018.8.24' cgns : '4.1.1' chardet : '3.0.4' @@ -81,7 +81,7 @@ APPLICATION : pandas : '0.25.2' patsy : '0.5.2' ParaView : '5.9.0' - petsc : {tag : '3.15.0', section: 'version_3_15_0'} + petsc : {tag : '3.16.0', section: 'version_3_16_0'} Pillow : '7.1.1' planegcs : '0.18-3cb6890' psutil : '5.7.2' diff --git a/applications/SALOME-master-native.pyconf b/applications/SALOME-master-native.pyconf index af4aa1c..6ccc540 100644 --- a/applications/SALOME-master-native.pyconf +++ b/applications/SALOME-master-native.pyconf @@ -31,7 +31,7 @@ APPLICATION : alabaster : 'native' Babel : 'native' boost : 'native' - CAS : {tag: 'b08cd044f9', section: 'version_7_5_3p1'} + CAS : 'V7_5_3p1' certifi : 'native' # Standalone native cgns works well. Unfortunately, it's directly linked to native hdf which uses a higher version than us. # Rollback to embedded version to avoid versions mismatch between both of them (see imp_1538_cgns_export_import.py) @@ -84,7 +84,7 @@ APPLICATION : packaging : 'native' pandas : 'native' ParaView : '5.9.0' - petsc : {tag : '3.15.0', section: 'version_3_15_0'} + petsc : {tag : '3.16.0', section: 'version_3_16_0'} Pillow : 'native' # 'native' not exists : freeCAD part but not delivered with it from package handler planegcs : '0.18-3cb6890' diff --git a/applications/SALOME-master-windows.pyconf b/applications/SALOME-master-windows.pyconf index 2a78bc4..f641cff 100644 --- a/applications/SALOME-master-windows.pyconf +++ b/applications/SALOME-master-windows.pyconf @@ -36,7 +36,7 @@ APPLICATION : alabaster : '0.7.6' Babel : '2.7.0' boost : '1.67.0' - CAS : {tag: 'b08cd044f9', section: 'version_7_5_3p1_win'} + CAS : 'V7_5_3p1' certifi : '2019.6.16' cgns : '4.1.1' chardet : '3.0.4' diff --git a/applications/SALOME-master.pyconf b/applications/SALOME-master.pyconf index ff51b9a..f3c65ea 100644 --- a/applications/SALOME-master.pyconf +++ b/applications/SALOME-master.pyconf @@ -31,7 +31,7 @@ APPLICATION : alabaster : '0.7.6' Babel : '2.7.0' boost : '1.71.0' - CAS : {tag: 'b08cd044f9', section: 'version_7_5_3p1'} + CAS : 'V7_5_3p1' certifi : '2018.8.24' cgns : '4.1.1' chardet : '3.0.4' diff --git a/products/compil_scripts/petsc-3.16.0.sh b/products/compil_scripts/petsc-3.16.0.sh index a3f990c..a8031ac 100755 --- a/products/compil_scripts/petsc-3.16.0.sh +++ b/products/compil_scripts/petsc-3.16.0.sh @@ -13,7 +13,7 @@ CONFIGURE_FLAGS+=" --with-hdf5-dir=${HDF5_ROOT_DIR}" CONFIGURE_FLAGS+=" --download-metis=ext/metis-5.1.0-p10.tar.gz" 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+=" --download-slepc-configure-arguments=--with-slepc4py=yes " echo if [ -n "${MPI_ROOT_DIR}" ] then @@ -22,6 +22,7 @@ then CONFIGURE_FLAGS+=" --download-parms=ext/parms-3.2-p5.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-mpi4py=ext/mpi4py-3.0.3.tar.gz" CONFIGURE_FLAGS+=" --with-mpi4py-dir=${MPI4PY_ROOT_DIR}" ./configure --prefix=${PRODUCT_INSTALL} --with-mpi-dir=${MPI_ROOT_DIR} ${CONFIGURE_FLAGS} else diff --git a/products/env_scripts/mpi4py.py b/products/env_scripts/mpi4py.py new file mode 100644 index 0000000..97003e7 --- /dev/null +++ b/products/env_scripts/mpi4py.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path, platform + +def set_env(env, prereq_dir, version): + if platform.system() == "Windows" : + pass + else : + versionPython = env.get('PYTHON_VERSION') + env.set("MPI4PY_ROOT_DIR",os.path.join(prereq_dir, 'lib', 'python' + versionPython, 'site-packages')) + +def set_nativ_env(env): + pass + diff --git a/products/mpi4py.pyconf b/products/mpi4py.pyconf index 4f90fd1..3e9e9e4 100644 --- a/products/mpi4py.pyconf +++ b/products/mpi4py.pyconf @@ -13,7 +13,7 @@ default : } environ : { - MPI4PY_ROOT_DIR : $install_dir + env_script : $name + ".py" } depend : ["Python", 'openmpi'] source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name diff --git a/products/patches/petsc-3.16-mpi4py.patch b/products/patches/petsc-3.16-mpi4py.patch new file mode 100644 index 0000000..a4aecaa --- /dev/null +++ b/products/patches/petsc-3.16-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 5572919..26e9c96 100644 --- a/products/petsc.pyconf +++ b/products/petsc.pyconf @@ -24,6 +24,7 @@ version_3_16_0 : { compil_script : "petsc-3.16.0.sh" depend : ["hdf5", "Python"] + patches: ['petsc-3.16-mpi4py.patch'] } version_3_15_0 : -- 2.39.2