]> SALOME platform Git repositories - tools/sat_salome.git/commitdiff
Salome HOME
bos #34671: [Windows] openturns and persalys integration
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Tue, 26 Sep 2023 12:39:09 +0000 (14:39 +0200)
committerGuytri KASTANE <guytri.kastane@cea.fr>
Wed, 13 Mar 2024 14:44:43 +0000 (15:44 +0100)
products/PERSALYS.pyconf
products/compil_scripts/openturns-1.21.bat
products/openturns.pyconf
products/patches/PERSALYS-v14.1-002.patch [new file with mode: 0644]
products/patches/PERSALYS-v14.1-003.patch [new file with mode: 0644]
products/patches/openturns-1.21.0003.patch [new file with mode: 0644]
products/patches/openturns-1.21.0004.patch [new file with mode: 0644]

index 5e63f27932ec6c0f7dff2fe3dd244ba087e54ebb..d87bc42b57bf0ee80fdcae8927c4472ca4e33446 100644 (file)
@@ -93,7 +93,7 @@ version_v14_1_win :
               'openblas',
               'pthreads'
            ]
-    patches : []
+    patches : ['PERSALYS-v14.1-002.patch', 'PERSALYS-v14.1-003.patch']
 }
 
 version_v14_0_1 :
index 688778494bd9870d8e11d5f48a1cbaf4decfe1e0..93547b5014bffbb333fb98fed4d2041ffe97cc0e 100644 (file)
@@ -284,7 +284,7 @@ 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
+xcopy %SOURCE_DIR%\otpod-0.6.10\*   %BUILD_DIR%\otpod /E /I /Q
 if NOT %ERRORLEVEL% == 0 (
     echo ERROR on xcopy
     exit 3
index 20b8944f57550d0c00267c74a85833d86853dc01..1edab05c6367919ac073dc7f3ad5caabbeb47dfc 100644 (file)
@@ -52,7 +52,7 @@ version_1_21_win :
     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 : []
+    patches : ['openturns-1.21.0003.patch', 'openturns-1.21.0004.patch']
     properties :
     {
       single_install_dir : "no"
diff --git a/products/patches/PERSALYS-v14.1-002.patch b/products/patches/PERSALYS-v14.1-002.patch
new file mode 100644 (file)
index 0000000..844f466
--- /dev/null
@@ -0,0 +1,21 @@
+--- persalys-14.1_ref/CMakeLists.txt   2023-07-25 11:23:39.000000000 +0200
++++ persalys-14.1_dev/CMakeLists.txt   2023-09-26 12:57:40.000000000 +0200
+@@ -64,9 +64,16 @@
+   set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
+ endif ()
++SET(BOOST_ROOT_DIR $ENV{BOOST_ROOT_DIR} CACHE PATH "Path to the Boost")
++if(EXISTS "${BOOST_ROOT_DIR}")
++  set(BOOST_ROOT "${BOOST_ROOT_DIR}" CACHE PATH "Boost root directory" FORCE)
++endif()
++set(Boost_USE_DEBUG_LIBS   OFF) # ignore debug libs and
++set(Boost_USE_RELEASE_LIBS ON)  # only find release libsfind_package (Boost COMPONENTS filesystem locale REQUIRED)
+ find_package (Boost COMPONENTS filesystem locale REQUIRED)
+-list (APPEND PERSALYS_PRIVATE_LIBRARIES ${Boost_LIBRARIES})
+-
++if (TARGET Boost::filesystem)
++  set (Boost_LIBRARIES Boost::filesystem Boost::locale)
++ENDIF()
+ find_package (Python 3.5 COMPONENTS Interpreter Development REQUIRED)
+ list (APPEND PERSALYS_PUBLIC_LIBRARIES ${Python_LIBRARIES})
diff --git a/products/patches/PERSALYS-v14.1-003.patch b/products/patches/PERSALYS-v14.1-003.patch
new file mode 100644 (file)
index 0000000..6a815fb
--- /dev/null
@@ -0,0 +1,22 @@
+--- persalys-14.1_ref/lib/src/base/CMakeLists.txt      2023-07-25 11:23:39.000000000 +0200
++++ persalys-14.1_dev/lib/src/base/CMakeLists.txt      2023-09-26 13:00:18.000000000 +0200
+@@ -203,7 +203,7 @@
+ else ()
+   target_compile_definitions (persalysbase PUBLIC PERSALYS_BASE_STATIC)
+ endif ()
+-
++target_compile_options(persalysbase PUBLIC  -DBOOST_ALL_DYN_LINK)
+ target_include_directories (persalysbase PRIVATE ${Boost_INCLUDE_DIRS})
+ target_include_directories (persalysbase PRIVATE ${Python_INCLUDE_DIRS})
+@@ -220,8 +220,8 @@
+ set_target_properties (persalysbase PROPERTIES VERSION ${LIB_VERSION})
+ set_target_properties (persalysbase PROPERTIES SOVERSION ${LIB_SOVERSION})
+-target_link_libraries (persalysbase PUBLIC ${PERSALYS_PUBLIC_LIBRARIES})
+-target_link_libraries (persalysbase PRIVATE ${PERSALYS_PRIVATE_LIBRARIES})
++target_link_libraries (persalysbase PUBLIC "${PERSALYS_PUBLIC_LIBRARIES};${Boost_LIBRARIES};${Boost_FILESYSTEM_LIBRARY_RELEASE}")
++target_link_libraries (persalysbase PRIVATE "${PERSALYS_PRIVATE_LIBRARIES};${Boost_LIBRARIES};${Boost_FILESYSTEM_LIBRARY_RELEASE}")
+ install (TARGETS persalysbase
+   RUNTIME DESTINATION ${PERSALYS_BIN_PATH}
diff --git a/products/patches/openturns-1.21.0003.patch b/products/patches/openturns-1.21.0003.patch
new file mode 100644 (file)
index 0000000..f5cb9b0
--- /dev/null
@@ -0,0 +1,71 @@
+--- otrobopt-0.12_ref/lib/src/MeasureEvaluation.cxx    2023-09-13 14:59:42.000000000 +0200
++++ otrobopt-0.12_dev/lib/src/MeasureEvaluation.cxx    2023-09-26 12:11:25.339902064 +0200
+@@ -23,40 +23,20 @@
+ #include <openturns/PersistentObjectFactory.hxx>
+ #include <openturns/ResourceMap.hxx>
+ #include <openturns/GaussKronrodRule.hxx>
++#include <mutex>
+ using namespace OT;
+ namespace OTROBOPT
+ {
+-
+-static pthread_mutex_t OTRobOptResourceMap_InstanceMutex_;
+-static UnsignedInteger OTRobOptResourceMap_initialized_ = 0;
+-
+-class OTRobOptResourceMap_init
++struct OTRobOptResourceMap_init
+ {
+-public:
+   OTRobOptResourceMap_init()
+   {
+-
+-    if (!OTRobOptResourceMap_initialized_)
++    static std::once_flag flag;
++    std::call_once(flag, [&]()
+     {
+-#ifndef OT_MUTEXINIT_NOCHECK
+-      pthread_mutexattr_t attr;
+-      pthread_mutexattr_init( &attr );
+-      pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE );
+-      pthread_mutex_init(&OTRobOptResourceMap_InstanceMutex_, &attr);
+-#else
+-      pthread_mutex_init(&OTRobOptResourceMap_InstanceMutex_, NULL);
+-#endif
+-      // openturns<1.15
+-#ifndef OPENTURNS_VERSION
+-#define AddAsScalar SetAsScalar
+-#define AddAsUnsignedInteger SetAsUnsignedInteger
+-#define AddAsBool SetAsBool
+-#define AddAsScalar SetAsScalar
+-#endif
+-      // SequentialMonteCarloRobustAlgorithm
+       ResourceMap::AddAsScalar("SequentialMonteCarloRobustAlgorithm-ConvergenceFactor", 1e-2);
+       ResourceMap::AddAsUnsignedInteger("SequentialMonteCarloRobustAlgorithm-DefaultInitialSamplingSize", 10);
+@@ -67,21 +47,11 @@
+       ResourceMap::AddAsUnsignedInteger("IndividualChanceMeasure-GaussKronrodRule", GaussKronrodRule::G7K15);
+       ResourceMap::AddAsUnsignedInteger("JointChanceMeasure-GaussKronrodRule", GaussKronrodRule::G7K15);
+-      OTRobOptResourceMap_initialized_ = 1;
+-    }
+-    assert(OTRobOptResourceMap_initialized_);
++    });
+   }
+-
+-  ~OTRobOptResourceMap_init()
+-  {
+-    if (OTRobOptResourceMap_initialized_)
+-      pthread_mutex_destroy(&OTRobOptResourceMap_InstanceMutex_);
+-    OTRobOptResourceMap_initialized_ = 0;
+-  }
+-
+ };
+-static const OTRobOptResourceMap_init static_initializer_OTRobOptResourceMap;
++static const OTRobOptResourceMap_init __OTRobOptResourceMap_initializer;
+ CLASSNAMEINIT(MeasureEvaluation)
diff --git a/products/patches/openturns-1.21.0004.patch b/products/patches/openturns-1.21.0004.patch
new file mode 100644 (file)
index 0000000..43eabb5
--- /dev/null
@@ -0,0 +1,15 @@
+--- openturns-1.21_ref/openturns-1.21/lib/src/Base/Common/openturns/Log.hxx    2023-09-13 14:59:40.000000000 +0200
++++ openturns-1.21_dev/openturns-1.21/lib/src/Base/Common/openturns/Log.hxx    2023-09-26 14:28:12.567657677 +0200
+@@ -21,6 +21,12 @@
+ #ifndef OPENTURNS_LOG_HXX
+ #define OPENTURNS_LOG_HXX
++#ifdef WIN32
++  #ifdef ERROR
++   #undef ERROR
++  #endif
++#endif
++
+ #include <fstream>
+ #include <map>
+ #include "openturns/OTprivate.hxx"