From 322047618412b43989db875578ad3c3a8a15df05 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Tue, 7 Nov 2023 16:09:47 +0100 Subject: [PATCH] spns #38555: add h5py SAT configuration file --- products/compil_scripts/h5py.sh | 27 +++++++++++++++++++++++++++ products/env_scripts/h5py.py | 15 +++++++++++++++ products/h5py.pyconf | 29 +++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100755 products/compil_scripts/h5py.sh create mode 100644 products/env_scripts/h5py.py create mode 100644 products/h5py.pyconf diff --git a/products/compil_scripts/h5py.sh b/products/compil_scripts/h5py.sh new file mode 100755 index 0000000..c38b221 --- /dev/null +++ b/products/compil_scripts/h5py.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +echo "##########################################################################" +echo "openturns" $VERSION +echo "##########################################################################" + +# we don't install in python directory -> modify environment as described in INSTALL file + +#mkdir -p $PRODUCT_INSTALL/lib/python${PYTHON_VERSION}/site-packages +rm -rf $BUILD_DIR +cp -r $SOURCE_DIR $BUILD_DIR +mkdir -p $BUILD_DIR/cache/pip +cd $BUILD_DIR +$PYTHONBIN setup.py build +if [ $? -ne 0 ] +then + echo "ERROR on ${PYTHONBIN} setup.py build" + exit 4 +fi +# + +$PYTHONBIN setup.py install --prefix=$PRODUCT_INSTALL +if [ $? -ne 0 ] +then + echo "ERROR on ${PYTHONBIN} setup.py install --prefix=$PRODUCT_INSTALL" + exit 5 +fi diff --git a/products/env_scripts/h5py.py b/products/env_scripts/h5py.py new file mode 100644 index 0000000..3137f68 --- /dev/null +++ b/products/env_scripts/h5py.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('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')) + +def set_nativ_env(env): + pass diff --git a/products/h5py.pyconf b/products/h5py.pyconf new file mode 100644 index 0000000..c9fdd6e --- /dev/null +++ b/products/h5py.pyconf @@ -0,0 +1,29 @@ +default : +{ + name : "h5py" + build_source : "script" + compil_script: "h5py.sh" + get_source : "archive" + patches : [] + system_info : + { + rpm : ["h5py"] + rpm_dev : [] + apt : ["python3-h5py"] + apt_dev : [] + } + environ : + { + env_script : $name + ".py" + } + depend : ['Python', 'numpy', 'hdf5'] + 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 : "no" + } +} -- 2.39.2