]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
spns #23875 OpenTurns
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Fri, 19 Feb 2021 15:28:42 +0000 (16:28 +0100)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Fri, 19 Feb 2021 15:28:42 +0000 (16:28 +0100)
applications/SALOME-master.pyconf
products/compil_scripts/openturns.sh [new file with mode: 0755]
products/env_scripts/eigen.py
products/env_scripts/openturns.py
products/matplotlib.pyconf
products/openturns.pyconf
products/patches/openturns-1.16.0001.patch [new file with mode: 0644]

index b329dac89174eacc3834ea5557355fb5ccba255d..7784b893450752e389d4d401e2ecbf2f4ff4ed89 100644 (file)
@@ -71,7 +71,7 @@ APPLICATION :
         opencv : '3.2.0'
         openssl : "native"
         ospray : '1.8.4'
-        #openturns: '1.16'
+        openturns: '1.16'
         packaging : '17.1'
         ParaView : '5.8.0'
         petsc : '3.14.0'
@@ -216,6 +216,11 @@ __overwrite__ :
     'PRODUCTS.mesa.version_19_0_8.patches' : ['mesa-19.0.8-debug_symbol.patch']
   }
 
+  {
+    __condition__ : "VARS.dist in ['CO7']"
+    'APPLICATION.products.tbb' : '4.4'
+  }
+
   {
     __condition__ : "VARS.dist in ['CO7'] and APPLICATION.environ.build.VTK_SMP_IMPLEMENTATION_TYPE == 'OpenMP'"
     'PRODUCTS.ParaView.version_5_8_0.patches' : ['paraview.0003-ParaViewClient.patch',
@@ -230,12 +235,6 @@ __overwrite__ :
                                                 ]
   }
 
-  # {
-  #   #
-  #   __condition__ : "VARS.dist in ['CO7']"
-  #   'PRODUCTS.openturns.default.cmake_options' : " -DPYTHON_EXECUTABLE=${PYTHON_ROOT_DIR}/bin/python -DUSE_TBB=OFF" # essayer avec un nouveau gcc
-  # }
-
   {
     __condition__ : "VARS.dist in ['CO7'] and APPLICATION.environ.build.VTK_SMP_IMPLEMENTATION_TYPE == 'TBB'"
     'APPLICATION.products.tbb' : '4.4'
diff --git a/products/compil_scripts/openturns.sh b/products/compil_scripts/openturns.sh
new file mode 100755 (executable)
index 0000000..d51bb22
--- /dev/null
@@ -0,0 +1,53 @@
+#!/bin/bash                                                                                                                                                                              
+
+echo "##########################################################################"
+echo "openturns" $VERSION
+echo "##########################################################################"
+
+CMAKE_OPTIONS=""
+CMAKE_OPTIONS=$CMAKE_OPTIONS" -DCMAKE_INSTALL_PREFIX:STRING=${PRODUCT_INSTALL}"
+CMAKE_OPTIONS=$CMAKE_OPTIONS" -DCMAKE_BUILD_TYPE:STRING=Release"
+CMAKE_OPTIONS=$CMAKE_OPTIONS" -DPYTHON_EXECUTABLE=${PYTHON_ROOT_DIR}/bin/python"
+
+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
+
+echo
+echo "*** check installation"
+
+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}/python/test/t_features.py
+${SOURCE_DIR}/python/test/t_features.py
+if [ $? -ne 0 ]
+then
+    echo "ERROR  testing Openturns features...."
+    exit 4
+fi
+
+echo
+echo "########## END"
index 9db1557c5f77d0cb37265aec7d2786dcd77e5b7b..8e91f0be8641a32d511486beb5d98805bb27765d 100644 (file)
@@ -5,7 +5,8 @@ import os.path
 import platform
 
 def set_env(env, prereq_dir, version):
-  env.set('EIGEN_ROOT_DIR', prereq_dir)    # update for cmake
+  env.set('EIGEN_ROOT_DIR', prereq_dir)
+  env.set('Eigen3_DIR', prereq_dir)
   root = env.get('EIGEN_ROOT_DIR')
   if platform.system() != "Windows" :
     pass
index 197aab095737f892f722c7fbfc43fca9ab48ac69..48708145dbb42e0e1f89868e160b63767553c19f 100644 (file)
@@ -4,6 +4,7 @@ import os.path
 def set_env(env, prereq_dir, version):
     env.set('OPENTURN_ROOT_DIR', prereq_dir)
     env.prepend('PATH', os.path.join(prereq_dir,'bin'))
+    env.prepend('LD_LIBRARY_PATH',os.path.join(prereq_dir, 'lib'))
     pyver = 'python' + env.get('PYTHON_VERSION')
     env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'lib', pyver, 'site-packages'))
 
index 37ab373269efed543d8aa4de84c106b7d7246ed3..779131a4ecf5641e079bb7a8ac0483f72af3e243 100755 (executable)
@@ -39,6 +39,15 @@ default_win :
    }
 }
 
