From 4cd7aeca3420e2a09b1b6886c1c90979e92cfe1b Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Wed, 13 Sep 2023 16:50:42 +0200 Subject: [PATCH] bos #37641 : add openturns 1.21 and PERSALYS 14.1 description sections and compilation files --- products/PERSALYS.pyconf | 37 ++ products/compil_scripts/PERSALYS-v14.1.bat | 158 ++++++++ products/compil_scripts/PERSALYS-v14.1.sh | 139 +++++++ products/compil_scripts/openturns-1.21.bat | 320 +++++++++++++++ products/compil_scripts/openturns-1.21.sh | 440 +++++++++++++++++++++ products/openturns.pyconf | 26 +- 6 files changed, 1119 insertions(+), 1 deletion(-) create mode 100644 products/compil_scripts/PERSALYS-v14.1.bat create mode 100644 products/compil_scripts/PERSALYS-v14.1.sh create mode 100644 products/compil_scripts/openturns-1.21.bat create mode 100644 products/compil_scripts/openturns-1.21.sh diff --git a/products/PERSALYS.pyconf b/products/PERSALYS.pyconf index 114a203..d3c41c4 100644 --- a/products/PERSALYS.pyconf +++ b/products/PERSALYS.pyconf @@ -59,6 +59,43 @@ default_win : } } +version_v14_1 : +{ + patches : [] +} + +version_v14_1_win : +{ + compil_script : 'PERSALYS-v14.1.bat' + depend : ['Python', + 'hdf5', + 'cgns', + 'tbb', + 'nlopt', + 'libxml2', + 'eigen', + 'boost', + 'ADAO', + 'KERNEL', + 'GUI', + 'Sphinx', + 'qwt', + 'qt', + 'ParaView', + 'openturns', + 'FMILibrary', + 'PyFMI', + 'YACS', + 'YDEFX', + 'PY2CPP', + 'CAS', + 'CONFIGURATION', + 'openblas', + 'pthreads' + ] + patches : [] +} + version_v14_0_1 : { patches : [] diff --git a/products/compil_scripts/PERSALYS-v14.1.bat b/products/compil_scripts/PERSALYS-v14.1.bat new file mode 100644 index 0000000..eedaab8 --- /dev/null +++ b/products/compil_scripts/PERSALYS-v14.1.bat @@ -0,0 +1,158 @@ +@echo off + +echo ########################################################################## +echo openturns %VERSION% +echo ########################################################################## + +IF NOT DEFINED SAT_DEBUG ( + SET SAT_DEBUG=0 +) + +SET PRODUCT_BUILD_TYPE=Release +if %SAT_DEBUG% == 1 ( + set PRODUCT_BUILD_TYPE=Debug +) + +IF NOT DEFINED CMAKE_GENERATOR ( + SET CMAKE_GENERATOR="Visual Studio 15 2017 Win64" +) + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% + +SET CMAKE_OPTIONS= +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_PREFIX:STRING=%PRODUCT_INSTALL:\=/% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE:STRING=%PRODUCT_BUILD_TYPE% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_LIBDIR:STRING=lib +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPYTHON_EXECUTABLE=%PYTHONBIN% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DSWIG_EXECUTABLE=%SWIG_ROOT_DIR:\=/%/bin/swig.exe +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DTBB_ROOT_DIR=%TBB_ROOT_DIR% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -Dtbb_DIR:PATH=%TBB_ROOT_DIR:\=/% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DUSE_TBB=OFF +REM libxml2 settings +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DVTK_MODULE_USE_EXTERNAL_VTK_libxml2:BOOL=ON +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLIBXML2_INCLUDE_DIR:STRING=%LIBXML2_ROOT_DIR:\=/%/include +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLIBXML2_LIBRARIES:STRING=%LIBXML2_ROOT_DIR:\=/%/lib/libxml2.lib +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLIBXML2_LIBRARY:STRING=%LIBXML2_ROOT_DIR:\=/%/lib/libxml2.lib +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLIBXML2_XMLLINT_EXECUTABLE=%LIBXML2_ROOT_DIR:\=/%/bin/xmllint.exe + + +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPTHREAD_ROOT_DIR=%PTHREAD_ROOT_DIR:\=/% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPTHREAD_INCLUDE_DIR=%PTHREAD_ROOT_DIR:\=/%/include +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPTHREAD_DLL_LIBRARY=%PTHREAD_ROOT_DIR:\=/%/lib/pthreadVC2.dll +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPTHREAD_LIBRARY=%PTHREAD_ROOT_DIR:\=/%/lib/pthreadVCE2.lib + +REM HDF5 settings +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DVTK_MODULE_USE_EXTERNAL_VTK_hdf5:BOOL=ON +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DHDF5_DIR:PATH=%HDF5_ROOT_DIR:\=/%/cmake/hdf5 +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DHDF5_INCLUDE_DIRS:PATH=%HDF5_ROOT_DIR:\=/%/include +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DHDF5_USE_STATIC_LIBRARIES:BOOL=OFF + +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DNLOPT_INCLUDE_DIRS:STRING=%NLOPT_ROOT_DIR:\=/%/include +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DNLOPT_LIBRARIES:STRING=%NLOPT_ROOT_DIR:\=/%/bin +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DNLOPT_DIR:STRING=%NLOPT_ROOT_DIR:\=/% + +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCBLAS_DIR=%OPENBLAS_ROOT_DIR:\=/%/share/cmake/OpenBLAS + +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPython3_EXECUTABLE:FILEPATH=%PYTHON_ROOT_DIR:\=/%/python3.exe +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPython3_INCLUDE_DIR:PATH=%PYTHON_ROOT_DIR:\=/%/include + +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLAPACK_LIBRARIES:FILEPATH=%OPENBLAS_ROOT_DIR:\=/%/lib/openblas.lib +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_SHARED_LINKER_FLAGS_RELEASE="/OPT:NOREF /INCREMENTAL:NO" +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_UNITY_BUILD=ON +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_UNITY_BUILD_BATCH_SIZE=16 +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DSWIG_COMPILE_FLAGS="/bigobj" +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DUSE_SPHINX=OFF +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DQWT_INCLUDE_DIR=%QWT_ROOT_DIR:\=/%/include +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBUILD_SHARED_LIBS:BOOL=ON +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DADAO_ROOT_DIR=%ADAO_ROOT_DIR:\=/% + +REM Boost settings +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBOOST_ROOT:PATH=%BOOST_ROOT_DIR:\=/% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBoost_ADDITIONAL_VERSIONS="1.67.0 1.67" +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBOOST_INCLUDEDIR=%BOOST_ROOT_DIR:\=/%/include/boost-1_67 +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBoost_INCLUDE_DIR=%BOOST_ROOT_DIR:\=/%/include/boost-1_67 +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBoost_NO_BOOST_CMAKE:BOOL=ON +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DBoost_NO_SYSTEM_PATHS:BOOL=ON + +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DGUI_ROOT_DIR=%GUI_ROOT_DIR:\=/% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DSalomeGUI_DIR=%GUI_ROOT_DIR:\=/%/adm_local/cmake_files +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DKERNEL_ROOT_DIR=%KERNEL_ROOT_DIR:\=/% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DSalomeKERNEL_DIR=%KERNEL_ROOT_DIR:\=/%/salome_adm/cmake_files +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DOpenTURNS_DIR=%OT_ROOT_DIR:\=/%/lib/cmake/openturns +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -Dotmorris_DIR==%OT_ROOT_DIR:\=/%/lib/cmake/otmorris +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPy2cpp_DIR=%PY2CPP_ROOT_DIR:\=/%/lib/cmake/py2cpp + +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DQWT_INCLUDE_DIR=%QWT_ROOT_DIR:\=/%/include +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DQWT_LIBRARY=%QWT_ROOT_DIR:\=/%/lib/qwt.lib + +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DUSE_SPHINX=OFF +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DSPHINX_ROOT_DIR=%SPHINX_ROOT_DIR:\=/% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DYACS_ROOT_DIR=%YACS_ROOT_DIR:\=/% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DSalomeYACS_DIR=%YACS_ROOT_DIR:\=/%/adm/cmake +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -Dydefx_DIR=%YDEFX_ROOT_DIR:\=/%/salome_adm/cmake_files +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DAdaoCppLayer_INCLUDE_DIR=%ADAO_INTERFACE_ROOT_DIR:\=/%/include +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DAdaoCppLayer_ROOT_DIR=%ADAO_INTERFACE_ROOT_DIR:\=/% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DUSE_SALOME=ON +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DTBB_ROOT=%TBB_ROOT_DIR:\=/% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DTBB_INCLUDE_DIR=%TBB_ROOT_DIR:\=/%/include +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPYTHON_EXECUTABLE=%PYTHONBIN:\=/% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPYTHON_INCLUDE_DIR=%PYTHON_INCLUDE:\=/% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_FIND_ROOT_PATH=ON + +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCGNS_INCLUDE_DIR:PATH=%CGNS_ROOT_DIR:\=/%/include +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCGNS_LIBRARY:STRING=%CGNS_ROOT_DIR:\=/%/lib/cgnsdll.lib +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCGNS_INCLUDE_DIR:PATH=%CGNS_ROOT_DIR:\=/%/include + + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% + +cd %BUILD_DIR% + +set MSBUILDDISABLENODEREUSE=1 + +echo. +echo ********************************************************************* +echo *** %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR% +echo ********************************************************************* +echo. + +%CMAKE_ROOT%\bin\cmake -G "Visual Studio 15 2017 Win64" %CMAKE_OPTIONS% %SOURCE_DIR% +if NOT %ERRORLEVEL% == 0 ( + echo "ERROR on cmake" + exit 1 +) + +echo. +echo ********************************************************************* +echo *** msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 /p:CharacterSet=Unicode ALL_BUILD.vcxproj + +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 /p:CharacterSet=Unicode ALL_BUILD.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild ALL_BUILD.vcxproj, please check! + REM exit 2 +) + +echo. +echo ********************************************************************* +echo *** installation... +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 /p:CharacterSet=Unicode INSTALL.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild INSTALL.vcxproj + exit 3 +) + +echo +echo "########## END" diff --git a/products/compil_scripts/PERSALYS-v14.1.sh b/products/compil_scripts/PERSALYS-v14.1.sh new file mode 100644 index 0000000..a64aa95 --- /dev/null +++ b/products/compil_scripts/PERSALYS-v14.1.sh @@ -0,0 +1,139 @@ +#!/bin/bash + +echo "##########################################################################" +echo "PERSALYS" $VERSION +echo "##########################################################################" + +if [ -n "$SAT_HPC" ] && [ -n "$MPI_ROOT_DIR" ]; then + echo "WARNING: setting CC and CXX environment variables and target MPI wrapper" + CMAKE_OPTIONS+=" -DCMAKE_CXX_COMPILER:STRING=${MPI_CXX_COMPILER}" + CMAKE_OPTIONS+=" -DCMAKE_C_COMPILER:STRING=${MPI_C_COMPILER}" + CMAKE_OPTIONS+=" -DMPI_C_FOUND=$MPI_C_FOUND" +fi + +CMAKE_OPTIONS="" +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX:STRING=$PRODUCT_INSTALL" +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" +CMAKE_OPTIONS+=" -DADAO_ROOT_DIR=$ADAO_ROOT_DIR" +CMAKE_OPTIONS+=" -DBOOST_ROOT:PATH=$BOOST_ROOT_DIR" +CMAKE_OPTIONS+=" -DGUI_ROOT_DIR=$GUI_ROOT_DIR" +CMAKE_OPTIONS+=" -DSalomeGUI_DIR=$GUI_ROOT_DIR/adm_local/cmake_files" +CMAKE_OPTIONS+=" -DKERNEL_ROOT_DIR=$KERNEL_ROOT_DIR" +CMAKE_OPTIONS+=" -DSalomeKERNEL_DIR=$KERNEL_ROOT_DIR/salome_adm/cmake_files" +CMAKE_OPTIONS+=" -DOpenTURNS_DIR=$OT_ROOT_DIR/lib/cmake/openturns" +CMAKE_OPTIONS+=" -DPy2cpp_DIR=$PY2CPP_ROOT_DIR//lib/cmake/py2cpp" + +# strangely some distributions fail to guess qwt installation location +# - CentOS 8 +# - Ubuntu 20.04 +if [[ $DIST_NAME == "CO" && $DIST_VERSION == "8" && "$SAT_qwt_IS_NATIVE" == "1" ]]; then + CMAKE_OPTIONS+=" -DQWT_LIBRARY=/usr/lib64/libqwt-qt5.so" + CMAKE_OPTIONS+=" -DQWT_INCLUDE_DIR=/usr/include/qt5/qwt" +elif [[ $DIST_NAME == "UB" && $DIST_VERSION == "20.04" && "$SAT_qwt_IS_NATIVE" == "1" ]]; then + CMAKE_OPTIONS+=" -DQWT_LIBRARY=/usr/lib/libqwt-qt5.so" + CMAKE_OPTIONS+=" -DQWT_INCLUDE_DIR=/usr/include/qwt" +elif [ "$SAT_qwt_IS_NATIVE" != "1" ]; then + CMAKE_OPTIONS+=" -DQWT_LIBRARY=$QWT_ROOT_DIR/lib/libqwt.so" + CMAKE_OPTIONS+=" -DQWT_INCLUDE_DIR=$QWT_ROOT_DIR/include" +fi + +if [[ "$DIST_NAME$DIST_VERSION" == "CO8" ]]; then + CMAKE_OPTIONS+=" -DUSE_SPHINX=OFF" # missing tex-preview LateX package for CentOS 8 +elif [[ "$DIST_NAME$DIST_VERSION" == "CO7" ]]; then + CMAKE_OPTIONS+=" -DUSE_SPHINX=OFF" # missing tex-preview LateX package for CentOS 7 - à installer +elif [ "$DIST_NAME$DIST_VERSION" == "FD36" ]; then + CMAKE_OPTIONS+=" -DUSE_SPHINX=OFF" # +elif [ "$DIST_NAME$DIST_VERSION" == "FD37" ]; then + CMAKE_OPTIONS+=" -DUSE_SPHINX=OFF" # +elif [ "$DIST_NAME$DIST_VERSION" == "FD38" ]; then + CMAKE_OPTIONS+=" -DUSE_SPHINX=OFF" # +else + CMAKE_OPTIONS+=" -DUSE_SPHINX=ON" +fi +CMAKE_OPTIONS+=" -DSPHINX_ROOT_DIR=$SPHINX_ROOT_DIR" +CMAKE_OPTIONS+=" -DYACS_ROOT_DIR=$YACS_ROOT_DIR" +CMAKE_OPTIONS+=" -DSalomeYACS_DIR=$YACS_ROOT_DIR/adm/cmake" +CMAKE_OPTIONS+=" -Dydefx_DIR=$YDEFX_ROOT_DIR/salome_adm/cmake_files" +CMAKE_OPTIONS+=" -DAdaoCppLayer_INCLUDE_DIR=$ADAO_INTERFACE_ROOT_DIR/include" +CMAKE_OPTIONS+=" -DAdaoCppLayer_ROOT_DIR=$ADAO_INTERFACE_ROOT_DIR" +CMAKE_OPTIONS+=" -DUSE_SALOME=ON" +if [ ! -z "$TBB_ROOT" ]; then + CMAKE_OPTIONS+=" -DTBB_ROOT=$TBB_ROOT_DIR" + CMAKE_OPTIONS+=" -DTBB_INCLUDE_DIR=$TBB_ROOT_DIR/include" +fi +CMAKE_OPTIONS+=" -DPYTHON_EXECUTABLE=$PYTHONBIN" + +CMAKE_OPTIONS+=" -DPYTHON_INCLUDE_DIR=$PYTHON_INCLUDE" +if [ "$SAT_Python_IS_NATIVE" != "1" ]; then + CMAKE_OPTIONS+=" -DPYTHON_LIBRARY=$PYTHON_ROOT_DIR/lib/libpython$PYTHON_VERSION.so" +fi + +if [ "$SAT_Sphinx_IS_NATIVE" != "1" ]; then + CMAKE_OPTIONS+=" -DSPHINX_ROOT_DIR:FILEPATH=$SPHINX_ROOT_DIR" + CMAKE_OPTIONS+=" -DSPHINX_EXECUTABLE:FILEPATH=$SPHINX_ROOT_DIR/bin/sphinx-build" +fi + +CMAKE_OPTIONS+=" -DCMAKE_FIND_ROOT_PATH=ON" +CMAKE_OPTIONS+=" -DSWIG_EXECUTABLE:PATH=$(which swig)" +if [ "${SAT_cgns_IS_NATIVE}" != "1" ] +then + CMAKE_OPTIONS+=" -DCGNS_INCLUDE_DIR:PATH=${CGNS_ROOT_DIR}/include" + CMAKE_OPTIONS+=" -DCGNS_LIBRARY:PATH=${CGNS_ROOT_DIR}/lib/libcgns.so" +fi +if [ -n "$SAT_DEBUG" ]; then + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Debug" +else + CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Release" +fi + +echo +echo "*** cmake" $CMAKE_OPTIONS +cmake $CMAKE_OPTIONS $SOURCE_DIR +if [ $? -ne 0 ] +then + echo "ERROR on cmake" + exit 1 +fi + +echo +echo "*** make" $MAKE_OPTIONS +make $MAKE_OPTIONS +if [ $? -ne 0 ] +then + echo "ERROR on make" + exit 2 +fi + +echo +echo "*** make install" +make install +if [ $? -ne 0 ] +then + echo "ERROR on make install" + exit 3 +fi + +# spns #32377 +# setting -DCMAKE_INSTALL_LIBDIR to lib is not enough on Fedora nodes +echo +echo "*** check installation" +if [ ! -d "${PRODUCT_INSTALL}/lib" ]; then + mkdir -p ${PRODUCT_INSTALL}/lib +fi + +if [ -d "${PRODUCT_INSTALL}/lib64" ]; then + echo "WARNING: moving lib64 to lib" + mv ${PRODUCT_INSTALL}/lib64/* ${PRODUCT_INSTALL}/lib/ + rmdir ${PRODUCT_INSTALL}/lib64 +fi + + +if [ -d "${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/dist-packages" ]; then + echo "WARNING: linking against dist-packages" + cd ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION} + ln -sf dist-packages site-packages +fi + +echo +echo "########## END" + diff --git a/products/compil_scripts/openturns-1.21.bat b/products/compil_scripts/openturns-1.21.bat new file mode 100644 index 0000000..daa30e6 --- /dev/null +++ b/products/compil_scripts/openturns-1.21.bat @@ -0,0 +1,320 @@ +@echo off + +echo ########################################################################## +echo openturns %VERSION% +echo ########################################################################## + +IF NOT DEFINED SAT_DEBUG ( + SET SAT_DEBUG=0 +) + +IF NOT DEFINED CMAKE_GENERATOR ( + SET CMAKE_GENERATOR="Visual Studio 15 2017 Win64" +) +SET PRODUCT_BUILD_TYPE=Release + +REM TODO: NGH: not Tested yet +if %SAT_DEBUG% == 1 ( + set PRODUCT_BUILD_TYPE=Debug +) + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% + +REM we don't install in python directory -> modify environment as described in INSTALL file +set PATH=%WINFLEX_ROOT_DIR%;%PATH% +SET PATH=%CWD%\bin;%PATH% +SET PYTHONPATH=%CWD%;%PYTHONPATH% +SET PYTHONPATH=%PRODUCT_INSTALL%\lib\python%PYTHON_VERSION%\site-packages;%PYTHONPATH% + +GOTO:MAIN + +:MODULE_BUILDER + SETLOCAL ENABLEDELAYEDEXPANSION + SET MODULE_NAME=%~1 + SET MODULE_SOURCE_DIR=%~2 + SET MODULE_BUILD_DIR=%~3 + SET MODULE_INSTALL_DIR=%~4 + SET X=%~5 + SET MODULE_CMAKE_OPTIONS=%X:'="% + REM NGH: We replace ' with " - we could of course parse the input. + ECHO call MODULE_BUILDER for %MODULE_NAME% + ECHO command line option: %MODULE_CMAKE_OPTIONS% + REM TODO: NGH: not Tested yet + if exist "%MODULE_BUILD_DIR%" rmdir /Q /S %MODULE_BUILD_DIR% + mkdir %MODULE_BUILD_DIR% + cd %MODULE_BUILD_DIR% + + echo. + echo -------------------------------------------------------------------------- + echo *** %CMAKE_ROOT%\bin\cmake -G %CMAKE_GENERATOR% %MODULE_CMAKE_OPTIONS% %MODULE_SOURCE_DIR% + echo -------------------------------------------------------------------------- + %CMAKE_ROOT%\bin\cmake -G %CMAKE_GENERATOR% %MODULE_CMAKE_OPTIONS% %MODULE_SOURCE_DIR% + if NOT %ERRORLEVEL% == 0 ( + echo ERROR on cmake + exit 1 + ) + + echo. + echo -------------------------------------------------------------------------- + echo *** msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj + echo -------------------------------------------------------------------------- + msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj + if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild ALL_BUILD.vcxproj + exit 2 + ) + + echo. + echo -------------------------------------------------------------------------- + echo *** msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 INSTALL.vcxproj + echo -------------------------------------------------------------------------- + + msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 INSTALL.vcxproj + if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild INSTALL.vcxproj + exit 3 + ) + ENDLOCAL +EXIT /B 0 + + +:MAIN + +SET CMAKE_OPTIONS= +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_PREFIX:STRING=%PRODUCT_INSTALL:\=/% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE:STRING=%PRODUCT_BUILD_TYPE% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_LIBDIR:STRING=lib +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPYTHON_EXECUTABLE=%PYTHONBIN% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DSWIG_EXECUTABLE=%SWIG_ROOT_DIR:\=/%/bin/swig +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DTBB_ROOT_DIR=%TBB_ROOT_DIR% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -Dtbb_DIR:PATH=%TBB_ROOT_DIR:\=/% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DUSE_TBB=OFF +REM libxml2 settings +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DVTK_MODULE_USE_EXTERNAL_VTK_libxml2:BOOL=ON +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLIBXML2_INCLUDE_DIR:STRING=%LIBXML2_ROOT_DIR:\=/%/include +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLIBXML2_LIBRARIES:STRING=%LIBXML2_ROOT_DIR:\=/%/lib/libxml2.lib +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLIBXML2_XMLLINT_EXECUTABLE=%LIBXML2_ROOT_DIR:\=/%/bin/xmllint.exe + +REM HDF5 settings +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DVTK_MODULE_USE_EXTERNAL_VTK_hdf5:BOOL=ON +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DHDF5_DIR:PATH=%HDF5_ROOT_DIR:\=/%/cmake/hdf5 +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DHDF5_INCLUDE_DIRS:PATH=%HDF5_ROOT_DIR:\=/%/include +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DHDF5_USE_STATIC_LIBRARIES:BOOL=OFF +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DNLOPT_INCLUDE_DIRS:STRING=%NLOPT_ROOT_DIR:\=/%/include +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DNLOPT_LIBRARIES:STRING=%NLOPT_ROOT_DIR:\=/%/bin +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DNLOPT_DIR:STRING=%NLOPT_ROOT_DIR:\=/% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCBLAS_DIR=%OPENBLAS_ROOT_DIR:\=/%/share/cmake/OpenBLAS +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPython3_EXECUTABLE:FILEPATH=%PYTHON_ROOT_DIR:\=/%/python3.exe +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPython3_INCLUDE_DIR:PATH=%PYTHON_ROOT_DIR:\=/%/include +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLAPACK_LIBRARIES:FILEPATH=%OPENBLAS_ROOT_DIR:\=/%/lib/openblas.lib +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_SHARED_LINKER_FLAGS_RELEASE='/OPT:NOREF /INCREMENTAL:NO' +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_UNITY_BUILD=ON +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_UNITY_BUILD_BATCH_SIZE=16 +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DSWIG_COMPILE_FLAGS='/bigobj' +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DUSE_SPHINX=OFF + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% + +cd %BUILD_DIR% +mkdir cache +mkdir cache\pip + +echo ########################################################################## +echo openturns 1.21 +echo ########################################################################## +SET CMAKE_MODULE_OPTIONS=%CMAKE_OPTIONS% +CALL:MODULE_BUILDER openturns "%SOURCE_DIR%\openturns-1.21" "%BUILD_DIR%\openturns" "%PRODUCT_INSTALL%" "%CMAKE_MODULE_OPTIONS%" + +set PATH=%PRODUCT_INSTALL%\bin;%PRODUCT_INSTALL%\lib;%PATH% +set PYTHONPATH=%PRODUCT_INSTALL%\lib\site-packages;%PYTHONPATH% + +echo ########################################################################## +echo otagrum 0.8 [SKIPPED] +echo ########################################################################## +REM SET CMAKE_MODULE_OPTIONS=%CMAKE_OPTIONS% -DBUILD_DOC=OFF +REM CALL:MODULE_BUILDER otagrum "%SOURCE_DIR%\otagrum-0.8" "%BUILD_DIR%\otagrum" "%PRODUCT_INSTALL%" "%CMAKE_MODULE_OPTIONS%" + +echo ########################################################################## +echo otmorris 0.13 +echo ########################################################################## +SET CMAKE_MODULE_OPTIONS=%CMAKE_OPTIONS% +CALL:MODULE_BUILDER otmorris "%SOURCE_DIR%\otmorris-0.13" "%BUILD_DIR%\otmorris" "%PRODUCT_INSTALL%" "%CMAKE_MODULE_OPTIONS%" + +echo ########################################################################## +echo otfftw 0.13 +echo ########################################################################## +SET CMAKE_MODULE_OPTIONS=%CMAKE_OPTIONS% +CALL:MODULE_BUILDER otfftw "%SOURCE_DIR%\otfftw-0.13" "%BUILD_DIR%\otfftw" "%PRODUCT_INSTALL%" "%CMAKE_MODULE_OPTIONS%" + +echo ########################################################################## +echo otmixmod 0.14 [SKIPPED] +echo ########################################################################## +SET CMAKE_MODULE_OPTIONS=%CMAKE_OPTIONS% +REM CALL:MODULE_BUILDER otmixmod "%SOURCE_DIR%\otmixmod-0.14" "%BUILD_DIR%\otmixmod" "%PRODUCT_INSTALL%" "%CMAKE_MODULE_OPTIONS%" + +echo ########################################################################## +echo otrobopt 0.12 +echo ########################################################################## +SET CMAKE_MODULE_OPTIONS=%CMAKE_OPTIONS% -DBUILD_DOC=OFF +CALL:MODULE_BUILDER otrobopt "%SOURCE_DIR%\otrobopt-0.12" "%BUILD_DIR%\otrobopt" "%PRODUCT_INSTALL%" "%CMAKE_MODULE_OPTIONS%" + +echo ########################################################################## +echo otsubsetinverse 1.10 +echo ########################################################################## +SET CMAKE_MODULE_OPTIONS=%CMAKE_OPTIONS% -DBUILD_DOC=OFF +CALL:MODULE_BUILDER otsubsetinverse "%SOURCE_DIR%\otsubsetinverse-1.10" "%BUILD_DIR%\otsubsetinverse" "%PRODUCT_INSTALL%" "%CMAKE_MODULE_OPTIONS%" + +echo ########################################################################## +echo otsvm 0.11 +echo ########################################################################## +SET CMAKE_MODULE_OPTIONS=%CMAKE_OPTIONS% -DBUILD_DOC=OFF +CALL:MODULE_BUILDER otsvm "%SOURCE_DIR%\otsvm-0.11" "%BUILD_DIR%\otsvm" "%PRODUCT_INSTALL%" "%CMAKE_MODULE_OPTIONS%" + +echo ########################################################################## +echo otfmi 0.15 +echo ########################################################################## +cd %BUILD_DIR% +mkdir otfmi + +set CMAKE_OPTIONS_EXT=%CMAKE_OPTIONS% +cd %BUILD_DIR%\otfmi +xcopy %SOURCE_DIR%\otfmi-0.15\* %BUILD_DIR%\otfmi /E /I /Q +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on xcopy + exit 3 +) + +%PYTHON_ROOT_DIR%\python.exe setup.py install --prefix=%PRODUCT_INSTALL% +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on python setup.py + exit 3 +) + +echo +echo ########################################################################## +echo scikit-learn 0.24.2 +echo ########################################################################## +cd %BUILD_DIR% +mkdir scikit-learn +cd %BUILD_DIR%\scikit-learn +xcopy %SOURCE_DIR%\scikit-learn-0.24.2\* %BUILD_DIR%\scikit-learn /E /I /Q +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on xcopy + exit 3 +) + +%PYTHON_ROOT_DIR%\python.exe -m pip install --cache-dir=%BUILD_DIR%\cache\pip --prefix=%PRODUCT_INSTALL% scikit-learn-0.24.2.tar.gz --no-deps --no-use-pep517 +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on python setup.py + exit 3 +) + +echo +echo ########################################################################## +echo decorator 5.1.0 +echo ########################################################################## +cd %BUILD_DIR% +mkdir decorator +cd %BUILD_DIR%\decorator +xcopy %SOURCE_DIR%\decorator-5.1.0\* %BUILD_DIR%\decorator /E /I /Q +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on xcopy + exit 3 +) + +%PYTHON_ROOT_DIR%\python.exe -m pip install --cache-dir=%BUILD_DIR%\cache\pip --prefix=%PRODUCT_INSTALL% decorator-5.1.0-py3-none-any.whl --no-deps +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on python setup.py + exit 3 +) + +echo +echo ########################################################################## +echo threadpoolctl 3.0.0 +echo ########################################################################## +cd %BUILD_DIR% +mkdir threadpoolctl +cd %BUILD_DIR%\threadpoolctl +xcopy %SOURCE_DIR%\threadpoolctl-3.0.0\* %BUILD_DIR%\threadpoolctl /E /I /Q +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on xcopy + exit 3 +) + +%PYTHON_ROOT_DIR%\python.exe -m pip install --cache-dir=%BUILD_DIR%\cache\pip --prefix=%PRODUCT_INSTALL% threadpoolctl-3.0.0-py3-none-any.whl --no-deps +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on python setup.py + exit 3 +) + +echo +echo ########################################################################## +echo joblib 1.1.0 +echo ########################################################################## +cd %BUILD_DIR% +mkdir joblib +cd %BUILD_DIR%\joblib +xcopy %SOURCE_DIR%\joblib-1.1.0\* %BUILD_DIR%\joblib /E /I /Q +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on xcopy + exit 3 +) + +%PYTHON_ROOT_DIR%\python.exe -m pip install --cache-dir=%BUILD_DIR%\cache\pip --prefix=%PRODUCT_INSTALL% joblib-1.1.0-py2.py3-none-any.whl --no-deps +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on python setup.py + exit 3 +) + +echo ########################################################################## +echo otpod 0.6.10 +echo ########################################################################## +cd %BUILD_DIR% +mkdir otpod + +set CMAKE_OPTIONS_EXT=%CMAKE_OPTIONS% +cd %BUILD_DIR%\otpod +xcopy %SOURCE_DIR%\otpod-0.6.9\* %BUILD_DIR%\otpod /E /I /Q +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on xcopy + exit 3 +) + +%PYTHON_ROOT_DIR%\python.exe setup.py install --prefix=%PRODUCT_INSTALL% +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on python setup.py + exit 3 +) + +echo ########################################################################## +echo otwrapy 0.11 +echo ########################################################################## +cd %BUILD_DIR% +mkdir otwrapy + +set CMAKE_OPTIONS_EXT=%CMAKE_OPTIONS% +cd %BUILD_DIR%\otwrapy +xcopy %SOURCE_DIR%\otwrapy-0.11\* %BUILD_DIR%\otwrapy /E /I /Q +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on xcopy + exit 3 +) + +%PYTHON_ROOT_DIR%\python.exe setup.py install --prefix=%PRODUCT_INSTALL% +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on python setup.py + exit 3 +) + +echo +echo "########## END" diff --git a/products/compil_scripts/openturns-1.21.sh b/products/compil_scripts/openturns-1.21.sh new file mode 100644 index 0000000..3418288 --- /dev/null +++ b/products/compil_scripts/openturns-1.21.sh @@ -0,0 +1,440 @@ +#!/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 +export PATH=$(pwd)/bin:$PATH +export PYTHONPATH=$(pwd):$PYTHONPATH +export PYTHONPATH=${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH + +CMAKE_OPTIONS="" +if [ -n "$SAT_HPC" ] && [ -n "$MPI_ROOT_DIR" ]; then + echo "WARNING: setting CC and CXX environment variables and target MPI wrapper" + CMAKE_OPTIONS+=" -DCMAKE_CXX_COMPILER:STRING=${MPI_CXX_COMPILER}" + CMAKE_OPTIONS+=" -DCMAKE_C_COMPILER:STRING=${MPI_C_COMPILER}" +fi + +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_PREFIX:STRING=${PRODUCT_INSTALL}" +CMAKE_OPTIONS+=" -DCMAKE_INSTALL_LIBDIR:STRING=lib" +CMAKE_OPTIONS+=" -DCMAKE_BUILD_TYPE:STRING=Release" +CMAKE_OPTIONS+=" -DPYTHON_EXECUTABLE=${PYTHONBIN}" + +if [ -n "$SWIG_ROOT_DIR" ] && [ "$SAT_swig_IS_NATIVE" != "1" ]; then + CMAKE_OPTIONS+=" -DSWIG_EXECUTABLE=${SWIG_ROOT_DIR}/bin/swig" +fi + +if [ -n "$TBB_ROOT_DIR" ] && [ "$SAT_tbb_IS_NATIVE" != "1" ]; then + CMAKE_OPTIONS+=" -DTBB_ROOT_DIR=${TBB_ROOT_DIR}" + CMAKE_OPTIONS+=" -Dtbb_DIR=${TBB_ROOT_DIR}/lib/cmake" +fi + +# https://github.com/persalys/persalys/issues/745 +LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION" +case $LINUX_DISTRIBUTION in + UB22*|CO8*|CO9*|FD36|FD37|FD38) + echo "WARNING: switching OFF TBB support" + CMAKE_OPTIONS+=" -DUSE_TBB=OFF" + ;; + *) + ;; +esac + +# Blas/Lapack +if [ -n "$LAPACK_ROOT_DIR" ] && [ "$SAT_lapack_IS_NATIVE" != "1" ]; 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" + CMAKE_OPTIONS+=" -DBLAS_LIBRARIES=$LAPACK_ROOT_DIR/lib/libblas.so" +fi + +### libxml2 settings +if [ -n "$LIBXML2_ROOT_DIR" ] && [ "$SAT_libxml2_IS_NATIVE" != "1" ]; then + CMAKE_OPTIONS+=" -DLIBXML2_INCLUDE_DIR:STRING=${LIBXML2_ROOT_DIR}/include/libxml2" + CMAKE_OPTIONS+=" -DLIBXML2_LIBRARIES:STRING=${LIBXML2_ROOT_DIR}/lib/libxml2.so" + CMAKE_OPTIONS+=" -DLIBXML2_XMLLINT_EXECUTABLE=${LIBXML2_ROOT_DIR}/bin/xmllint" +fi + +# HDF5 +if [ -n "$HDF5_ROOT_DIR" ] && [ "$SAT_hdf5_IS_NATIVE" != "1" ]; then + CMAKE_OPTIONS+=" -DHDF5_DIR:PATH=${HDF5_ROOT_DIR}/share/cmake/hdf5" + CMAKE_OPTIONS+=" -DHDF5_USE_STATIC_LIBRARIES:BOOL=OFF" + CMAKE_OPTIONS+=" -DHDF5_ROOT:PATH=${HDF5_ROOT_DIR}" + 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" +fi + +# CMINPACK +if [ -n "$CMINPACK_ROOT_DIR" ] && [ "$SAT_cminpack_IS_NATIVE" != "1" ]; 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 +if [ -n "$LAPACK_ROOT_DIR" ] && [ "$SAT_lapack_IS_NATIVE" != "1" ]; 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" + CMAKE_OPTIONS+=" -DBLAS_LIBRARIES=$LAPACK_ROOT_DIR/lib/libblas.so" +fi + +if [[ $DIST_NAME == "CO" && $DIST_VERSION == "8" && -f /usr/lib64/libcblas.so && -f /usr/lib64/libblas.so ]]; then + CMAKE_OPTIONS+=" -DCBLAS_LIBRARIES=/usr/lib64/libcblas.so" + CMAKE_OPTIONS+=" -DBLAS_LIBRARIES=/usr/lib64/libblas.so" +fi + +### libxml2 settings +if [ -n "$LIBXML2_ROOT_DIR" ] && [ "$SAT_libxml2_IS_NATIVE" != "1" ]; then + CMAKE_OPTIONS+=" -DLIBXML2_INCLUDE_DIR:STRING=${LIBXML2_ROOT_DIR}/include/libxml2" + CMAKE_OPTIONS+=" -DLIBXML2_LIBRARIES:STRING=${LIBXML2_ROOT_DIR}/lib/libxml2.so" + CMAKE_OPTIONS+=" -DLIBXML2_XMLLINT_EXECUTABLE=${LIBXML2_ROOT_DIR}/bin/xmllint" +fi + +## nlopt +if [ -n "$NLOPT_ROOT_DIR" ] && [ "$SAT_nlopt_IS_NATIVE" != "1" ]; then + CMAKE_OPTIONS+=" -DNLOPT_INCLUDE_DIRS:STRING=${NLOPT_ROOT_DIR}/include" + CMAKE_OPTIONS+=" -DNLOPT_LIBRARIES:STRING=${NLOPT_ROOT_DIR}/lib" + CMAKE_OPTIONS+=" -DNLOPT_DIR:STRING=${NLOPT_ROOT_DIR}" +fi + +echo +echo "*** cmake" $CMAKE_OPTIONS + +rm -rf $BUILD_DIR +mkdir -p $BUILD_DIR/openturns +mkdir -p $BUILD_DIR/cache/pip + +# since we are using several nodes and share the same $HOME +# compilation can get screwed up. +# following this discussion: https://tex.stackexchange.com/questions/467824/is-it-possible-to-relocate-my-texmf-directory +# we define the following environment variables +export TEXMFHOME=$BUILD_DIR/texmf +export TEXMFVAR=$BUILD_DIR/texlive +export TEXMFCONFIG=$BUILD_DIR/texlive +mkdir -p $TEXMFHOME +mkdir -p $TEXMFVAR +mkdir -p $TEXMFCONFIG + +cd $BUILD_DIR/openturns +cmake $CMAKE_OPTIONS $SOURCE_DIR/openturns-1.21 +if [ $? -ne 0 ] +then + echo "ERROR on cmake" + exit 1 +fi + +echo +echo "*** make" $MAKE_OPTIONS +make $MAKE_OPTIONS +if [ $? -ne 0 ] +then + echo "ERROR on make" + exit 2 +fi + +echo +echo "*** make install" +make install +if [ $? -ne 0 ] +then + echo "ERROR on make install" + exit 3 +fi + +echo +echo "*** check installation" +if [ ! -d "${PRODUCT_INSTALL}/lib" ]; then + mkdir -p ${PRODUCT_INSTALL}/lib +fi + +if [ -d "${PRODUCT_INSTALL}/lib64" ]; then + echo "WARNING: moving lib64 to lib" + mv ${PRODUCT_INSTALL}/lib64/* ${PRODUCT_INSTALL}/lib/ + rm -rf ${PRODUCT_INSTALL}/lib64 +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 + +if [[ -d "${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/dist-packages" ]]; then + echo "WARNING: renaming ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/dist-packages as ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages" + cd ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION} + ln -sf dist-packages site-packages + cd $BUILD_DIR/openturns +fi + +export PYTHONPATH=${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages:${PYTHONPATH} +export LD_LIBRARY_PATH=${PRODUCT_INSTALL}/lib:${LD_LIBRARY_PATH} +chmod +x ${SOURCE_DIR}/openturns-1.21/python/test/t_features.py +${PYTHONBIN} ${SOURCE_DIR}/openturns-1.21/python/test/t_features.py +if [ $? -ne 0 ] +then + echo "ERROR testing Openturns features...." + exit 4 +fi + +LD_LIBRARY_PATH_REF=${LD_LIBRARY_PATH} +if [[ -d "$SOURCE_DIR/otfftw-0.13" ]]; then + declare -A OTC + OTC["otagrum"]="0.8" + OTC["otfftw"]="0.13" + OTC["otmixmod"]="0.14" + OTC["otmorris"]="0.13" + OTC["otrobopt"]="0.12" + OTC["otsubsetinverse"]="1.10" + OTC["otsvm"]="0.11" + + for k in ${!OTC[@]}; + do + echo + echo "*** C O M P O N E N T : $k-${OTC[$k]} " + if [[ $k == "otagrum" ]]; then + echo "WARNING: skipping $k.." + continue + fi + cd $BUILD_DIR + mkdir ${BUILD_DIR}/$k + cd ${BUILD_DIR}/$k + CMAKE_EXTRA_OPTIONS= + if [[ $DIST_NAME == "CO" ]]; then + CMAKE_EXTRA_OPTIONS+=" -DBUILD_DOC=OFF" # needs extra latex modules on CentOS 7, 8 + CMAKE_EXTRA_OPTIONS+=" -DUSE_SPHINX=OFF" + fi + if [[ $k == "otmixmod" ]]; then + CMAKE_EXTRA_OPTIONS+=" -DBUILD_DOC=OFF" + CMAKE_EXTRA_OPTIONS+=" -DSOURCEFILES=$SOURCE_DIR/$k-${OTC[$k]}" + elif [[ $k == "otsubsetinverse" ]]; then + CMAKE_EXTRA_OPTIONS+=" -DOPENTURNS_HOME=$PRODUCT_INSTALL" + CMAKE_EXTRA_OPTIONS+=" -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON" + CMAKE_EXTRA_OPTIONS+=" -DUSE_SPHINX=OFF" + elif [[ $k == "otfftw" ]]; then + CMAKE_EXTRA_OPTIONS+=" -DBUILD_DOC=OFF" + elif [[ $k == "otmorris" ]]; then + case $LINUX_DISTRIBUTION in + DB*|FD*|UB*) + echo "WARNING: switching OFF documentation build" + CMAKE_EXTRA_OPTIONS+=" -DBUILD_DOC=OFF" + CMAKE_EXTRA_OPTIONS+=" -DUSE_SPHINX=OFF" # missing package to be installed. + ;; + esac + elif [[ $k == "otrobopt" ]]; then + case $LINUX_DISTRIBUTION in + DB*|FD*|UB*) + echo "WARNING: switching OFF documentation build" + CMAKE_EXTRA_OPTIONS+=" -DBUILD_DOC=OFF" + CMAKE_EXTRA_OPTIONS+=" -DUSE_SPHINX=OFF" # missing package to be installed. + ;; + esac + elif [[ $k == "otsvm" ]]; then + case $LINUX_DISTRIBUTION in + DB*|FD*|UB*) + echo "WARNING: switching OFF documentation build" + CMAKE_EXTRA_OPTIONS+=" -DBUILD_DOC=OFF" + CMAKE_EXTRA_OPTIONS+=" -DUSE_SPHINX=OFF" # missing package to be installed. + ;; + esac + elif [[ $k == "otpmml" ]]; then + CMAKE_EXTRA_OPTIONS+=" -DBUILD_DOC=OFF" + fi + + echo + echo "*** cmake " $CMAKE_OPTIONS ${CMAKE_EXTRA_OPTIONS} $SOURCE_DIR/$k-${OTC[$k]} + cmake $CMAKE_OPTIONS ${CMAKE_EXTRA_OPTIONS} $SOURCE_DIR/$k-${OTC[$k]} + if [ $? -ne 0 ] + then + echo "ERROR on cmake" + exit 1 + fi + + echo + echo "*** make" $MAKE_OPTIONS + make $MAKE_OPTIONS + if [ $? -ne 0 ] + then + echo "ERROR on make" + exit 2 + fi + + echo + echo "*** make install" + make install + if [ $? -ne 0 ] + then + echo "ERROR on make install" + exit 3 + fi + done + + declare -A OTP + OTP["otfmi"]="0.15" + OTP["otpod"]="0.6.10" + OTP["otwrapy"]="0.11" + for k in ${!OTP[@]}; + do + echo + echo "*** C O M P O N E N T : $k-${OTP[$k]} " + + if [ "$SAT_Python_IS_NATIVE" == "1" ]; then + if [ $k == "otfmi" ]; then + echo "INFO: install dill-0.3.4" + ${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip $SOURCE_DIR/dill-0.3.4/dill-0.3.4-py2.py3-none-any.whl --no-deps --prefix=$PRODUCT_INSTALL + if [ $? -ne 0 ] + then + echo "FATAL: could not install dill-0.3.4" + exit 6 + fi + elif [ $k == "otpod" ]; then + if [[ $DIST_NAME == "CO" && $DIST_VERSION == "8" ]]; then + echo "*** skipping: since system Cython too old" + continue + fi + echo "INFO: install scikit-learn-0.24.2" + # use --no-build-isolation and --no-use-pep517 flags + ${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip $SOURCE_DIR/scikit-learn-0.24.2/scikit-learn-0.24.2.tar.gz --no-deps --prefix=$PRODUCT_INSTALL --no-build-isolation --no-use-pep517 + if [ $? -ne 0 ] + then + echo "FATAL: could not install scikit-0.24.2" + exit 6 + fi + echo "INFO: install threadpoolctl-3.0.0" + ${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 + echo "FATAL: could not install threadpoolctl 3.0.0" + exit 6 + fi + fi + else # non native Python + if [[ $k == "otfmi" ]]; then + echo "INFO: install dill-0.3.4" + ${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip $SOURCE_DIR/dill-0.3.4/dill-0.3.4-py2.py3-none-any.whl --no-deps + if [ $? -ne 0 ] + then + echo "FATAL: could not install dikk-0.3.4" + exit 5 + fi + elif [[ $k == "otpod" ]]; then + echo "INFO: install threadpoolctl-3.0.0" + ${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 + if [ $? -ne 0 ] + then + echo "FATAL: could not install readpoolctl 3.0.0" + exit 6 + fi + echo "INFO: install joblib-1.1.0" + ${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 + fi + echo "INFO: install decorator-5.1.0" + ${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip $SOURCE_DIR/decorator-5.1.0/decorator-5.1.0-py3-none-any.whl --no-deps + if [ $? -ne 0 ] + then + echo "FATAL: could not install decorator-5.1.0" + exit 6 + fi + echo "INFO: install scikit-learn-0.24.2" + ${PYTHONBIN} -m pip install --cache-dir=$BUILD_DIR/cache/pip $SOURCE_DIR/scikit-learn-0.24.2/scikit-learn-0.24.2.tar.gz --no-deps + if [ $? -ne 0 ] + then + echo "FATAL: could not install scikit-0.24.2" + exit 6 + fi + fi + fi + + cd $BUILD_DIR + mkdir ${BUILD_DIR}/$k + cd ${BUILD_DIR}/$k + cp -R $SOURCE_DIR/$k-${OTP[$k]}/* . + # + $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 + done + + # + # O P E N T U R N S + # + if [ -f ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages/site.py ]; then + echo "INFO: site.py already installed" + elif [ "$SAT_Python_IS_NATIVE" == "1" ]; then + # check first whether the init.py file is installed + echo "WARNING: missing init.py file. Installing it from system Python installation" + SITE_PATCH= + LINUX_DISTRIBUTION="$DIST_NAME$DIST_VERSION" + case $LINUX_DISTRIBUTION in + DB11) + SITE_PATCH=/usr/lib/pypy/dist-packages/setuptools/site-patch.py + ;; + DB10) + SITE_PATCH=/usr/lib/python3/dist-packages/setuptools/site-patch.py + ;; + UB22*) + SITE_PATCH=/usr/lib/pypy/dist-packages/setuptools/site-patch.py + ;; + UB20*) + SITE_PATCH=/usr/lib/python3/dist-packages/setuptools/site-patch.py + ;; + FD32) + SITE_PATCH=/usr/lib/python3.8/site-packages/setuptools/site-patch.py + ;; + FD34) + SITE_PATCH=$SOURCE_DIR/addons/site-patch.py + ;; + FD36) + SITE_PATCH=$SOURCE_DIR/addons/site-patch.py + ;; + FD37) + SITE_PATCH=$SOURCE_DIR/addons/site-patch.py + ;; + FD38) + SITE_PATCH=$SOURCE_DIR/addons/site-patch.py + ;; + CO8*) + SITE_PATCH=/usr/lib/pypy/dist-packages/setuptools/site-patch.py + ;; + *) + SITE_PATCH=$SOURCE_DIR/addons/site-patch.py + ;; + esac + # check whether this file exists + if [ "${SITE_PATCH}" == "" ]; then + cp $SOURCE_DIR/addons/site-patch.py ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages/site.py + else + cp $SITE_PATCH ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages/site.py + fi + elif [ -f ${PYTHON_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/setuptools/site-patch.py ]; then + cp ${PYTHON_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/setuptools/site-patch.py ${PRODUCT_INSTALL}/lib/python${PYTHON_VERSION}/site-packages/site.py + else + echo "ERROR: could not find site-patch.py" + exit 7 + fi +fi + +cd ${PRODUCT_INSTALL}/lib + +echo +echo "########## END" diff --git a/products/openturns.pyconf b/products/openturns.pyconf index d529513..b263b8e 100644 --- a/products/openturns.pyconf +++ b/products/openturns.pyconf @@ -36,6 +36,30 @@ default_win : opt_depend : [] } +version_1_21 : +{ + compil_script : "openturns-1.21.sh" + patches : [] + depend : ['Python', 'lapack', 'hdf5', 'tbb', 'nlopt', 'libxml2', 'eigen', 'matplotlib', 'cminpack', 'FMILibrary', 'PyFMI'] + opt_depend : ['pandas', 'statsmodels', 'patsy'] +} + +version_1_21_win : +{ + name : "OT" + compil_script : "openturns-1.21.bat" + source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + 'openturns' + build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name + depend : ['Python', 'openblas', 'hdf5', 'tbb', 'nlopt', 'libxml2', 'eigen', 'matplotlib', 'fftw'] + opt_depend : ['pandas', 'statsmodels', 'patsy'] + patches : [] + properties : + { + single_install_dir : "no" + incremental : "yes" + } +} + version_1_20_1 : { compil_script : "openturns-1.20.1" + $VARS.scriptExtension @@ -148,7 +172,7 @@ version_1_20_1_FD32 : opt_depend : ['pandas', 'statsmodels'] } - version_1_19 : +version_1_19 : { compil_script : "openturns-1.19" + $VARS.scriptExtension patches : ['openturns-1.19.0001.patch'] -- 2.39.2