From 49b91cdd3cdaba2b84f434df9443757defcf032f Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Tue, 1 Jun 2021 15:00:10 +0200 Subject: [PATCH] version MPI: besoin de HDF CXX pour Openturns --- products/compil_scripts/hdf5-1.10.3.sh | 2 +- products/compil_scripts/openturns.sh | 7 + products/nlopt.pyconf | 2 +- products/openturns.pyconf | 4 +- products/patches/openturns-1.16.0001.patch | 177 +++++++++++---------- 5 files changed, 105 insertions(+), 87 deletions(-) diff --git a/products/compil_scripts/hdf5-1.10.3.sh b/products/compil_scripts/hdf5-1.10.3.sh index c59b335..34e9482 100755 --- a/products/compil_scripts/hdf5-1.10.3.sh +++ b/products/compil_scripts/hdf5-1.10.3.sh @@ -20,7 +20,7 @@ CMAKE_OPTIONS=$CMAKE_OPTIONS" -DHDF5_BUILD_HL_LIB:BOOL=ON" if [ -n "$SAT_HPC" ] then CMAKE_OPTIONS=$CMAKE_OPTIONS" -DHDF5_ENABLE_PARALLEL:BOOL=ON" - CMAKE_OPTIONS=$CMAKE_OPTIONS" -DHDF5_BUILD_CPP_LIB:BOOL=OFF" + CMAKE_OPTIONS=$CMAKE_OPTIONS" -DHDF5_BUILD_CPP_LIB:BOOL=ON" CMAKE_OPTIONS=$CMAKE_OPTIONS" -DHDF5_BUILD_TOOLS:BOOL=ON" else CMAKE_OPTIONS=$CMAKE_OPTIONS" -DHDF5_ENABLE_PARALLEL:BOOL=OFF" diff --git a/products/compil_scripts/openturns.sh b/products/compil_scripts/openturns.sh index a64040a..e4551d2 100755 --- a/products/compil_scripts/openturns.sh +++ b/products/compil_scripts/openturns.sh @@ -4,6 +4,13 @@ echo "########################################################################## echo "openturns" $VERSION echo "##########################################################################" +if [ -n "$MPI_ROOT_DIR" ] +then + echo "WARNING: setting CC and CXX environment variables and target MPI wrapper" + export CC=${MPI_ROOT_DIR}/bin/mpicc + export CXX=${MPI_ROOT_DIR}/bin/mpicxx +fi + CMAKE_OPTIONS="" CMAKE_OPTIONS=$CMAKE_OPTIONS" -DCMAKE_INSTALL_PREFIX:STRING=${PRODUCT_INSTALL}" CMAKE_OPTIONS=$CMAKE_OPTIONS" -DCMAKE_BUILD_TYPE:STRING=Release" diff --git a/products/nlopt.pyconf b/products/nlopt.pyconf index 0061808..11fcd35 100644 --- a/products/nlopt.pyconf +++ b/products/nlopt.pyconf @@ -34,7 +34,7 @@ default_win: version_2_5_0: { build_source : "cmake" - cmake_options : "-DBUILD_SHARED_LIBS:BOOL=ON -DNLOPT_MATLAB:BOOL=OFF -DNLOPT_OCTAVE:BOOL=OFF -DNLOPT_GUILE:BOOL=OFF -DSWIG_EXECUTABLE=${SWIG_ROOT_DIR}/bin/swig" + cmake_options : "-DBUILD_SHARED_LIBS:BOOL=ON -DNLOPT_MATLAB:BOOL=OFF -DNLOPT_OCTAVE:BOOL=OFF -DNLOPT_GUILE:BOOL=OFF -DSWIG_EXECUTABLE=${SWIG_ROOT_DIR}/bin/swig -DCMAKE_INSTALL_LIBDIR:STRING=lib" } version_2_5_0_win: diff --git a/products/openturns.pyconf b/products/openturns.pyconf index 5721d7e..d9db64f 100644 --- a/products/openturns.pyconf +++ b/products/openturns.pyconf @@ -8,8 +8,9 @@ default : { env_script : $name + ".py" } - depend : ['Python', 'lapack', 'hdf5', 'tbb', 'nlopt', 'libxml2', 'eigen'] + depend : ['Python', 'lapack', 'hdf5', 'tbb', 'nlopt', 'libxml2', 'eigen', 'matplotlib'] build_depend : ["cmake", "swig"] + opt_depend : ['openmpi'] patches : [] source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name build_dir : $APPLICATION.workdir + $VARS.sep + 'BUILD' + $VARS.sep + $name @@ -31,6 +32,7 @@ default_win : pip : "yes" } depend : ['Python', 'lapack', 'hdf5', 'tbb', 'nlopt', 'libxml2', 'eigen', 'pthreads'] + opt_depend : [] } version_1_16 : diff --git a/products/patches/openturns-1.16.0001.patch b/products/patches/openturns-1.16.0001.patch index ec48c37..adfba8f 100644 --- a/products/patches/openturns-1.16.0001.patch +++ b/products/patches/openturns-1.16.0001.patch @@ -1,7 +1,62 @@ -diff -pruN openturns_ref/CMakeLists.txt openturns_dev/CMakeLists.txt ---- openturns_ref/CMakeLists.txt 2021-02-19 15:46:57.077060192 +0100 -+++ openturns_dev/CMakeLists.txt 2021-02-19 15:46:46.576956703 +0100 -@@ -125,6 +125,10 @@ set (OPENTURNS_TEMPDIR +diff -Naur openturns_ref openturns_new +diff -Naur openturns_ref/cmake/FindNLopt.cmake openturns_new/cmake/FindNLopt.cmake +--- openturns_ref/cmake/FindNLopt.cmake 2020-11-09 14:06:44.000000000 +0100 ++++ openturns_new/cmake/FindNLopt.cmake 2021-06-01 10:23:26.144409150 +0200 +@@ -11,10 +11,21 @@ + # NLOPT_ROOT_DIR - root dir (ex. /usr/local) + + # set NLOPT_INCLUDE_DIR ++SET(NLOPT_ROOT_DIR $ENV{NLOPT_ROOT_DIR}) ++ ++IF(NLOPT_ROOT_DIR) ++ LIST(APPEND CMAKE_PREFIX_PATH "${NLOPT_ROOT_DIR}") ++ LIST(APPEND CMAKE_PREFIX_PATH "${NLOPT_ROOT_DIR}/include") ++ LIST(APPEND CMAKE_PREFIX_PATH "${NLOPT_ROOT_DIR}/lib") ++ELSE(NLOPT_ROOT_DIR) ++ MESSAGE(FATAL_ERROR "PLEASE SET ENVIRONMENT VARIABLE NLOPT_ROOT_DIR") ++ENDIF(NLOPT_ROOT_DIR) ++ + find_path (NLOPT_INCLUDE_DIR + NAMES nlopt.hpp ++ HINTS ${NLOPT_ROOT_DIR}/include + DOC +- "Nlopt include directory" ++ "Nlopt include directory" + ) + + # set NLOPT_INCLUDE_DIRS +@@ -22,9 +33,10 @@ + + # set NLOPT_LIBRARY + find_library (NLOPT_LIBRARY +- NAMES nlopt_cxx nlopt ++ NAMES nlopt ++ HINTS ${NLOPT_ROOT_DIR}/lib + DOC +- "Nlopt library location" ++ "Nlopt library location" + ) + + # set NLOPT_LIBRARIES +diff -Naur openturns_ref/cmake/FindTBB.cmake openturns_new/cmake/FindTBB.cmake +--- openturns_ref/cmake/FindTBB.cmake 2020-11-10 13:21:21.000000000 +0100 ++++ openturns_new/cmake/FindTBB.cmake 2021-06-01 10:23:26.144409150 +0200 +@@ -27,6 +27,11 @@ + # (To distributed this file outside of CMake, substitute the full + # License text for the above reference.) + ++SET(TBB_ROOT_DIR $ENV{TBB_ROOT_DIR}) ++IF(TBB_ROOT_DIR) ++ LIST(APPEND CMAKE_PREFIX_PATH "${TBB_ROOT_DIR}") ++ENDIF(TBB_ROOT_DIR) ++ + find_path (TBB_INCLUDE_DIR NAMES tbb/tbb.h DOC "TBB include directory") + + set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR}) +diff -Naur openturns_ref/CMakeLists.txt openturns_new/CMakeLists.txt +--- openturns_ref/CMakeLists.txt 2020-11-18 16:33:36.000000000 +0100 ++++ openturns_new/CMakeLists.txt 2021-06-01 10:26:34.647699757 +0200 +@@ -125,6 +125,10 @@ set (TEMPDIR ${OPENTURNS_TEMPDIR}) set (CMAKE_CXX_STANDARD 11) @@ -12,7 +67,7 @@ diff -pruN openturns_ref/CMakeLists.txt openturns_dev/CMakeLists.txt if (NOT DEFINED LAPACK_LIBRARIES) find_package (LAPACK REQUIRED) -@@ -156,7 +160,11 @@ if (USE_FLEX) +@@ -156,7 +160,11 @@ endif () endif () @@ -25,7 +80,7 @@ diff -pruN openturns_ref/CMakeLists.txt openturns_dev/CMakeLists.txt find_package (TBB) endif () if (TBB_FOUND) -@@ -200,6 +208,10 @@ if (USE_DOXYGEN) +@@ -200,6 +208,10 @@ endif () if (USE_LIBXML2) @@ -36,16 +91,28 @@ diff -pruN openturns_ref/CMakeLists.txt openturns_dev/CMakeLists.txt find_package (LibXml2) endif () if (LIBXML2_FOUND) -@@ -210,7 +222,7 @@ if (LIBXML2_FOUND) +@@ -210,15 +222,25 @@ endif () if (USE_HDF5) - find_package(HDF5 COMPONENTS CXX) +-endif () ++ SET(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR} CACHE PATH "Path to the HDF5.") ++ IF(HDF5_ROOT_DIR) ++ LIST(APPEND CMAKE_PREFIX_PATH "${HDF5_ROOT_DIR}") ++ ENDIF(HDF5_ROOT_DIR) + find_package(HDF5 COMPONENTS CXX HL) - endif () ++endif () ++SET(MPI_ROOT_DIR $ENV{MPI_ROOT_DIR} CACHE PATH "Path to the MPI.") ++IF(MPI_ROOT_DIR) ++ LIST(APPEND CMAKE_PREFIX_PATH "${MPI_ROOT_DIR}") ++ find_package(MPI) ++ list (APPEND OPENTURNS_PRIVATE_INCLUDE_DIRS ${MPI_INCLUDE_DIRS}) ++ list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${MPI_LIBRARIES}) ++ENDIF(MPI_ROOT_DIR) if (HDF5_FOUND) set (OPENTURNS_HAVE_HDF5 TRUE) -@@ -218,7 +230,6 @@ if (HDF5_FOUND) + list (APPEND OPENTURNS_DEFINITIONS ${HDF5_DEFINITIONS}) list (APPEND OPENTURNS_PRIVATE_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS}) list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${HDF5_LIBRARIES}) endif () @@ -53,7 +120,7 @@ diff -pruN openturns_ref/CMakeLists.txt openturns_dev/CMakeLists.txt if (MSVC OR WINTEL) set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/lib/include/pthread_win32 ${CMAKE_CURRENT_SOURCE_DIR}/lib/include) include_directories (${PROJECT_SOURCE_DIR}/lib/include/pthread_win32 ${CMAKE_CURRENT_SOURCE_DIR}/lib/include) -@@ -257,7 +268,7 @@ if (NOT R_EXECUTABLE) +@@ -257,7 +279,7 @@ endif () if (USE_NLOPT) @@ -62,67 +129,21 @@ diff -pruN openturns_ref/CMakeLists.txt openturns_dev/CMakeLists.txt if (NLopt_FOUND) message(STATUS "Found NLopt: ${NLopt_DIR}") else () - -diff -pruN openturns_ref/cmake/FindTBB.cmake openturns_dev/cmake/FindTBB.cmake ---- openturns_ref/cmake/FindTBB.cmake 2021-02-19 15:46:57.058060005 +0100 -+++ openturns_dev/cmake/FindTBB.cmake 2021-02-19 15:51:59.654083375 +0100 -@@ -27,6 +27,11 @@ - # (To distributed this file outside of CMake, substitute the full - # License text for the above reference.) - -+SET(TBB_ROOT_DIR $ENV{TBB_ROOT_DIR}) -+IF(TBB_ROOT_DIR) -+ LIST(APPEND CMAKE_PREFIX_PATH "${TBB_ROOT_DIR}") -+ENDIF(TBB_ROOT_DIR) -+ - find_path (TBB_INCLUDE_DIR NAMES tbb/tbb.h DOC "TBB include directory") - - set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR}) - -diff -pruN openturns_ref/cmake/FindNLopt.cmake openturns_dev/cmake/FindNLopt.cmake ---- openturns_ref/cmake/FindNLopt.cmake 2021-02-19 15:46:57.064060064 +0100 -+++ openturns_dev/cmake/FindNLopt.cmake 2021-02-19 15:53:27.134956381 +0100 -@@ -11,10 +11,21 @@ - # NLOPT_ROOT_DIR - root dir (ex. /usr/local) - - # set NLOPT_INCLUDE_DIR -+SET(NLOPT_ROOT_DIR $ENV{NLOPT_ROOT_DIR}) -+ -+IF(NLOPT_ROOT_DIR) -+ LIST(APPEND CMAKE_PREFIX_PATH "${NLOPT_ROOT_DIR}") -+ LIST(APPEND CMAKE_PREFIX_PATH "${NLOPT_ROOT_DIR}/include") -+ LIST(APPEND CMAKE_PREFIX_PATH "${NLOPT_ROOT_DIR}/lib") -+ELSE(NLOPT_ROOT_DIR) -+ MESSAGE(FATAL_ERROR "PLEASE SET ENVIRONMENT VARIABLE NLOPT_ROOT_DIR") -+ENDIF(NLOPT_ROOT_DIR) -+ - find_path (NLOPT_INCLUDE_DIR - NAMES nlopt.hpp -+ HINTS ${NLOPT_ROOT_DIR}/include - DOC -- "Nlopt include directory" -+ "Nlopt include directory" - ) - - # set NLOPT_INCLUDE_DIRS -@@ -22,9 +33,10 @@ set (NLOPT_INCLUDE_DIRS ${NLOPT_INCLUDE_ - - # set NLOPT_LIBRARY - find_library (NLOPT_LIBRARY -- NAMES nlopt_cxx nlopt -+ NAMES nlopt -+ HINTS ${NLOPT_ROOT_DIR}/lib - DOC -- "Nlopt library location" -+ "Nlopt library location" - ) - - # set NLOPT_LIBRARIES - -diff -pruN openturns_ref/lib/src/CMakeLists.txt openturns_dev/lib/src/CMakeLists.txt ---- openturns_ref/lib/src/CMakeLists.txt 2021-02-19 15:46:49.880989268 +0100 -+++ openturns_dev/lib/src/CMakeLists.txt 2021-02-19 16:12:54.874714974 +0100 -@@ -80,15 +80,15 @@ if (BISON_FOUND AND FLEX_FOUND) +diff -Naur openturns_ref/lib/src/Base/Common/openturns/TBB.hxx openturns_new/lib/src/Base/Common/openturns/TBB.hxx +--- openturns_ref/lib/src/Base/Common/openturns/TBB.hxx 2020-11-10 13:21:21.000000000 +0100 ++++ openturns_new/lib/src/Base/Common/openturns/TBB.hxx 2021-06-01 10:23:26.145409141 +0200 +@@ -35,6 +35,7 @@ + # define __TBBMALLOC_NO_IMPLICIT_LINKAGE 1 + # endif + #endif ++#define TBB_PREVIEW_TASK_ARENA 1 + #include + #include + #include +diff -Naur openturns_ref/lib/src/CMakeLists.txt openturns_new/lib/src/CMakeLists.txt +--- openturns_ref/lib/src/CMakeLists.txt 2020-11-10 13:21:21.000000000 +0100 ++++ openturns_new/lib/src/CMakeLists.txt 2021-06-01 10:23:26.144409150 +0200 +@@ -80,15 +80,15 @@ add_dependencies (OT generate_csv_parser) endif () @@ -141,22 +162,10 @@ diff -pruN openturns_ref/lib/src/CMakeLists.txt openturns_dev/lib/src/CMakeLists set_target_properties (linktest PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${CMAKE_BINARY_DIR}/lib/src") -@@ -109,5 +109,5 @@ install (TARGETS OT +@@ -109,5 +109,5 @@ if (UNIX AND BUILD_SHARED_LIBS) set (OT_GDB_PY ${CMAKE_SHARED_LIBRARY_PREFIX}OT${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIB_VERSION}-gdb.py) execute_process (COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/libOT-gdb.py ${CMAKE_CURRENT_BINARY_DIR}/${OT_GDB_PY}) - install (FILES libOT-gdb.py DESTINATION ${OPENTURNS_DATA_PATH}/gdb/auto-load/${LIBRARY_PATH} RENAME ${OT_GDB_PY}) + install (FILES libOT-gdb.py DESTINATION ${OPENTURNS_DATA_PATH}/gdb/auto-load RENAME ${OT_GDB_PY}) endif () - -diff -pruN openturns_ref/lib/src/Base/Common/openturns/TBB.hxx openturns_dev/lib/src/Base/Common/openturns/TBB.hxx ---- openturns_ref/lib/src/Base/Common/openturns/TBB.hxx 2021-02-19 15:46:48.419974868 +0100 -+++ openturns_dev/lib/src/Base/Common/openturns/TBB.hxx 2021-02-19 15:46:37.804870246 +0100 -@@ -35,6 +35,7 @@ - # define __TBBMALLOC_NO_IMPLICIT_LINKAGE 1 - # endif - #endif -+#define TBB_PREVIEW_TASK_ARENA 1 - #include - #include - #include -- 2.39.2