From bee527391d07a804a7b960b52eca3b1dc701f482 Mon Sep 17 00:00:00 2001 From: Guytri KASTANE Date: Mon, 28 Oct 2024 14:48:57 +0100 Subject: [PATCH] use nlopt embedded on FD32; fix statsmodels installation on RO9 --- applications/SALOME-master-native.pyconf | 5 +- products/compil_scripts/openturns-1.23.sh | 6 +- products/compil_scripts/patsy-0.5.4.sh | 57 +++++++++++++++++++ products/compil_scripts/statsmodels-0.14.1.sh | 49 ++++++++++++++++ products/env_scripts/patsy.py | 13 +++++ products/env_scripts/statsmodels.py | 13 +++++ products/patsy.pyconf | 20 +++++-- products/statsmodels.pyconf | 12 +++- 8 files changed, 165 insertions(+), 10 deletions(-) create mode 100755 products/compil_scripts/patsy-0.5.4.sh create mode 100755 products/compil_scripts/statsmodels-0.14.1.sh create mode 100644 products/env_scripts/patsy.py create mode 100644 products/env_scripts/statsmodels.py diff --git a/applications/SALOME-master-native.pyconf b/applications/SALOME-master-native.pyconf index 39d5449..ef0d1f2 100644 --- a/applications/SALOME-master-native.pyconf +++ b/applications/SALOME-master-native.pyconf @@ -112,6 +112,7 @@ APPLICATION : packaging : 'native' packagespy : '74152cd' pandas : 'native' + patsy : 'native' ParaView : {tag:'5.11.0', base: 'no', section: 'version_5_11_0_MPI', hpc: 'yes'} PERSALYS : 'v16.0.1' petsc : {tag : '3.16.0', section: 'version_3_16_0'} @@ -389,6 +390,7 @@ __overwrite__ : 'APPLICATION.products.opencv' : '3.2.0' 'APPLICATION.products.openmpi' : '4.1.5' 'APPLICATION.products.sip' : '5.5.0' + 'APPLICATION.products.patsy' : {tag: '0.5.4', base: 'no', section: 'version_0_5_4_no_pip' } 'APPLICATION.products.root' : {tag: '6.22.02', base: 'no', section: 'version_6_22_02_CO9' } 'APPLICATION.products.qt' : {tag: '5.15.2', base: 'no', section: 'version_5_15_2_CO9' } 'APPLICATION.products.mdurl' : {tag: '0.1.2', base: 'no', section: 'version_0_1_2_no_pip' } @@ -399,7 +401,7 @@ __overwrite__ : 'APPLICATION.products.PyFMI' : {tag: '2.6', base: 'no', section: 'version_2_6_no_pip' } 'APPLICATION.products.numpydoc' : {tag: '0.9.0', base: 'no', section: 'version_0_9_0_no_pip' } 'APPLICATION.products.pandas' : {tag: '1.1.5', base: 'no', section: 'version_1_1_5_no_pip' } - 'APPLICATION.products.statsmodels' : {tag: '0.6.1', base: 'no', section: 'version_0_6_1_no_pip' } + 'APPLICATION.products.statsmodels' : {tag: '0.14.1', base: 'no', section: 'version_0_14_1_no_pip' } 'APPLICATION.products.nose' : {tag: '1.3.7', base: 'no', section: 'version_1_3_7_no_pip' } 'APPLICATION.products.ParaView' : {tag: '5.11.0', base: 'no', section: 'version_5_11_0_MPI_CO9', hpc: 'yes'} 'APPLICATION.products.YDEFX' : {tag: 'master', base: 'no', section: 'version_master_CO9' } @@ -409,6 +411,7 @@ __overwrite__ : { __condition__ : "VARS.dist in ['FD32']" 'APPLICATION.rm_products' : ['nose_py3','assimulo'] # + 'APPLICATION.products.nlopt' : '2.7.0' 'APPLICATION.products.opencv' : '3.2.0' 'APPLICATION.products.qt' : '5.15.2' 'APPLICATION.products.qwt' : '6.1.6' diff --git a/products/compil_scripts/openturns-1.23.sh b/products/compil_scripts/openturns-1.23.sh index 2976a2d..43686b3 100755 --- a/products/compil_scripts/openturns-1.23.sh +++ b/products/compil_scripts/openturns-1.23.sh @@ -347,7 +347,7 @@ if [[ -d "$SOURCE_DIR/otfftw-0.15" ]]; then echo "WARNING: dill is already installed" fi echo "INFO: install pythonfmu-0.6.3" - if ! ${PYTOHNBIN} -c "import pythonfmu"; then + if ! ${PYTHONBIN} -c "import pythonfmu"; then ${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip $SOURCE_DIR/pythonfmu-0.6.3/pythonfmu-0.6.3-py3-none-any.whl --no-deps --prefix=$PRODUCT_INSTALL if [ $? -ne 0 ] then @@ -364,7 +364,7 @@ if [[ -d "$SOURCE_DIR/otfftw-0.15" ]]; then fi echo "INFO: install joblib-1.1.0" if ! ${PYTHONBIN} -c "import joblib"; then - ${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip $SOURCE_DIR/joblib-1.1.0/joblib-1.1.0-py2.py3-none-any.whl --no-deps + ${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip $SOURCE_DIR/joblib-1.1.0/joblib-1.1.0-py2.py3-none-any.whl --no-deps if [ $? -ne 0 ]; then echo "FATAL: could not install joblib-1.1.0" exit 6 @@ -401,7 +401,7 @@ if [[ -d "$SOURCE_DIR/otfftw-0.15" ]]; then echo "WARNING: sklearn is already installed" fi echo "INFO: install threadpoolctl-3.0.0" - if ! ${PPYTHONBIN} -c "import threadpoolctl"; then + if ! ${PYTHONBIN} -c "import threadpoolctl"; then ${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip $SOURCE_DIR/threadpoolctl-3.0.0/threadpoolctl-3.0.0-py3-none-any.whl --no-deps --prefix=$PRODUCT_INSTALL if [ $? -ne 0 ] then diff --git a/products/compil_scripts/patsy-0.5.4.sh b/products/compil_scripts/patsy-0.5.4.sh new file mode 100755 index 0000000..7c071b8 --- /dev/null +++ b/products/compil_scripts/patsy-0.5.4.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +echo "##########################################################################" +echo "patsy " $VERSION +echo "##########################################################################" + +rm -rf $BUILD_DIR +mkdir $BUILD_DIR +cd $BUILD_DIR +cp -R $SOURCE_DIR/* . + +USE_OLD_SETUPTOOLS=false + +if [[ $DIST_NAME == "CO" && "$SAT_Python_IS_NATIVE" == "1" ]]; then + PRODUCT_LIB=lib64 +else + PRODUCT_LIB=lib +fi +#mkdir -p $PRODUCT_INSTALL/${PRODUCT_LIB}/python${PYTHON_VERSION}/site-packages +export PATH=$(pwd)/bin:$PATH +export PYTHONPATH=$(pwd):$PYTHONPATH +export PYTHONPATH=${PRODUCT_INSTALL}/${PRODUCT_LIB}/python${PYTHON_VERSION}/site-packages:$PYTHONPATH + +echo +if [ $USE_OLD_SETUPTOOLS ]; then + echo "*** install with ${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip . --no-deps --prefix=$PRODUCT_INSTALL" + ${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip . --no-deps --prefix=$PRODUCT_INSTALL +else + echo "*** build with $PYTHONBIN" + $PYTHONBIN setup.py build + if [ $? -ne 0 ] + then + echo "ERROR on build" + exit 2 + fi + + echo + echo "*** install with $PYTHONBIN" + $PYTHONBIN setup.py install --prefix=$PRODUCT_INSTALL + if [ $? -ne 0 ] + then + echo "ERROR on install" + exit 3 + fi +fi + +if [ -d "${PRODUCT_INSTALL}/lib64" ]; then + echo "WARNING: moving lib64 to lib" + mv $PRODUCT_INSTALL/lib64 $PRODUCT_INSTALL/lib +elif [ -d "${PRODUCT_INSTALL}/local/lib64" ]; then + echo "WARNING: moving local/lib64 to lib" + mv $PRODUCT_INSTALL/local/lib64 $PRODUCT_INSTALL/lib + rm -rf ${PRODUCT_INSTALL}/local/lib64 +fi + +echo +echo "########## END" diff --git a/products/compil_scripts/statsmodels-0.14.1.sh b/products/compil_scripts/statsmodels-0.14.1.sh new file mode 100755 index 0000000..ca41589 --- /dev/null +++ b/products/compil_scripts/statsmodels-0.14.1.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +echo "##########################################################################" +echo "statsmodels " $VERSION +echo "##########################################################################" + +rm -rf $BUILD_DIR +mkdir $BUILD_DIR +cd $BUILD_DIR +cp -R $SOURCE_DIR/* . + +USE_OLD_SETUPTOOLS=false + +echo +if [ $USE_OLD_SETUPTOOLS ]; then + echo "*** install with ${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip . --no-deps --prefix=$PRODUCT_INSTALL" + ${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip . --no-deps --prefix=$PRODUCT_INSTALL +else + mkdir -p $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages + + echo "*** build with $PYTHONBIN" + $PYTHONBIN setup.py build + if [ $? -ne 0 ] + then + echo "ERROR on build" + exit 2 + fi + + echo + echo "*** install with $PYTHONBIN" + $PYTHONBIN setup.py install --prefix=$PRODUCT_INSTALL + if [ $? -ne 0 ] + then + echo "ERROR on install" + exit 3 + fi +fi + +if [ -d "${PRODUCT_INSTALL}/lib64" ]; then + echo "WARNING: moving lib64 to lib" + mv $PRODUCT_INSTALL/lib64 $PRODUCT_INSTALL/lib +elif [ -d "${PRODUCT_INSTALL}/local/lib64" ]; then + echo "WARNING: moving local/lib64 to lib" + mv $PRODUCT_INSTALL/local/lib64 $PRODUCT_INSTALL/lib + rm -rf ${PRODUCT_INSTALL}/local/lib64 +fi + +echo +echo "########## END" diff --git a/products/env_scripts/patsy.py b/products/env_scripts/patsy.py new file mode 100644 index 0000000..5e3ff19 --- /dev/null +++ b/products/env_scripts/patsy.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path +import platform +def set_env(env, prereq_dir, version): + env.set('PATSY_ROOT_DIR', prereq_dir) + if not platform.system() == "Windows" : + pyver = 'python' + env.get('PYTHON_VERSION') + env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'lib', pyver, 'site-packages')) + +def set_nativ_env(env): + pass diff --git a/products/env_scripts/statsmodels.py b/products/env_scripts/statsmodels.py new file mode 100644 index 0000000..20e4bcd --- /dev/null +++ b/products/env_scripts/statsmodels.py @@ -0,0 +1,13 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +import os.path +import platform +def set_env(env, prereq_dir, version): + env.set('STATSMODELS_ROOT_DIR', prereq_dir) + if not platform.system() == "Windows" : + pyver = 'python' + env.get('PYTHON_VERSION') + env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'lib', pyver, 'site-packages')) + +def set_nativ_env(env): + pass diff --git a/products/patsy.pyconf b/products/patsy.pyconf index 107fad8..5aeef58 100644 --- a/products/patsy.pyconf +++ b/products/patsy.pyconf @@ -6,14 +6,14 @@ default : get_source : "archive" system_info : { - rpm : [] - rpm_dev : [] - apt : [] - apt_dev : [] + rpm : ['python3-patsy'] + rpm_dev : ['python3-patsy'] + apt : ['python3-patsy'] + apt_dev : ['python3-patsy'] } environ : { - + env_script : $name + ".py" } depend : ["Python", "setuptools"] opt_depend : ['pandas'] @@ -26,3 +26,13 @@ default : pip : "yes" } } + +version_0_5_4_no_pip : +{ + compil_script : "patsy-0.5.4" + $VARS.scriptExtension + properties: + { + incremental : "yes" + pip : "no" + } +} diff --git a/products/statsmodels.pyconf b/products/statsmodels.pyconf index b022a54..d8d267d 100644 --- a/products/statsmodels.pyconf +++ b/products/statsmodels.pyconf @@ -13,7 +13,7 @@ default : } environ : { - + env_script : $name + ".py" } depend : ["Python", "setuptools","PyFMI", "numpy", "scipy", "matplotlib", "packaging"] opt_depend : ['pandas', 'patsy', 'Pillow'] @@ -27,6 +27,16 @@ default : } } +version_0_14_1_no_pip: +{ + compil_script : "statsmodels-0.14.1" + $VARS.scriptExtension + properties: + { + incremental : "yes" + pip : "no" + } +} + version_0_10_2: { properties: -- 2.39.2