From 523a17f602f02661eae1a3d8c6065c266f3e4fba Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Fri, 24 Sep 2021 19:03:48 +0200 Subject: [PATCH] spns #24377: DB10 and UB20.04 --- applications/SALOME-master-native.pyconf | 13 ++++---- products/PyFMI.pyconf | 9 +++++ products/cminpack.pyconf | 7 ++++ products/compil_scripts/PyFMI-2.5.sh | 40 +++++++++++++++++++++++ products/compil_scripts/openturns-1.17.sh | 26 ++++++++++----- products/env_scripts/PyFMI.py | 3 +- products/env_scripts/cminpack.py | 1 + 7 files changed, 84 insertions(+), 15 deletions(-) create mode 100755 products/compil_scripts/PyFMI-2.5.sh diff --git a/applications/SALOME-master-native.pyconf b/applications/SALOME-master-native.pyconf index 84dc4fc..dd985dc 100644 --- a/applications/SALOME-master-native.pyconf +++ b/applications/SALOME-master-native.pyconf @@ -40,7 +40,7 @@ APPLICATION : click : 'native' cmake : 'native' cppunit : 'native' - cminpack: '1.3.6' + cminpack: 'native' cycler : 'native' Cython : 'native' dateutil : 'native' @@ -155,9 +155,9 @@ APPLICATION : 'PYHELLO' 'EFICAS' 'EFICAS_TOOLS' - 'PY2CPP' - 'ADAO' - 'ADAO_INTERFACE' + 'PY2CPP' + 'ADAO' + 'ADAO_INTERFACE' 'PARAVISADDONS' 'CEATESTBASE' : {tag: 'SalomeV9'} } @@ -240,7 +240,8 @@ __overwrite__ : 'PRODUCTS.qt.default.system_info.rpm_dev' : ["qt5-qtbase-devel"] } { - # PyFMI not available as native package - 'PRODUCTS.PyFMI.default.properties.pip' : "no" + __condition__ : "VARS.dist in ['DB10', 'UB20.04']" + 'PRODUCTS.PyFMI.version_2_5.properties.pip' : "no" + 'PRODUCTS.PyFMI.version_2_5.compil_script' : "PyFMI-2.5.sh" } ] diff --git a/products/PyFMI.pyconf b/products/PyFMI.pyconf index d0ecc76..a5b2c81 100644 --- a/products/PyFMI.pyconf +++ b/products/PyFMI.pyconf @@ -25,3 +25,12 @@ default : pip : "yes" } } + +version_2_5 : +{ + properties: + { + incremental : "yes" + pip : "yes" + } +} diff --git a/products/cminpack.pyconf b/products/cminpack.pyconf index c0344db..abdc5ee 100644 --- a/products/cminpack.pyconf +++ b/products/cminpack.pyconf @@ -5,6 +5,13 @@ default : cmake_options : " -DUSE_BLAS=ON -DUSE_FPIC=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_LIBDIR:STRING=lib " compil_script : $name + $VARS.scriptExtension get_source : "archive" + system_info : + { + rpm : ['cminpack'] + rpm_dev : [] + apt : ['libcminpack1'] + apt_dev : ['libcminpack-dev'] + } environ : { env_script : $name + ".py" diff --git a/products/compil_scripts/PyFMI-2.5.sh b/products/compil_scripts/PyFMI-2.5.sh new file mode 100755 index 0000000..09004f8 --- /dev/null +++ b/products/compil_scripts/PyFMI-2.5.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +#!/bin/bash + +echo "##########################################################################" +echo "PyFMI " $VERSION +echo "##########################################################################" + +echo "*** build in SOURCE directory" + + +cd $BUILD_DIR +cp -R $SOURCE_DIR/* . + +rm -f $BUILD_DIR/src/pyfmi/*.c +mkdir -p $PRODUCT_INSTALL/lib/python${PYTHON_VERSION:0:3}/site-packages +export PATH=$(pwd)/bin:$PATH +export PYTHONPATH=$(pwd):$PYTHONPATH +export PYTHONPATH=${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION:0:3}/site-packages:$PYTHONPATH + +echo +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 --fmil-home=$PRODUCT_INSTALL +if [ $? -ne 0 ] +then + echo "ERROR on install" + exit 3 +fi + +echo +echo "########## END" diff --git a/products/compil_scripts/openturns-1.17.sh b/products/compil_scripts/openturns-1.17.sh index 9d0169a..82c7c36 100755 --- a/products/compil_scripts/openturns-1.17.sh +++ b/products/compil_scripts/openturns-1.17.sh @@ -30,16 +30,25 @@ CMAKE_OPTIONS+=" -DHDF5_hdf5_LIBRARY_RELEASE=${HDF5_ROOT_DIR}/lib" CMAKE_OPTIONS+=" -DHDF5_hdf5_hl_LIBRARY_RELEASE=${HDF5_ROOT_DIR}/lib/libhdf5_hl.so" CMAKE_OPTIONS+=" -DHDF5_HL_LIBRARY=${HDF5_ROOT_DIR}/lib/libhdf5_hl.so" CMAKE_OPTIONS+=" -DHDF5_C_INCLUDE_DIR=${HDF5_ROOT_DIR}/include" + # CMINPACK -CMAKE_OPTIONS+=" -DCMINPACK_ROOT_DIR=${CMINPACK_ROOT_DIR}" -CMAKE_OPTIONS+=" -DCMINPACK_INCLUDE_DIR=${CMINPACK_ROOT_DIR}/include/cminpack-1" -CMAKE_OPTIONS+=" -DCMINPACK_LIBRARY=$CMINPACK_ROOT_DIR/lib/libcminpack_s.a" +if [ "${CMINPACK_ROOT_DIR}" != "/usr" ] +then + CMAKE_OPTIONS+=" -DCMINPACK_ROOT_DIR=${CMINPACK_ROOT_DIR}" + CMAKE_OPTIONS+=" -DCMINPACK_INCLUDE_DIR=${CMINPACK_ROOT_DIR}/include/cminpack-1" + CMAKE_OPTIONS+=" -DCMINPACK_LIBRARY=$CMINPACK_ROOT_DIR/lib/libcminpack_s.a" +else + CMAKE_OPTIONS+=" -DCMINPACK_ROOT_DIR=${CMINPACK_ROOT_DIR}" + CMAKE_OPTIONS+=" -DCMINPACK_INCLUDE_DIR=${CMINPACK_ROOT_DIR}/include/cminpack-1" +fi # Blas/Lapack -CMAKE_OPTIONS+=" -DLAPACK_DIR=${LAPACK_ROOT_DIR}/lib/cmake/lapack-3.8.0" -CMAKE_OPTIONS+=" -DCBLAS_DIR=${LAPACK_ROOT_DIR}/lib/cmake/cblas-3.8.0" -CMAKE_OPTIONS+=" -DCBLAS_LIBRARIES=$LAPACK_ROOT_DIR/lib/libcblas.so" - -### libxml2 settings +if [ "${CMINPACK_ROOT_DIR}" != "/usr" ] +then + CMAKE_OPTIONS+=" -DLAPACK_DIR=${LAPACK_ROOT_DIR}/lib/cmake/lapack-3.8.0" + CMAKE_OPTIONS+=" -DCBLAS_DIR=${LAPACK_ROOT_DIR}/lib/cmake/cblas-3.8.0" + CMAKE_OPTIONS+=" -DCBLAS_LIBRARIES=$LAPACK_ROOT_DIR/lib/libcblas.so" +fi + ### libxml2 settings if [ -n "$LIBXML2_ROOT_DIR" ] then # with a native libxml2, do not use these options @@ -208,6 +217,7 @@ if [[ -d "$SOURCE_DIR/otfftw-0.11" ]]; then do echo echo "*** C O M P O N E N T : $k-${OTP[$k]} " + cd $BUILD_DIR mkdir ${BUILD_DIR}/$k cd ${BUILD_DIR}/$k diff --git a/products/env_scripts/PyFMI.py b/products/env_scripts/PyFMI.py index 7e83f24..b9d18e8 100644 --- a/products/env_scripts/PyFMI.py +++ b/products/env_scripts/PyFMI.py @@ -6,6 +6,7 @@ import platform def set_env(env, prereq_dir, version): env.set('PYFMI_ROOT_DIR', prereq_dir) - + 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/cminpack.py b/products/env_scripts/cminpack.py index 201e8bd..45a5378 100644 --- a/products/env_scripts/cminpack.py +++ b/products/env_scripts/cminpack.py @@ -8,4 +8,5 @@ def set_env(env, prereq_dir, version): env.prepend('LD_LIBRARY_PATH',os.path.join(prereq_dir, 'lib')) def set_nativ_env(env): + env.set('CMINPACK_ROOT_DIR', '/usr') pass -- 2.39.2