From a3bd7dc33a0244c868ae4174993750f669599854 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Tue, 7 May 2024 18:05:46 +0200 Subject: [PATCH] spns #41854: Implement meshio for Fedora 32 --- applications/SALOME-master-native.pyconf | 6 ++- products/compil_scripts/h5py-3.11.0.sh | 39 ++++++++++++++ products/compil_scripts/meshio-5.3.5.sh | 37 ++++++++++++++ products/compil_scripts/numpy-1.20.3.sh | 65 ++++++++++++++++++++++++ products/compil_scripts/rich-13.7.1.sh | 22 ++++++++ products/env_scripts/h5py.py | 3 +- products/env_scripts/meshio.py | 16 ++++++ products/env_scripts/rich.py | 15 ++++++ products/h5py.pyconf | 16 +++--- products/meshio.pyconf | 39 ++++++++++++++ products/numpy.pyconf | 11 ++++ products/rich.pyconf | 40 +++++++++++++++ products/salome_system.pyconf | 2 +- 13 files changed, 298 insertions(+), 13 deletions(-) create mode 100755 products/compil_scripts/h5py-3.11.0.sh create mode 100755 products/compil_scripts/meshio-5.3.5.sh create mode 100755 products/compil_scripts/numpy-1.20.3.sh create mode 100755 products/compil_scripts/rich-13.7.1.sh create mode 100644 products/env_scripts/meshio.py create mode 100644 products/env_scripts/rich.py create mode 100644 products/meshio.pyconf create mode 100644 products/rich.pyconf diff --git a/applications/SALOME-master-native.pyconf b/applications/SALOME-master-native.pyconf index fb89b7e..4314978 100644 --- a/applications/SALOME-master-native.pyconf +++ b/applications/SALOME-master-native.pyconf @@ -63,7 +63,7 @@ APPLICATION : gdal : 'native' gmsh : '4.10.3' graphviz : 'native' - h5py : '3.9.0' + h5py : '3.11.0' hdf5 : '1.10.3' idna : 'native' imagesize : 'native' @@ -78,6 +78,7 @@ APPLICATION : medfile : '4.1.1' mesa : {tag : '19.0.8-x86_64-'+$VARS.dist, base: 'no', section: 'version_bin'} MeshGems : '2.15-1' + meshio: '5.3.5' metis : 'native' mpi4py: 'native' netgen : '5.3.1_with_CAS_7.2' @@ -115,6 +116,7 @@ APPLICATION : qwt : 'native' requests : 'native' rkCommon : '1.5.1' + rich : '13.7.1' root: '6.22.02' scipy : 'native' scotch : {tag: '6.1.2', section: 'version_6_1_2_MPI', hpc: 'yes', base: 'no'} @@ -311,7 +313,7 @@ __overwrite__ : 'APPLICATION.products.PyFMI' : {tag: '2.6', base: 'no', section: 'version_2_6_no_pip' } 'APPLICATION.products.Sphinx' : {tag: '1.7.6', base: 'no', section: 'version_1_7_6_no_pip' } 'APPLICATION.products.gdal' : {tag:'2.4.0', base: 'no', section: 'version_2_4_0_FD32' } # spns #29324 - 'APPLICATION.products.h5py' : {tag:'3.9.0', base: 'no', section: 'version_3_9_0_FD32' } + 'APPLICATION.products.numpy' : {tag: '1.20.3', base: 'no', section: 'version_1_20_3' } } { __condition__ : "VARS.dist in ['FD34']" diff --git a/products/compil_scripts/h5py-3.11.0.sh b/products/compil_scripts/h5py-3.11.0.sh new file mode 100755 index 0000000..a1b0cef --- /dev/null +++ b/products/compil_scripts/h5py-3.11.0.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +echo "##########################################################################" +echo "h5py" $VERSION +echo "##########################################################################" + +LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION" + +rm -rf $BUILD_DIR +mkdir -p $BUILD_DIR/cache/pip + +mkdir -p $PRODUCT_INSTALL + +cd $BUILD_DIR + +export PYTHONPATH=${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH +export PATH=${PRODUCT_INSTALL}/bin:$PATH + +case $LINUX_DISTRIBUTION in + FD32) + WHEELS=('h5py-3.11.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl') + for WHEEL in "${WHEELS[@]}"; do + ${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip $SOURCE_DIR/$WHEEL --no-deps --prefix=$PRODUCT_INSTALL + if [ $? -ne 0 ]; then + echo "ERROR: could not install $WHEEL" + exit 1 + fi + done + if [ -d ${PRODUCT_INSTALL}/lib64 ]; then + mv ${PRODUCT_INSTALL}/lib64/* ${PRODUCT_INSTALL}/lib/ + rm -rf ${PRODUCT_INSTALL}/lib64 + fi + ;; + *) + ;; +esac + +echo +echo "########## END" diff --git a/products/compil_scripts/meshio-5.3.5.sh b/products/compil_scripts/meshio-5.3.5.sh new file mode 100755 index 0000000..d7cd83f --- /dev/null +++ b/products/compil_scripts/meshio-5.3.5.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +echo "##########################################################################" +echo "meshio" $VERSION +echo "##########################################################################" + +LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION" + +echo "*** check installation" +mkdir -p ${PRODUCT_INSTALL} +rm -rf $BUILD_DIR +mkdir -p $BUILD_DIR/cache/pip +cd $BUILD_DIR + +export PYTHONPATH=${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH +export PATH=${PRODUCT_INSTALL}/bin:$PATH + +case $LINUX_DISTRIBUTION in + FD32) + WHEELS=('markdown_it_py-3.0.0-py3-none-any.whl' + 'typing_extensions-4.11.0-py3-none-any.whl' + 'meshio-5.3.5-py3-none-any.whl' + ) + for WHEEL in "${WHEELS[@]}"; do + ${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip $SOURCE_DIR/$WHEEL --no-deps --prefix=$PRODUCT_INSTALL + if [ $? -ne 0 ]; then + echo "ERROR: could not install $WHEEL" + exit 1 + fi + done + ;; + *) + ;; +esac + +echo +echo "########## END" diff --git a/products/compil_scripts/numpy-1.20.3.sh b/products/compil_scripts/numpy-1.20.3.sh new file mode 100755 index 0000000..05e370a --- /dev/null +++ b/products/compil_scripts/numpy-1.20.3.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +echo "##########################################################################" +echo "numpy" $VERSION +echo "##########################################################################" + + +mkdir -p $PRODUCT_INSTALL + +cd $SOURCE_DIR +rm -f site.cfg + +if [ "$SAT_lapack_IS_NATIVE" != "1" ]; then + echo "Lapack is embedded... Make numpy aware of it..." + echo "[ALL]" > site.cfg + echo "libraries = lapack,blas,cblas,lapacke,tmglib" >> site.cfg + echo "library_dirs = \$\{LAPACKHOME\}/lib" >> site.cfg + echo "include_dirs = \$\{LAPACKHOME\}/include" >> site.cfg +fi + +export PYTHONPATH=$SOURCE_DIR:$PYTHONPATH + +NUMPY_INSTALL=${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages +mkdir -p ${NUMPY_INSTALL} +PYTHONPATH=${NUMPY_INSTALL}:${PYTHONPATH} + +echo +echo "*** setup.py build install" +$PYTHONBIN setup.py build install --prefix=${PRODUCT_INSTALL} --install-lib=${NUMPY_INSTALL} +if [ $? -ne 0 ]; then + echo "ERROR on setup build install" + rm -f site.cfg + exit 1 +fi +# the embedded versioneer.py fails to retrieve the correct version - presumably because of missing .git information +# let's fix this once for all - prevents openturns from not building. +cd ${NUMPY_INSTALL} +if [ -f numpy/_version.py ]; then + echo "INFO: ensure that version is consistently set. In principle patches " + sed -i "s/0+unknown/$VERSION/g" numpy/_version.py +else + f=$(find . -type d -name "numpy-$VERSION-py${PYTHON_VERSION}-*x86_64.egg") + if [ $? -eq 0 ]; then + EGG_DIR=$(ls |grep numpy-$VERSION-py${PYTHON_VERSION} |grep x86_64.egg) + echo "INFO: Found $EGG_DIR" + if [ -d $EGG_DIR/numpy ]; then + ln -sf $EGG_DIR/numpy + sed -i "s/0+unknown/$VERSION/g" $EGG_DIR/numpy/_version.py + else + echo "WARNING: could not find $EGG_DIR/numpy" + fi + else + echo "WARNING: could not find egg directory with name: numpy-$VERSION-py${PYTHON_VERSION}-*-x86_64.egg" + fi +fi + +if [ -d ${PRODUCT_INSTALL}/local/bin ]; then + mv ${PRODUCT_INSTALL}/local/bin ${PRODUCT_INSTALL}/bin + rm -rf ${PRODUCT_INSTALL}/local +fi + +rm -f site.cfg +echo +echo "########## END" + diff --git a/products/compil_scripts/rich-13.7.1.sh b/products/compil_scripts/rich-13.7.1.sh new file mode 100755 index 0000000..a693922 --- /dev/null +++ b/products/compil_scripts/rich-13.7.1.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +echo "##########################################################################" +echo "rich" $VERSION +echo "##########################################################################" + +if [ ! -d $PRODUCT_INSTALL ]; then + mkdir -p $PRODUCT_INSTALL +fi + +rm -rf $BUILD_DIR +mkdir -p $BUILD_DIR/cache/pip +cd $BUILD_DIR + +${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip $SOURCE_DIR/rich-13.7.1-py3-none-any.whl --no-deps --prefix=$PRODUCT_INSTALL +if [ $? -ne 0 ]; then + echo "FATAL: could not install rich 13.7.1" + exit 1 +fi + +echo +echo "########## END" diff --git a/products/env_scripts/h5py.py b/products/env_scripts/h5py.py index 3137f68..ee99a7c 100644 --- a/products/env_scripts/h5py.py +++ b/products/env_scripts/h5py.py @@ -8,8 +8,7 @@ def set_env(env, prereq_dir, version): if not platform.system() == "Windows" : pyver = 'python' + env.get('PYTHON_VERSION') env.set('H5PY_ROOT_DIR',prereq_dir) - env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'bin')) - env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'lib', pyver, 'site-packages','numpy','core','include')) + env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'lib', pyver, 'site-packages')) def set_nativ_env(env): pass diff --git a/products/env_scripts/meshio.py b/products/env_scripts/meshio.py new file mode 100644 index 0000000..b833d27 --- /dev/null +++ b/products/env_scripts/meshio.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path +import platform + +def set_env(env, prereq_dir, version): + if not platform.system() == "Windows" : + pyver = 'python' + env.get('PYTHON_VERSION') + env.set('MESHIO_ROOT_DIR',prereq_dir) + env.set('HDF5_DISABLE_VERSION_CHECK', '1') + env.prepend('PATH', os.path.join(prereq_dir, 'bin')) + env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'lib', pyver, 'site-packages')) + +def set_nativ_env(env): + pass diff --git a/products/env_scripts/rich.py b/products/env_scripts/rich.py new file mode 100644 index 0000000..f9d2878 --- /dev/null +++ b/products/env_scripts/rich.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path +import platform + +def set_env(env, prereq_dir, version): + if not platform.system() == "Windows" : + pyver = 'python' + env.get('PYTHON_VERSION') + env.set('RICH_ROOT_DIR',prereq_dir) + env.prepend('PATH', os.path.join(prereq_dir, 'bin')) + env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'lib', pyver, 'site-packages')) + +def set_nativ_env(env): + pass diff --git a/products/h5py.pyconf b/products/h5py.pyconf index 518e08d..c6c99b7 100644 --- a/products/h5py.pyconf +++ b/products/h5py.pyconf @@ -28,13 +28,13 @@ default : } } -version_3_9_0: +version_3_11_0: { - compil_script: "h5py-3.9.0" + $VARS.scriptExtension -} - -version_3_9_0_FD32: -{ - compil_script: "h5py-3.9.0" + $VARS.scriptExtension - patches : ['h5py-3.9.0.p01.patch'] + compil_script: "h5py-3.11.0" + $VARS.scriptExtension + archive_info : {archive_name : "h5py-3.11.0-x86_64.tar.gz"} + properties : + { + incremental : "yes" + pip : "no" + } } diff --git a/products/meshio.pyconf b/products/meshio.pyconf new file mode 100644 index 0000000..d041f49 --- /dev/null +++ b/products/meshio.pyconf @@ -0,0 +1,39 @@ +default : +{ + name : "meshio" + build_source : "script" + compil_script: "meshio" + $VARS.scriptExtension + get_source : "archive" + patches : [] + system_info : + { + rpm : [] + rpm_dev : [] + apt : [] + apt_dev : [] + } + environ : + { + env_script : $name + ".py" + } + depend : ['Python', 'numpy', 'hdf5', 'h5py', 'netcdf', 'rich'] + source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name + build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name + install_dir : 'base' + properties : + { + incremental : "yes" + pip : "yes" + } +} + +version_5_3_5 : +{ + compil_script: "meshio-5.3.5" + $VARS.scriptExtension + archive_info : {archive_name : "meshio-5.3.5-x86_64.tar.gz"} + properties : + { + incremental : "yes" + pip : "no" + } +} diff --git a/products/numpy.pyconf b/products/numpy.pyconf index d8d9a08..4e642f9 100755 --- a/products/numpy.pyconf +++ b/products/numpy.pyconf @@ -72,6 +72,17 @@ version_1_21_6_win_dbg: } } +version_1_20_3: +{ + properties: + { + incremental : "yes" + pip : "no" + } + compil_script : "numpy-1.20.3.sh" +# patches: ['SPNS-29988-numpy-1.22.patch'] +} + version_1_16_4_win_dbg: { name : "numpy" diff --git a/products/rich.pyconf b/products/rich.pyconf new file mode 100644 index 0000000..f1b5b83 --- /dev/null +++ b/products/rich.pyconf @@ -0,0 +1,40 @@ +default : +{ + name : "rich" + build_source : "script" + compil_script: "rich" + $VARS.scriptExtension + get_source : "archive" + patches : [] + system_info : + { + rpm : ['python3-rich'] + rpm_dev : ['python3-rich'] + apt : ['python3-rich'] + apt_dev : ['python3-rich'] + } + environ : + { + env_script : $name + ".py" + } + depend : ['Python', 'numpy', 'hdf5', 'h5py'] + opt_depend: ['openmpi'] + source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name + build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name + install_dir : 'base' + properties : + { + incremental : "yes" + pip : "yes" + } +} + +version_13_7_1: +{ + compil_script: "rich-13.7.1" + $VARS.scriptExtension + properties : + { + incremental : "yes" + pip : "no" + } +} + diff --git a/products/salome_system.pyconf b/products/salome_system.pyconf index 7cf4ccd..f6a8f32 100644 --- a/products/salome_system.pyconf +++ b/products/salome_system.pyconf @@ -52,7 +52,7 @@ default : } "FD32" : { - rpm : ["lz4", "gsl", "openmpi", "netcdf", "gdal", "libxml++"] + rpm : ["lz4", "gsl", "openmpi", "netcdf", "python3-netcdf4", "gdal", "libxml++"] rpm_dev : ["perl-interpreter", "qt5-devel", "gsl-devel", "openmpi-devel", "netcdf-devel", "protobuf-devel", "python3-protobuf", "texlive-dvipng", "libxml++-devel"] } "FD34" : -- 2.39.2