From: Nabil Ghodbane Date: Wed, 17 May 2023 12:13:24 +0000 (+0200) Subject: Several issues fixed: X-Git-Tag: V9_11_0~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3ec9a71f875afc0b78c4a4065dd5f489effad364;p=tools%2Fsat_salome.git Several issues fixed: 1- fix PATH, gmsh executable not in PATH 2- implement cminpack, openblas, py2cpp and openturns 1.20.1 compilation on windows 3- fix URANIE rootlogon startup script if Mpi support not implemented (implemented for Linux but not for windows --- diff --git a/applications/SALOME-master-windows.pyconf b/applications/SALOME-master-windows.pyconf index 416a8fd..95858fc 100644 --- a/applications/SALOME-master-windows.pyconf +++ b/applications/SALOME-master-windows.pyconf @@ -46,6 +46,7 @@ APPLICATION : chardet : '3.0.4' click : '7.0' cmake : '3.24.2' + cminpack: '1.3.6' colorama: '0.4.1' cppunit : '1.13.2' cycler : '0.10.0' @@ -87,12 +88,14 @@ APPLICATION : numpy : '1.16.4' omniORB : '4.2.3' omniORBpy : '4.2.3' + openblas : '0.3.23' opencv : '3.2.0' openVKL: '0.11.0' - openturns: '1.19' + openturns: '1.20.1' ospray : '2.4.0' packaging : '19.0' ParaView : {tag:'5.11.0', base: 'no', section: 'version_5_11_0'} + #PERSALYS: 'v14.0.1' perl : '5.28.1.1' Pillow : '7.1.1' planegcs : '0.18-3cb6890' @@ -169,6 +172,9 @@ APPLICATION : 'EFICAS_TOOLS' 'ADAO' 'PARAVISADDONS' + 'PY2CPP' + #'OPENTURNS_SALOME' + #'YDEFX' 'pmml' 'TESTBASE' 'CEATESTBASE' : 'SalomeV9' diff --git a/products/PY2CPP.pyconf b/products/PY2CPP.pyconf index 8f36b33..01ad41e 100644 --- a/products/PY2CPP.pyconf +++ b/products/PY2CPP.pyconf @@ -35,4 +35,5 @@ default_win : incremental : "yes" single_install_dir : "no" # aimed to solve sat #18914 } + patches : ['py2cpp-9.11.0-lib.patch'] } diff --git a/products/URANIE.pyconf b/products/URANIE.pyconf index c2a708c..ca4bde9 100644 --- a/products/URANIE.pyconf +++ b/products/URANIE.pyconf @@ -27,7 +27,8 @@ version_4_7_0 : { archive_name : "URANIE-4.7.0-Source.tar.gz" } - patches: [] + patches: ["URANIE-4.7.0-rootlogon.patch"] + opt_depend: ["openmpi"] } version_4_7_0_win : @@ -35,7 +36,8 @@ version_4_7_0_win : compil_script : "URANIE-4.7.0.bat" depend : ['Python', 'root','nlopt', 'boost', 'pthreads'] build_depend : ["cmake", 'swig', 'cppunit'] - patches: [] + patches: ["URANIE-4.7.0-rootlogon.patch", "URANIE-4.7.0-pthreads.patch"] + opt_depend: [] } version_4_5_0 : diff --git a/products/cminpack.pyconf b/products/cminpack.pyconf index abdc5ee..71f60f7 100644 --- a/products/cminpack.pyconf +++ b/products/cminpack.pyconf @@ -35,4 +35,13 @@ version_1_3_6 : build_source : "script" compil_script: 'cminpack-1.3.6.sh' patches : ['cminpack-1.3.6-cblas.patch'] +} + +version_1_3_6_win: +{ + depend : ['Python', 'openblas', 'hdf5', 'tbb', 'nlopt', 'libxml2', 'eigen', 'matplotlib'] + build_depend : ["cmake", "swig"] + opt_depend : ['openmpi'] + compil_script: 'cminpack-1.3.6.bat' + patches : [] } \ No newline at end of file diff --git a/products/compil_scripts/cminpack-1.3.6.bat b/products/compil_scripts/cminpack-1.3.6.bat index ed9cb9f..a4195a9 100644 --- a/products/compil_scripts/cminpack-1.3.6.bat +++ b/products/compil_scripts/cminpack-1.3.6.bat @@ -24,6 +24,8 @@ mkdir %BUILD_DIR% SET CMAKE_OPTIONS= SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_PREFIX:STRING=%PRODUCT_INSTALL:\=/% set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE:STRING=%PRODUCT_BUILD_TYPE% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DOpenBLAS_DIR=%OpenBLAS_DIR:\=/% +REM set CMAKE_OPT set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_GENERATOR="Visual Studio 15 2017 Win64" diff --git a/products/compil_scripts/openblas-0.3.23.bat b/products/compil_scripts/openblas-0.3.23.bat new file mode 100644 index 0000000..0235116 --- /dev/null +++ b/products/compil_scripts/openblas-0.3.23.bat @@ -0,0 +1,66 @@ +@echo off + +echo ########################################################################## +echo OpenBLAS %VERSION% +echo ########################################################################## + +IF NOT DEFINED SAT_DEBUG ( + SET SAT_DEBUG=0 +) + +SET PRODUCT_BUILD_TYPE=Release + +REM TODO: NGH: not Tested yet +if %SAT_DEBUG% == 1 ( + set PRODUCT_BUILD_TYPE=Debug +) + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% + +SET CMAKE_OPTIONS= +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_PREFIX:STRING=%PRODUCT_INSTALL:\=/% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE:STRING=%PRODUCT_BUILD_TYPE% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_GENERATOR="Visual Studio 15 2017 Win64" + + +cd %BUILD_DIR% + +echo. +echo -------------------------------------------------------------------------- +echo *** %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR% +echo -------------------------------------------------------------------------- + +%CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR% +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on cminpack + exit 1 +) + +echo. +echo -------------------------------------------------------------------------- +echo *** msbuild %MAKE_OPTIONS% /p:Configuration=Release ALL_BUILD.vcxproj +echo -------------------------------------------------------------------------- + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild ALL_BUILD.vcxproj + exit 2 +) + +echo. +echo -------------------------------------------------------------------------- +echo *** msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 INSTALL.vcxproj +echo -------------------------------------------------------------------------- + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 INSTALL.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild INSTALL.vcxproj + exit 3 +) + +echo. +echo ########## END diff --git a/products/compil_scripts/openturns-1.20.1.bat b/products/compil_scripts/openturns-1.20.1.bat new file mode 100644 index 0000000..825e33a --- /dev/null +++ b/products/compil_scripts/openturns-1.20.1.bat @@ -0,0 +1,118 @@ +@echo off + +echo ########################################################################## +echo openturns %VERSION% +echo ########################################################################## + +IF NOT DEFINED SAT_DEBUG ( + SET SAT_DEBUG=0 +) + +SET PRODUCT_BUILD_TYPE=Release +if %SAT_DEBUG% == 1 ( + set PRODUCT_BUILD_TYPE=Debug +) + +IF NOT DEFINED CMAKE_GENERATOR ( + SET CMAKE_GENERATOR="Visual Studio 15 2017 Win64" +) + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% + +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% + +REM we don't install in python directory -> modify environment as described in INSTALL file +set PATH=%WINFLEX_ROOT_DIR%;%PATH% +SET PATH=%CWD%\bin;%PATH% +SET PYTHONPATH=%CWD%;%PYTHONPATH% +SET PYTHONPATH=%PRODUCT_INSTALL%\lib\python%PYTHON_VERSION%\site-packages;%PYTHONPATH% + +SET CMAKE_OPTIONS= +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_PREFIX:STRING=%PRODUCT_INSTALL:\=/% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_BUILD_TYPE:STRING=%PRODUCT_BUILD_TYPE% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_INSTALL_LIBDIR:STRING=lib +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPYTHON_EXECUTABLE=%PYTHONBIN% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DSWIG_EXECUTABLE=%SWIG_ROOT_DIR:\=/%/bin/swig +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DTBB_ROOT_DIR=%TBB_ROOT_DIR% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -Dtbb_DIR:PATH=%TBB_ROOT_DIR:\=/% +SET CMAKE_OPTIONS=%CMAKE_OPTIONS% -DUSE_TBB=OFF +REM libxml2 settings +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DVTK_MODULE_USE_EXTERNAL_VTK_libxml2:BOOL=ON +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLIBXML2_INCLUDE_DIR:STRING=%LIBXML2_ROOT_DIR:\=/%/include +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLIBXML2_LIBRARIES:STRING=%LIBXML2_ROOT_DIR:\=/%/lib/libxml2.lib +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLIBXML2_XMLLINT_EXECUTABLE=%LIBXML2_ROOT_DIR:\=/%/bin/xmllint.exe + +REM HDF5 settings +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DVTK_MODULE_USE_EXTERNAL_VTK_hdf5:BOOL=ON +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DHDF5_DIR:PATH=%HDF5_ROOT_DIR:\=/%/cmake/hdf5 +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DHDF5_INCLUDE_DIRS:PATH=%HDF5_ROOT_DIR:\=/%/include +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DHDF5_USE_STATIC_LIBRARIES:BOOL=OFF +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DNLOPT_INCLUDE_DIRS:STRING=%NLOPT_ROOT_DIR:\=/%/include +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DNLOPT_LIBRARIES:STRING=%NLOPT_ROOT_DIR:\=/%/bin +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DNLOPT_DIR:STRING=%NLOPT_ROOT_DIR:\=/% +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCBLAS_DIR=%OPENBLAS_ROOT_DIR:\=/%/share/cmake/OpenBLAS +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPython3_EXECUTABLE:FILEPATH=%PYTHON_ROOT_DIR:\=/%/python3.exe +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DPython3_INCLUDE_DIR:PATH=%PYTHON_ROOT_DIR:\=/%/include +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DLAPACK_LIBRARIES:FILEPATH=%OPENBLAS_ROOT_DIR:\=/%/lib/openblas.lib +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_SHARED_LINKER_FLAGS_RELEASE="/OPT:NOREF /INCREMENTAL:NO" +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_UNITY_BUILD=ON +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DCMAKE_UNITY_BUILD_BATCH_SIZE=16 +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DSWIG_COMPILE_FLAGS="/bigobj" +set CMAKE_OPTIONS=%CMAKE_OPTIONS% -DUSE_SPHINX=OFF + +if NOT exist "%PRODUCT_INSTALL%" mkdir %PRODUCT_INSTALL% +REM clean BUILD directory +if exist "%BUILD_DIR%" rmdir /Q /S %BUILD_DIR% +mkdir %BUILD_DIR% + +cd %BUILD_DIR% +mkdir openturns +mkdir cache +mkdir cache\pip + +cd %BUILD_DIR%\openturns + +set MSBUILDDISABLENODEREUSE=1 + +echo. +echo ********************************************************************* +echo *** %CMAKE_ROOT%\bin\cmake %CMAKE_OPTIONS% %SOURCE_DIR%\openturns-1.20.1 +echo ********************************************************************* +echo. + +%CMAKE_ROOT%\bin\cmake -G "Visual Studio 15 2017 Win64" %CMAKE_OPTIONS% %SOURCE_DIR%\openturns-1.20.1 +if NOT %ERRORLEVEL% == 0 ( + echo "ERROR on cmake" + exit 1 +) + +echo. +echo ********************************************************************* +echo *** msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj + +echo ********************************************************************* +echo. + +REM ON PURPOSE, we CONTINUE if fails since the error are about porting some NR to Windows native build (openturns team uses mingw) +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 ALL_BUILD.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild ALL_BUILD.vcxproj + REM exit 2 +) + +echo. +echo ********************************************************************* +echo *** installation... +echo ********************************************************************* +echo. + +msbuild %MAKE_OPTIONS% /p:Configuration=%PRODUCT_BUILD_TYPE% /p:Platform=x64 INSTALL.vcxproj +if NOT %ERRORLEVEL% == 0 ( + echo ERROR on msbuild INSTALL.vcxproj + exit 3 +) + +echo +echo "########## END" diff --git a/products/env_scripts/gmsh.py b/products/env_scripts/gmsh.py index fe039f3..41c6985 100644 --- a/products/env_scripts/gmsh.py +++ b/products/env_scripts/gmsh.py @@ -7,8 +7,8 @@ import platform def set_env(env, prereq_dir, version): env.set('GMSHHOME', prereq_dir) env.set('GMSH_ROOT_DIR', prereq_dir) + env.append('PATH',os.path.join(prereq_dir,'bin')) if platform.system() == "Windows" : - env.append('PATH',os.path.join(prereq_dir,'bin')) env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'bin')) else: env.prepend('LD_LIBRARY_PATH', os.path.join(prereq_dir, 'lib')) diff --git a/products/env_scripts/openturns.py b/products/env_scripts/openturns.py index 1153431..c1f6ad0 100644 --- a/products/env_scripts/openturns.py +++ b/products/env_scripts/openturns.py @@ -1,13 +1,17 @@ #!/usr/bin/env python import os.path - +import platform def set_env(env, prereq_dir, version): env.set('OT_ROOT_DIR', prereq_dir) env.set('OT_HOME', prereq_dir) env.set('OT_VERSION',version) 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')) + if platform.system() == "Windows" : + env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'lib','site-packages')) + else: + pyver = 'python' + env.get('PYTHON_VERSION') + env.prepend('LD_LIBRARY_PATH',os.path.join(prereq_dir, 'lib')) + env.prepend('PYTHONPATH', os.path.join(prereq_dir, 'lib', pyver, 'site-packages')) + def set_nativ_env(env): pass diff --git a/products/openturns.pyconf b/products/openturns.pyconf index 4a973ac..54ca69c 100644 --- a/products/openturns.pyconf +++ b/products/openturns.pyconf @@ -45,15 +45,15 @@ version_1_20_1 : version_1_20_1_win : { - compil_script : 'pip_install' + $VARS.scriptExtension + compil_script : "openturns-1.20.1.bat" + depend : ['Python', 'openblas', 'hdf5', 'tbb', 'nlopt', 'libxml2', 'eigen', 'matplotlib'] + opt_depend : [] + patches : ["openturns-1.20.1.004.patch"] properties : { - single_install_dir : "yes" + single_install_dir : "no" incremental : "yes" - pip : "yes" } - depend : ['Python', 'lapack', 'hdf5', 'tbb', 'nlopt', 'libxml2', 'eigen', 'pthreads'] - opt_depend : [] } version_1_20_1_UB22_04 : diff --git a/products/patches/URANIE-4.7.0-pthreads.patch b/products/patches/URANIE-4.7.0-pthreads.patch new file mode 100644 index 0000000..17cae26 --- /dev/null +++ b/products/patches/URANIE-4.7.0-pthreads.patch @@ -0,0 +1,44 @@ +diff -Naur URANIE-4.7.0-Source_ref/CmakePackage/FindPthread-win32.cmake URANIE-4.7.0-Source_dev/CmakePackage/FindPthread-win32.cmake +--- URANIE-4.7.0-Source_ref/CmakePackage/FindPthread-win32.cmake 2022-08-07 22:55:34.000000000 +0200 ++++ URANIE-4.7.0-Source_dev/CmakePackage/FindPthread-win32.cmake 2023-05-15 15:09:08.098981307 +0200 +@@ -8,7 +8,7 @@ + # if(WIN32) + SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll") + FIND_LIBRARY(PTHREAD_DLL_LIBRARY +- NAMES pthreadVCE3 ++ NAMES pthreadVCE2 + HINTS ENV PATH + PATH_SUFFIXES lib64 lib debug release + ) +@@ -18,7 +18,7 @@ + get_filename_component(PTHREAD_PATH ${PTHREAD_DLL_LIBRARY} PATH) + string(REGEX REPLACE "dll/x86" "" PTHREAD_PATH ${PTHREAD_PATH}) + FIND_LIBRARY(PTHREAD_LIBRARY +- NAMES pthreadVCE3 ++ NAMES pthreadVCE2 + PATH_SUFFIXES lib64 lib lib/x86 debug release + PATHS ${PTHREAD_PATH} + ) +@@ -28,10 +28,11 @@ + PATH_SUFFIXES include + PATHS ${PTHREAD_PATH} + ) +- set(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY}/pthreadVCE3.lib) ++ set(PTHREAD_LIBRARIES ${PTHREAD_LIBRARY}/pthreadVCE2.lib) + endif(EXISTS ${PTHREAD_DLL_LIBRARY}) + + find_package_handle_standard_args(PTHREAD DEFAULT_MSG PTHREAD_DLL_LIBRARY PTHREAD_LIBRARY PTHREAD_INCLUDE_DIR) + + +-# endif(WIN32) +\ Pas de fin de ligne à la fin du fichier ++# endif(WIN32) ++ +diff -Naur URANIE-4.7.0-Source_ref/validation/load_pthreads.C URANIE-4.7.0-Source_dev/validation/load_pthreads.C +--- URANIE-4.7.0-Source_ref/validation/load_pthreads.C 2022-08-07 22:55:40.000000000 +0200 ++++ URANIE-4.7.0-Source_dev/validation/load_pthreads.C 2023-05-15 15:07:16.745822558 +0200 +@@ -1,3 +1,3 @@ + void load_pthreads() { +- gSystem->Load("pthreadVCE3"); ++ gSystem->Load("pthreadVCE2"); + } diff --git a/products/patches/URANIE-4.7.0-rootlogon.patch b/products/patches/URANIE-4.7.0-rootlogon.patch new file mode 100644 index 0000000..379437f --- /dev/null +++ b/products/patches/URANIE-4.7.0-rootlogon.patch @@ -0,0 +1,15 @@ +diff -Naur URANIE-4.7.0-Source_ref/macros/rootlogon.py URANIE-4.7.0-Source_dev/macros/rootlogon.py +--- URANIE-4.7.0-Source_ref/macros/rootlogon.py 2022-08-08 02:41:20.000000000 +0200 ++++ URANIE-4.7.0-Source_dev/macros/rootlogon.py 2023-05-17 13:47:49.745193278 +0200 +@@ -15,7 +15,10 @@ + from ROOT.URANIE import UncertModeler as UncertModeler + from ROOT.URANIE import Reliability as Reliability + from ROOT.URANIE import XMLProblem as XMLProblem +- from ROOT.URANIE import MpiRelauncher as MpiRelauncher ++ try: ++ from ROOT.URANIE import MpiRelauncher as MpiRelauncher ++ except: ++ print("Could not import MpiRelauncher - presumably built without MPI support") + pass + + # General graphical style diff --git a/products/patches/openturns-1.20.1.004.patch b/products/patches/openturns-1.20.1.004.patch new file mode 100644 index 0000000..1689f7d --- /dev/null +++ b/products/patches/openturns-1.20.1.004.patch @@ -0,0 +1,31 @@ +diff -Naur openturns-1.20.1_ref/openturns-1.20.1/CMakeLists.txt openturns-1.20.1_dev/openturns-1.20.1/CMakeLists.txt +--- openturns-1.20.1_ref/openturns-1.20.1/CMakeLists.txt 2023-04-07 09:47:43.000000000 +0200 ++++ openturns-1.20.1_dev/openturns-1.20.1/CMakeLists.txt 2023-05-17 10:52:58.551422902 +0200 +@@ -40,6 +40,15 @@ + option (BUILD_PYTHON "Build the python module for the library" ON) + option (BUILD_SHARED_LIBS "Build shared libraries" ON) + ++ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) # To disable windows warnings for strcpy, fopen, ... ++ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS) # To disable windows warnings generated by checked iterators(e.g. std::copy, std::transform, ...) ++ADD_DEFINITIONS(-DWNT -DWIN32) ++ADD_DEFINITIONS(-D_WIN32_WINNT=0x0500) # Windows 2000 or later API is required ++ADD_DEFINITIONS(-DPPRO_NT) ++ADD_DEFINITIONS(-DNOMINMAX) ++ ++SET(SWIG_ROOT_DIR $ENV{SWIG_ROOT_DIR} CACHE PATH "Path to the SWIG.") ++ + # Defines our own module path + list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) + +diff -Naur openturns-1.20.1_ref/openturns-1.20.1/python/src/CMakeLists.txt openturns-1.20.1_dev/openturns-1.20.1/python/src/CMakeLists.txt +--- openturns-1.20.1_ref/openturns-1.20.1/python/src/CMakeLists.txt 2023-04-07 09:47:43.000000000 +0200 ++++ openturns-1.20.1_dev/openturns-1.20.1/python/src/CMakeLists.txt 2023-05-17 10:49:29.386285353 +0200 +@@ -16,7 +16,7 @@ + execute_process (COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/openturns) + add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/openturns/swigpyrun.h + COMMAND ${SWIG_EXECUTABLE} +- ARGS -python -external-runtime ${CMAKE_CURRENT_BINARY_DIR}/openturns/swigpyrun.h ++ ARGS -I${SWIG_ROOT_DIR}/Lib -I${SWIG_ROOT_DIR}/Lib/python -python -external-runtime ${CMAKE_CURRENT_BINARY_DIR}/openturns/swigpyrun.h + COMMENT "Swig runtime header") + add_custom_target (generate_swig_runtime DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/openturns/swigpyrun.h) + add_custom_target (generate_docstrings) diff --git a/products/patches/py2cpp-9.11.0-lib.patch b/products/patches/py2cpp-9.11.0-lib.patch new file mode 100644 index 0000000..a3008b1 --- /dev/null +++ b/products/patches/py2cpp-9.11.0-lib.patch @@ -0,0 +1,25 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index d3fda0a..2f46d15 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -45,7 +45,11 @@ SET(_py2cpp_headers + py2cpp.hxx + ) + +-ADD_LIBRARY(py2cpp ${_py2cpp_sources}) ++add_library(py2cpp_lib STATIC ${_py2cpp_sources}) ++TARGET_LINK_LIBRARIES(py2cpp_lib ${_link_LIBRARIES}) ++set_target_properties(py2cpp_lib PROPERTIES OUTPUT_NAME py2cpp) ++ ++ADD_LIBRARY(py2cpp ${_py2cpp_sources}) + TARGET_LINK_LIBRARIES(py2cpp ${_link_LIBRARIES}) + TARGET_INCLUDE_DIRECTORIES(py2cpp PUBLIC + $ +@@ -53,6 +57,7 @@ TARGET_INCLUDE_DIRECTORIES(py2cpp PUBLIC + + IF(WIN32) + INSTALL(TARGETS py2cpp EXPORT Py2cppCfg LIBRARY DESTINATION lib ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION bin ${CMAKE_INSTALL_BINDIR}) ++ INSTALL(TARGETS py2cpp_lib DESTINATION lib) + ELSE(WIN32) + INSTALL(TARGETS py2cpp EXPORT Py2cppCfg LIBRARY DESTINATION lib) + ENDIF(WIN32)