+version_2_2_2 :
+{
+    properties:
+    {
+      pip : "yes"
+      incremental : "yes"
+    }
+}
+
 version_2_0_2 :
 {
     depend : ['Python', 'PyQt',  'numpy', 'freetype', 'six', 'pytz', 'pyparsing', 'dateutil', 'setuptools', 'cycler']
index f9b2230fba4287cbb684c947b5f90b5a53f7854f..3c33339ce7c47a84418d772a713d71c1c25927d2 100644 (file)
@@ -1,14 +1,14 @@
 default :
 {
     name : "openturns"
-    build_source : "cmake"
-    cmake_options : " -DPYTHON_EXECUTABLE=${PYTHON_ROOT_DIR}/bin/python"
+    build_source : "script"
+    compil_script :  $name + $VARS.scriptExtension
     get_source : "archive"
     environ :
     {
        env_script : $name + ".py"
     }
-    depend : ['Python', 'lapack', 'hdf5', 'tbb', 'nlopt']
+    depend : ['Python', 'lapack', 'hdf5', 'tbb', 'nlopt', 'libxml2', 'eigen']
     build_depend : ["cmake", "swig"]
     patches : []
     source_dir : $APPLICATION.workdir + $VARS.sep + 'SOURCES' + $VARS.sep + $name
@@ -20,3 +20,8 @@ default :
       incremental : "yes"
     }
 }
+
+version_1_16 :
+{
+  patches : ['openturns-1.16.0001.patch']
+}
diff --git a/products/patches/openturns-1.16.0001.patch b/products/patches/openturns-1.16.0001.patch
new file mode 100644 (file)
index 0000000..57e3061
--- /dev/null
@@ -0,0 +1,153 @@
+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
+ set (TEMPDIR ${OPENTURNS_TEMPDIR})
+ set (CMAKE_CXX_STANDARD 11)
++SET(LAPACK_ROOT_DIR $ENV{LAPACK_ROOT_DIR})
++IF(LAPACK_ROOT_DIR)
++  LIST(APPEND CMAKE_PREFIX_PATH "${LAPACK_ROOT_DIR}")
++ENDIF(LAPACK_ROOT_DIR)
+ if (NOT DEFINED LAPACK_LIBRARIES)
+   find_package (LAPACK REQUIRED)
+@@ -156,7 +160,11 @@ if (USE_FLEX)
+   endif ()
+ endif ()
+-if (USE_TBB)
++if (USE_TBB) 
++  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_package (TBB)
+ endif ()
+ if (TBB_FOUND)
+@@ -200,6 +208,10 @@ if (USE_DOXYGEN)
+ endif ()
+ if (USE_LIBXML2)
++  SET(LIBXML2_ROOT_DIR $ENV{LIBXLM2_ROOT_DIR})
++  if(LIBXML2_ROOT_DIR)
++    LIST(APPEND CMAKE_PREFIX_PATH "${LIBXML2_ROOT_DIR}")    
++  endif(LIBXML2_ROOT_DIR)
+   find_package (LibXml2)
+ endif ()
+ if (LIBXML2_FOUND)
+@@ -210,7 +222,7 @@ if (LIBXML2_FOUND)
+ endif ()
+ if (USE_HDF5)
+-  find_package(HDF5 COMPONENTS CXX)
++  find_package(HDF5 COMPONENTS CXX HL)
+ endif ()
+ if (HDF5_FOUND)
+   set (OPENTURNS_HAVE_HDF5 TRUE)
+@@ -218,7 +230,6 @@ if (HDF5_FOUND)
+   list (APPEND OPENTURNS_PRIVATE_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS})
+   list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${HDF5_LIBRARIES})
+ endif ()
+-
+ 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)
+
+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)
+   add_dependencies (OT generate_csv_parser)
+ endif ()
+-target_link_libraries (OT PUBLIC ${OPENTURNS_LIBRARIES})
+-target_link_libraries (OT PRIVATE ${OPENTURNS_PRIVATE_LIBRARIES})
++target_link_libraries (OT PUBLIC ${OPENTURNS_LIBRARIES} ${HDF5_LIBRARIES} ${TBB_LIBRARIES})
++target_link_libraries (OT PRIVATE ${OPENTURNS_PRIVATE_LIBRARIES}  ${HDF5_LIBRARIES} ${TBB_LIBRARIES})
+ target_include_directories (OT INTERFACE $<INSTALL_INTERFACE:include>)
+ target_include_directories (OT PUBLIC ${OPENTURNS_INCLUDE_DIRS})
+ # Build an empty executable to check link dependencies and completeness
+ add_executable (linktest main.cxx)
+-target_link_libraries (linktest OT)
++target_link_libraries (linktest OT ${TBB_LIBRARIES} ${HDF5_LIBRARIES})
+ set_target_properties (linktest PROPERTIES
+                                  INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${CMAKE_BINARY_DIR}/lib/src")
+@@ -109,5 +109,5 @@ install (TARGETS OT
+ 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>