From 75b8a14ffd5f3e1e2d040c5b234caf2d19fba42b Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Wed, 11 Jan 2023 13:12:05 +0100 Subject: [PATCH] COTECH 146: if system scipy older than 1.4 embed scipy 1.5.2 --- applications/SALOME-master-native.pyconf | 23 +++++----- products/compil_scripts/scipy-1.5.2.sh | 53 ++++++++++++++++++++++++ products/scipy.pyconf | 11 ++++- 3 files changed, 76 insertions(+), 11 deletions(-) create mode 100755 products/compil_scripts/scipy-1.5.2.sh diff --git a/applications/SALOME-master-native.pyconf b/applications/SALOME-master-native.pyconf index e98afba..cacb3dc 100644 --- a/applications/SALOME-master-native.pyconf +++ b/applications/SALOME-master-native.pyconf @@ -210,9 +210,10 @@ __overwrite__ : 'APPLICATION.products.opencv' : '3.2.0' 'APPLICATION.products.cminpack' : 'native' 'APPLICATION.products.netcdf' : '4.6.2' - 'APPLICATION.products.PyFMI' : {tag: '2.6', base: 'no', section: 'version_2_6_no_pip' } - 'APPLICATION.products.openturns' : {tag: '1.19', base: 'no', section: 'version_1_19_UB20_04' } - 'APPLICATION.products.StaticMeshPlugin' : {tag:'5.11.0', base: 'no', section: 'version_5_11_0_UB20_04' } + 'APPLICATION.products.PyFMI' : {tag: '2.6', base: 'no', section: 'version_2_6_no_pip' } + 'APPLICATION.products.openturns' : {tag: '1.19', base: 'no', section: 'version_1_19_UB20_04' } + 'APPLICATION.products.StaticMeshPlugin' : {tag:'5.11.0', base: 'no', section: 'version_5_11_0_UB20_04' } + 'APPLICATION.products.scipy' : {tag: '1.5.2', base: 'no', section: 'version_1_5_2_no_pip' } # scipy >= 1.4 - system one too old } { # @@ -236,12 +237,13 @@ __overwrite__ : __condition__ : "VARS.dist in ['DB10']" 'APPLICATION.products.opencv' : '3.2.0' 'APPLICATION.products.cminpack' : 'native' - 'APPLICATION.products.PyFMI' : {tag:'2.6', base: 'no', section: 'version_2_6_no_pip' } + 'APPLICATION.products.PyFMI' : {tag:'2.6', base: 'no', section: 'version_2_6_no_pip' } 'APPLICATION.products.qt' : '5.12.10' 'APPLICATION.products.qwt' : '6.1.2' 'APPLICATION.products.PyQt' : '5.15.3' 'APPLICATION.products.sip' : '5.5.0' 'APPLICATION.products.ParaView' : {tag: '5.11.0', base: 'no', section: 'version_5_11_0_MPI_DB10', hpc: 'yes'} + 'APPLICATION.products.scipy' : {tag: '1.5.2', base: 'no', section: 'version_1_5_2_no_pip' } # scipy >= 1.4 - system one too old } { __condition__ : "VARS.dist in ['DB11']" @@ -254,12 +256,13 @@ __overwrite__ : # CentOS 8 repositories don't include sphinxintl package which must be installed through pip. # To avoid its missing (system_info pyconf key doesn't handle this use case), we embed it. __condition__ : "VARS.dist in ['CO8']" - 'APPLICATION.products.sphinxintl' : {tag: '0.9.10', base: 'no', section: 'version_0_9_10_no_pip'} + 'APPLICATION.products.sphinxintl' : {tag: '0.9.10', base: 'no', section: 'version_0_9_10_no_pip' } 'APPLICATION.products.cminpack' : '1.3.6' - 'APPLICATION.products.PyFMI' : {tag: '2.6', base: 'no', section: 'version_2_6_no_pip' } - 'APPLICATION.products.statsmodels' : {tag: '0.6.1', base: 'no', section: 'version_0_6_1_no_pip' } - 'APPLICATION.products.gdal' : {tag:'2.4.0', base: 'no', section: 'version_2_4_0_CO8' } # spns #29324 - 'APPLICATION.products.StaticMeshPlugin' : {tag:'5.11.0', base: 'no', section: 'version_5_11_0_CO8' } + 'APPLICATION.products.PyFMI' : {tag: '2.6', base: 'no', section: 'version_2_6_no_pip' } + 'APPLICATION.products.statsmodels' : {tag: '0.6.1', base: 'no', section: 'version_0_6_1_no_pip' } + 'APPLICATION.products.gdal' : {tag:'2.4.0', base: 'no', section: 'version_2_4_0_CO8' } # spns #29324 + 'APPLICATION.products.scipy' : {tag: '1.5.2', base: 'no', section: 'version_1_5_2_no_pip' } # scipy >= 1.4 - system one too old + 'APPLICATION.products.StaticMeshPlugin' : {tag:'5.11.0', base: 'no', section: 'version_5_11_0_CO8' } } { __condition__ : "VARS.dist in ['FD32']" @@ -280,8 +283,8 @@ __overwrite__ : 'APPLICATION.products.PyFMI' : {tag: '2.6', base: 'no', section: 'version_2_6_no_pip' } 'APPLICATION.products.root' : {tag:'6.22.02', base: 'no', section: 'version_6_22_02_FD34' } 'APPLICATION.products.gdal' : {tag:'2.4.0', base: 'no', section: 'version_2_4_0_FD34' } # spns #29324 - 'APPLICATION.products.StaticMeshPlugin' : {tag:'5.11.0', base: 'no', section: 'version_5_11_0_FD34' } 'APPLICATION.products.openturns' : {tag: '1.19', base: 'no', section: 'version_1_19_FD34' } + 'APPLICATION.products.StaticMeshPlugin' : {tag:'5.11.0', base: 'no', section: 'version_5_11_0_FD34' } } { __condition__ : "VARS.dist in ['FD36']" diff --git a/products/compil_scripts/scipy-1.5.2.sh b/products/compil_scripts/scipy-1.5.2.sh new file mode 100755 index 0000000..d5f1979 --- /dev/null +++ b/products/compil_scripts/scipy-1.5.2.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +echo "##########################################################################" +echo "scipy" $VERSION +echo "##########################################################################" + +echo "*** build in SOURCE directory" + +rm -rf $BUILD_DIR +mkdir $BUILD_DIR +cd $BUILD_DIR +cp -R $SOURCE_DIR/* . + +SCIPY_INSTALL=${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages +mkdir -p ${SCIPY_INSTALL} + +PYTHONPATH=${SCIPY_INSTALL}:$PWD:$PYTHONPATH + +echo +echo "*** build and install with $PYTHONBIN" +$PYTHONBIN setup.py install --prefix=$PRODUCT_INSTALL +if [ $? -ne 0 ] +then + echo "ERROR on build/install" + exit 3 +fi + +# ensure that lib is used +if [ -d "$PRODUCT_INSTALL/lib64" ]; then + echo "WARNING: renaming lib64 directory to lib" + mv $PRODUCT_INSTALL/lib64 $PRODUCT_INSTALL/lib +elif [ -d "$PRODUCT_INSTALL/local/lib64" ]; then + echo "WARNING: renaming local/lib64 directory to lib" + mv $PRODUCT_INSTALL/local/lib64 $PRODUCT_INSTALL/lib + rm -rf $PRODUCT_INSTALL/local +fi + +cd $SCIPY_INSTALL +f=$(find . -type d -name "scipy-$VERSION-py${PYTHON_VERSION}-*x86_64.egg") +if [ $? -eq 0 ]; then + EGG_DIR=$(ls |grep scipy-$VERSION-py${PYTHON_VERSION} |grep x86_64.egg) + echo "INFO: Found $EGG_DIR" + if [ -d $EGG_DIR/scipy ]; then + ln -sf $EGG_DIR/scipy + else + echo "WARNING: could not find $EGG_DIR/scipy" + fi +else + echo "WARNING: could not find egg directory with name: scipy-$VERSION-py${PYTHON_VERSION}-*-x86_64.egg" +fi + +echo +echo "########## END" diff --git a/products/scipy.pyconf b/products/scipy.pyconf index 43f2241..35c4d02 100755 --- a/products/scipy.pyconf +++ b/products/scipy.pyconf @@ -33,6 +33,16 @@ default_win : archive_info : {archive_name : "scipy-" + $APPLICATION.products.scipy + "_windows.tar.gz"} } +version_1_5_2_no_pip : +{ + compil_script : "scipy-1.5.2.sh" + properties : + { + incremental : "yes" + pip : "no" + } +} + version_1_3_0 : { } @@ -45,7 +55,6 @@ version_1_3_0_win : version_0_18_1 : { compil_script : "scipy.sh" - # OP 29/03/2018 Suppress the dependency to setuptools depend : ['numpy','lapack'] } -- 2.39.2