]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
spns #38555: add h5py SAT configuration file
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Tue, 7 Nov 2023 15:09:47 +0000 (16:09 +0100)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Tue, 7 Nov 2023 15:09:47 +0000 (16:09 +0100)
products/compil_scripts/h5py.sh [new file with mode: 0755]
products/env_scripts/h5py.py [new file with mode: 0644]
products/h5py.pyconf [new file with mode: 0644]

diff --git a/products/compil_scripts/h5py.sh b/products/compil_scripts/h5py.sh
new file mode 100755 (executable)
index 0000000..c38b221
--- /dev/null
@@ -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 (file)
index 0000000..3137f68
--- /dev/null
@@ -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 (file)
index 0000000..c9fdd6e
--- /dev/null
@@ -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"
+    }
+}