From 6e28e3fa1c09e0df705748d820fa0ae3a598f588 Mon Sep 17 00:00:00 2001 From: Nabil Ghodbane Date: Wed, 30 Oct 2024 13:47:57 +0100 Subject: [PATCH] [Windows] omniORB add_dll_directory and OPENTURNS_SALOME compilation issue. See issue #2796 on openturns github repository: https://github.com/openturns/openturns/issues/2796 --- products/omniORBpy.pyconf | 10 +++++++ products/openturns.pyconf | 2 +- products/patches/omniORBpy-4.2.6.p1.patch | 33 ++++++++++++++++++++++ products/patches/openturns-1.23.0002.patch | 15 ++++++++++ 4 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 products/patches/omniORBpy-4.2.6.p1.patch create mode 100644 products/patches/openturns-1.23.0002.patch diff --git a/products/omniORBpy.pyconf b/products/omniORBpy.pyconf index a455114..2387d15 100644 --- a/products/omniORBpy.pyconf +++ b/products/omniORBpy.pyconf @@ -16,8 +16,18 @@ default : { incremental : "yes" } + patches : [] } +version_4_2_6: +{ + patches : [] +} + +version_4_2_6_win: +{ + patches : ['omniORBpy-4.2.6.p1.patch'] +} version_4_2_5: { diff --git a/products/openturns.pyconf b/products/openturns.pyconf index d0a23f7..fbb5efc 100644 --- a/products/openturns.pyconf +++ b/products/openturns.pyconf @@ -52,7 +52,7 @@ version_1_23_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.23.0002.patch'] properties : { single_install_dir : "no" diff --git a/products/patches/omniORBpy-4.2.6.p1.patch b/products/patches/omniORBpy-4.2.6.p1.patch new file mode 100644 index 0000000..9d90c53 --- /dev/null +++ b/products/patches/omniORBpy-4.2.6.p1.patch @@ -0,0 +1,33 @@ +--- omniORBpy-4.2.6_ref/python3/omniORB/__init__.py 2020-09-18 18:13:06.000000000 +0200 ++++ omniORBpy-4.2.6_dev/python3/omniORB/__init__.py 2024-10-30 13:36:43.392056333 +0100 +@@ -42,29 +42,7 @@ + raise ImportError("Python executable has no thread support") + + omniorb_dll_path = None +- +-if sys.platform == "win32" and hasattr(os, "add_dll_directory"): +- # Python 3.8 on Windows no longer looks in PATH to find DLLs, +- # meaning that importing the omniORBpy extension modules fails. +- # You can set the OMNIORB_DLL_PATH environment variable to the +- # directory they are in, or this attempts to find them in the +- # default location. +- omniorb_dll_path = os.environ.get("OMNIORB_DLL_PATH") +- +- if omniorb_dll_path is None: +- omniorb_dll_path = os.path.abspath( +- os.path.join(os.path.dirname(__file__), +- r"..\..\..\bin\x86_win32")) +- +- if not os.path.isdir(omniorb_dll_path): +- omniorb_dll_path = None +- +- +-if omniorb_dll_path is not None: +- with os.add_dll_directory(omniorb_dll_path): +- import _omnipy +-else: +- import _omnipy ++import _omnipy + + _coreVersion = _omnipy.coreVersion() + __version__ = _omnipy.__version__ diff --git a/products/patches/openturns-1.23.0002.patch b/products/patches/openturns-1.23.0002.patch new file mode 100644 index 0000000..a859802 --- /dev/null +++ b/products/patches/openturns-1.23.0002.patch @@ -0,0 +1,15 @@ +--- openturns-1.23_ref/openturns-1.23/lib/src/Base/Common/openturns/Log.hxx 2024-10-30 13:29:08.526681253 +0100 ++++ openturns-1.23_dev/openturns-1.23/lib/src/Base/Common/openturns/Log.hxx 2024-10-30 13:30:05.420229339 +0100 +@@ -21,6 +21,12 @@ + #ifndef OPENTURNS_LOG_HXX + #define OPENTURNS_LOG_HXX + ++#ifdef WIN32 ++ #ifdef ERROR ++ #undef ERROR ++ #endif ++#endif ++ + #include + #include + #include "openturns/OTprivate.hxx" -- 2.39.2