]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
version MPI: besoin de HDF CXX pour Openturns
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Tue, 1 Jun 2021 13:00:10 +0000 (15:00 +0200)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Tue, 1 Jun 2021 13:00:10 +0000 (15:00 +0200)
products/compil_scripts/hdf5-1.10.3.sh
products/compil_scripts/openturns.sh
products/nlopt.pyconf
products/openturns.pyconf
products/patches/openturns-1.16.0001.patch

index c59b335087cd2553c167f247ae68aa0230bc6fc4..34e948207b29c8093691b95db552b5bd6184c6ac 100755 (executable)
@@ -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"
index a64040abfc8d9525db8b4bdf42cf2c1f068e6567..e4551d2605fe4491f57704c60fd16746da9a11f3 100755 (executable)
@@ -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"
index 00618088de2479713968d80438518f1c08b5272b..11fcd3577aec796894923d14f7b2bbca5f255599 100644 (file)
@@ -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:
index 5721d7e94bb4a98a8b498204c08614b4ab8ad070..d9db64fbf6af152db6b004d3e870b6efdd4987b3 100644 (file)
@@ -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 :
index ec48c370b9aeacec16067bebf39cb7163fff5d05..adfba8fad0a4f519fedfd372589da758d370a9cf 100644 (file)
@@ -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 <tbb/task_arena.h>
+ #include <tbb/parallel_sort.h>
+ #include <tbb/parallel_reduce.h>
+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 <tbb/task_arena.h>
- #include <tbb/parallel_sort.h>
- #include <tbb/parallel_reduce.h>