Salome HOME
PERSALYS : implement patch à la EDF - Test
[tools/sat_salome.git] / products / patches / openturns-1.18.0001.patch
1 diff -Naur openturns-1.18_ref/openturns-1.18/CMakeLists.txt openturns-1.18_new/openturns-1.18/CMakeLists.txt
2 --- openturns-1.17_ref/openturns-1.18/CMakeLists.txt    2021-09-21 13:59:56.000000000 +0200
3 +++ openturns-1.17_new/openturns-1.18/CMakeLists.txt    2021-10-04 13:27:16.893096795 +0200
4 @@ -133,6 +133,11 @@
5  
6  set (CMAKE_CXX_STANDARD 11)
7  
8 +SET(LAPACK_ROOT_DIR $ENV{LAPACK_ROOT_DIR})
9 +IF(LAPACK_ROOT_DIR)
10 +  LIST(APPEND CMAKE_PREFIX_PATH "${LAPACK_ROOT_DIR}")
11 +ENDIF(LAPACK_ROOT_DIR)
12 +
13  if (NOT DEFINED LAPACK_LIBRARIES)
14    find_package (LAPACK REQUIRED)
15    if (LAPACK_FOUND)
16 @@ -140,6 +145,10 @@
17    endif ()
18  endif ()
19  list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${LAPACK_LIBRARIES})
20 +IF (DEFINED CBLAS_LIBRARIES)
21 +  MESSAGE(STATUS "CBLAS_LIBRARIES is defined... adding to the list of libraries ${CBLAS_LIBRARIES}")
22 +  LIST (APPEND OPENTURNS_PRIVATE_LIBRARIES ${CBLAS_LIBRARIES})
23 +ENDIF()
24  
25  if (USE_SPECTRA)
26    find_package (Spectra)
27 @@ -164,7 +173,11 @@
28  endif ()
29  
30  if (USE_TBB)
31 -  find_package (TBB)
32 +  SET(TBB_ROOT_DIR $ENV{TBB_ROOT_DIR})
33 +  if(TBB_ROOT_DIR)
34 +    LIST(APPEND CMAKE_PREFIX_PATH "${TBB_ROOT_DIR}")
35 +  endif(TBB_ROOT_DIR)
36 +   find_package (TBB)
37  endif ()
38  if (TBB_FOUND)
39    set (OPENTURNS_HAVE_TBB_TBB_H TRUE)
40 @@ -207,6 +220,10 @@
41  endif ()
42  
43  if (USE_LIBXML2)
44 +  SET(LIBXML2_ROOT_DIR $ENV{LIBXLM2_ROOT_DIR})
45 +  if(LIBXML2_ROOT_DIR)
46 +    LIST(APPEND CMAKE_PREFIX_PATH "${LIBXML2_ROOT_DIR}")
47 +  endif(LIBXML2_ROOT_DIR)
48    find_package (LibXml2)
49  endif ()
50  if (LIBXML2_FOUND)
51 @@ -216,7 +233,19 @@
52    list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${LIBXML2_LIBRARIES})
53  endif ()
54  
55 +SET(MPI_ROOT_DIR $ENV{MPI_ROOT_DIR} CACHE PATH "Path to the MPI.")
56 +IF(MPI_ROOT_DIR)
57 + LIST(APPEND CMAKE_PREFIX_PATH "${MPI_ROOT_DIR}")
58 + find_package(MPI)
59 + list (APPEND OPENTURNS_PRIVATE_INCLUDE_DIRS ${MPI_INCLUDE_DIRS})
60 + list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${MPI_LIBRARIES})
61 +ENDIF(MPI_ROOT_DIR)
62 +
63  if (USE_HDF5)
64 +  SET(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR} CACHE PATH "Path to the HDF5.")
65 +  IF(HDF5_ROOT_DIR)
66 +    LIST(APPEND CMAKE_PREFIX_PATH "${HDF5_ROOT_DIR}")
67 +  ENDIF(HDF5_ROOT_DIR)
68    find_package(HDF5 COMPONENTS CXX)
69  endif ()
70  if (HDF5_FOUND)
71 @@ -237,6 +266,10 @@
72  endif ()
73  
74  if (USE_BOOST)
75 +  SET(BOOST_ROOT_DIR $ENV{BOOST_ROOT_DIR} CACHE PATH "Path to the BOOST.")
76 +  IF(BOOST_ROOT_DIR)
77 +    LIST(APPEND CMAKE_PREFIX_PATH "${BOOST_ROOT_DIR}")
78 +  ENDIF(BOOST_ROOT_DIR)
79    find_package (Boost 1.46)
80    if (Boost_FOUND)
81      if (CMAKE_VERSION VERSION_LESS 3.15)
82 @@ -272,7 +305,11 @@
83  endif ()
84  
85  if (USE_NLOPT)
86 -  find_package (NLopt CONFIG QUIET)
87 +  SET(NLOPT_ROOT_DIR $ENV{NLOPT_ROOT_DIR} CACHE PATH "Path to the NLOPT.")
88 +  IF(NLOPT_ROOT_DIR)
89 +    LIST(APPEND CMAKE_PREFIX_PATH "${NLOPT_ROOT_DIR}")
90 +  ENDIF(NLOPT_ROOT_DIR)
91 +  find_package (NLopt)
92    if (NLopt_FOUND)
93      message(STATUS "Found NLopt: ${NLopt_DIR}")
94    else ()
95 @@ -336,22 +373,22 @@
96  endif ()
97  
98  if (USE_CMINPACK)
99 -  find_package (CMinpack CONFIG QUIET)
100 -  if (CMinpack_FOUND)
101 -    if (TARGET cminpack::cminpack)
102 -      message (STATUS "Found CMinpack: ${CMinpack_DIR}")
103 -      set (CMINPACK_LIBRARIES cminpack::cminpack)
104 -    endif ()
105 -  else ()
106 -    # fallback to our macro if CMinpackConfig is not provided
107 -    find_package (CMinpack)
108 -    set (CMinpack_FOUND ${CMINPACK_FOUND})
109 -  endif ()
110 -  if (CMinpack_FOUND)
111 -    set (OPENTURNS_HAVE_CMINPACK TRUE)
112 -    list (APPEND OPENTURNS_PRIVATE_INCLUDE_DIRS ${CMINPACK_INCLUDE_DIRS})
113 -    list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${CMINPACK_LIBRARIES})
114 -  endif ()
115 +  SET(CMINPACK_ROOT_DIR $ENV{CMINPACK_ROOT_DIR} CACHE PATH "Path to the CMINPACK.")
116 +  IF(CMINPACK_ROOT_DIR)
117 +    LIST(APPEND CMAKE_PREFIX_PATH "${CMINPACK_ROOT_DIR}")
118 +  ENDIF(CMINPACK_ROOT_DIR)
119 +  find_package (CMinpack)
120 +  set (CMinpack_FOUND ${CMINPACK_FOUND})
121 +endif ()
122 +if (CMinpack_FOUND)
123 +  MESSAGE(STATUS "Found CMkinpack ...")
124 +  MESSAGE(STATUS "      CMINPACK_LIBRARIES is set to: ${CMINPACK_LIBRARIES}")
125 +  set (OPENTURNS_HAVE_CMINPACK TRUE)
126 +  list (APPEND OPENTURNS_PRIVATE_INCLUDE_DIRS ${CMINPACK_INCLUDE_DIRS})
127 +  list (APPEND OPENTURNS_PRIVATE_LIBRARIES ${CMINPACK_LIBRARIES})
128 +else()
129 +  MESSAGE(STATUS "Could not find MinPack dependency")
130 +  set (OPENTURNS_HAVE_CMINPACK FALSE)
131  endif ()
132  
133  if (USE_BONMIN)
134 diff -Naur openturns-1.18_ref/openturns-1.18/cmake/FindCMinpack.cmake openturns-1.18_new/openturns-1.18/cmake/FindCMinpack.cmake
135 --- openturns-1.18_ref/openturns-1.18/cmake/FindCMinpack.cmake  2021-09-21 13:28:10.246960802 +0200
136 +++ openturns-1.18_new/openturns-1.18/cmake/FindCMinpack.cmake  2021-09-21 13:27:42.519698634 +0200
137 @@ -22,14 +22,19 @@
138  # (To distributed this file outside of CMake, substitute the full
139  #  License text for the above reference.)
140  
141 +SET(CMINPACK_ROOT_DIR $ENV{CMINPACK_ROOT_DIR})
142 +if(CMINPACK_ROOT_DIR)
143 + LIST(APPEND CMAKE_PREFIX_PATH "${CMINPACK_ROOT_DIR}")
144 +endif(CMINPACK_ROOT_DIR)
145  find_path (CMINPACK_INCLUDE_DIR cminpack.h
146    PATH_SUFFIXES cminpack cminpack-1
147  )
148  
149  find_library (CMINPACK_LIBRARY
150    NAMES cminpack cminpack_s
151 +  HINTS ${CMINPACK_ROOT_DIR}/include
152 +  DOC   "CMINPACK include directory"
153  )
154 -
155  set (CMINPACK_LIBRARIES ${CMINPACK_LIBRARY})
156  set (CMINPACK_INCLUDE_DIRS ${CMINPACK_INCLUDE_DIR})
157  
158 diff -Naur openturns-1.18_ref/openturns-1.18/cmake/FindNLopt.cmake openturns-1.18_new/openturns-1.18/cmake/FindNLopt.cmake
159 --- openturns-1.18_ref/openturns-1.18/cmake/FindNLopt.cmake     2021-09-21 13:28:10.247960811 +0200
160 +++ openturns-1.18_new/openturns-1.18/cmake/FindNLopt.cmake     2021-09-21 13:27:42.520698643 +0200
161 @@ -11,8 +11,19 @@
162  #  NLOPT_ROOT_DIR - root dir (ex. /usr/local)
163  
164  # set NLOPT_INCLUDE_DIR
165 +SET(NLOPT_ROOT_DIR $ENV{NLOPT_ROOT_DIR})
166 +
167 +IF(NLOPT_ROOT_DIR)
168 +  LIST(APPEND CMAKE_PREFIX_PATH "${NLOPT_ROOT_DIR}")
169 +  LIST(APPEND CMAKE_PREFIX_PATH "${NLOPT_ROOT_DIR}/include")
170 +  LIST(APPEND CMAKE_PREFIX_PATH "${NLOPT_ROOT_DIR}/lib")
171 +ELSE(NLOPT_ROOT_DIR)
172 +  MESSAGE(FATAL_ERROR "PLEASE SET ENVIRONMENT VARIABLE NLOPT_ROOT_DIR")
173 +ENDIF(NLOPT_ROOT_DIR)
174 +
175  find_path (NLOPT_INCLUDE_DIR
176    NAMES nlopt.hpp
177 +  HINTS ${NLOPT_ROOT_DIR}/include
178    DOC
179      "Nlopt include directory"
180  )
181 @@ -22,7 +33,8 @@
182  
183  # set NLOPT_LIBRARY
184  find_library (NLOPT_LIBRARY
185 -  NAMES nlopt_cxx nlopt
186 +  NAMES nlopt
187 +  HINTS ${NLOPT_ROOT_DIR}/lib 
188    DOC
189      "Nlopt library location"
190  )
191 diff -Naur openturns-1.18_ref/openturns-1.18/cmake/FindTBB.cmake openturns-1.18_new/openturns-1.18/cmake/FindTBB.cmake
192 --- openturns-1.18_ref/openturns-1.18/cmake/FindTBB.cmake       2021-09-21 13:28:10.242960764 +0200
193 +++ openturns-1.18_new/openturns-1.18/cmake/FindTBB.cmake       2021-09-21 13:27:42.514698586 +0200
194 @@ -27,6 +27,11 @@
195  # (To distributed this file outside of CMake, substitute the full
196  #  License text for the above reference.)
197  
198 +SET(TBB_ROOT_DIR $ENV{TBB_ROOT_DIR})
199 +IF(TBB_ROOT_DIR)
200 +  LIST(APPEND CMAKE_PREFIX_PATH "${TBB_ROOT_DIR}")
201 +ENDIF(TBB_ROOT_DIR)
202 +
203  find_path (TBB_INCLUDE_DIR NAMES tbb/tbb.h DOC "TBB include directory")
204  
205  set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
206 diff -Naur openturns-1.18_ref/openturns-1.18/lib/src/CMakeLists.txt openturns-1.18_new/openturns-1.18/lib/src/CMakeLists.txt
207 --- openturns-1.18_ref/openturns-1.18/lib/src/CMakeLists.txt    2021-09-21 13:27:57.412839452 +0200
208 +++ openturns-1.18_new/openturns-1.18/lib/src/CMakeLists.txt    2021-09-21 13:27:14.134430243 +0200
209 @@ -124,5 +124,5 @@
210  if (UNIX AND BUILD_SHARED_LIBS)
211    set (OT_GDB_PY ${CMAKE_SHARED_LIBRARY_PREFIX}OT${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIB_VERSION}-gdb.py)
212    execute_process (COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/libOT-gdb.py ${CMAKE_CURRENT_BINARY_DIR}/${OT_GDB_PY})
213 -  install (FILES libOT-gdb.py DESTINATION ${OPENTURNS_DATA_PATH}/gdb/auto-load/${LIBRARY_PATH} RENAME ${OT_GDB_PY})
214 +  install (FILES libOT-gdb.py DESTINATION ${OPENTURNS_DATA_PATH}/gdb/auto-load RENAME ${OT_GDB_PY})
215  endif ()
216 diff -Naur openturns-1.18_ref/openturns-1.18/lib/src/Base/Common/openturns/TBB.hxx openturns-1.18_new/openturns-1.18/lib/src/Base/Common/openturns/TBB.hxx
217 --- openturns-1.18_ref/openturns-1.18/lib/src/Base/Common/openturns/TBB.hxx     2021-09-21 13:27:54.484811767 +0200
218 +++ openturns-1.18_new/openturns-1.18/lib/src/Base/Common/openturns/TBB.hxx     2021-09-21 13:27:12.704416722 +0200
219 @@ -35,6 +35,7 @@
220  #  define __TBBMALLOC_NO_IMPLICIT_LINKAGE 1
221  # endif
222  #endif
223 +#define TBB_PREVIEW_TASK_ARENA 1
224  #include <tbb/task_arena.h>
225  #include <tbb/parallel_sort.h>
226  #include <tbb/parallel_reduce.h>
227 diff -Naur openturns-1.18_ref/openturns-1.18/lib/src/Base/Algo/openturns/KarhunenLoeveAlgorithmImplementation.hxx openturns-1.18_new/openturns-1.18/lib/src/Base/Algo/openturns/KarhunenLoeveAlgorithmImplementation.hxx
228 --- openturns-1.18_ref/openturns-1.18/lib/src/Base/Algo/openturns/KarhunenLoeveAlgorithmImplementation.hxx      2021-09-21 13:27:55.324819709 +0200
229 +++ openturns-1.18_new/openturns-1.18/lib/src/Base/Algo/openturns/KarhunenLoeveAlgorithmImplementation.hxx      2021-09-21 13:27:13.048419975 +0200
230 @@ -24,6 +24,13 @@
231  #include "openturns/PersistentObject.hxx"
232  #include "openturns/CovarianceModel.hxx"
233  #include "openturns/KarhunenLoeveResult.hxx"
234 +#ifdef __GNUC__
235 +#  include <features.h>
236 +#  if __GNUC_PREREQ(11,0)
237 +#     include <limits>
238 +#  endif
239 +#endif // __GNUC__
240 +
241  
242  BEGIN_NAMESPACE_OPENTURNS
243