-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathw2dynamics.patch
400 lines (363 loc) · 17.9 KB
/
w2dynamics.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e8a819a..d45de97 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -52,15 +52,6 @@ SET( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DLAPACK77_Interfac
# Define the actual files and folders that make up the build
############################################################
-find_package(PythonInterp 3.0)
-if (NOT PYTHONINTERP_FOUND)
- find_package(PythonInterp 2.6)
-endif()
-find_package(PackageHandleStandardArgs)
-
-
-INCLUDE(${CMAKE_MODULE_PATH}/installviapip.cmake)
-
option(USE_NFFT "Compile with support for routines requiring the NFFT library for non-equispaced FFTs" ON)
if (USE_NFFT)
@@ -91,22 +82,14 @@ else ()
set(NFFT_LIBRARIES "")
endif ()
-find_package(NUMPY 1.10)
-IF(NOT NUMPY_FOUND)
- install_via_pip("numpy>=1.10.0" ERRORCODE)
- if (${ERRORCODE})
- MESSAGE(FATAL_ERROR "Couldn't install numpy -> ABORTING!!!")
- endif()
-ENDIF()
-
find_package(
Python
- COMPONENTS Interpreter Development.Module NumPy
+ COMPONENTS Interpreter Development NumPy
REQUIRED)
# F2PY headers
execute_process(
- COMMAND "${PYTHON_EXECUTABLE}" -c
+ COMMAND "${Python_EXECUTABLE}" -c
"import numpy.f2py; print(numpy.f2py.get_include())"
RESULT_VARIABLE GET_INCLUDE_FAILED
OUTPUT_VARIABLE F2PY_INCLUDE_DIR
@@ -124,42 +107,11 @@ target_link_libraries(fortranobject PUBLIC Python::NumPy)
target_include_directories(fortranobject PUBLIC "${F2PY_INCLUDE_DIR}")
set_property(TARGET fortranobject PROPERTY POSITION_INDEPENDENT_CODE ON)
-find_package(H5PY)
-find_package(MPI4PY)
-find_package(SCIPY 0.10)
-IF(NOT SCIPY_FOUND)
- install_via_pip("scipy" ERRORCODE)
- if (${ERRORCODE})
- MESSAGE(FATAL_ERROR "Couldn't install scipy -> ABORTING!!!")
- endif()
-ENDIF()
-find_package(CONFIGOBJ)
-if(NOT H5PY_FOUND)
- install_via_pip("h5py" ERRORCODE)
- if (${ERRORCODE})
- MESSAGE(FATAL_ERROR "Couldn't install H5PY -> ABORTING!!!")
- endif()
-endif()
-if(NUMPY_VERSION VERSION_GREATER "1.17.99" AND SCIPY_VERSION VERSION_LESS "1.0.0")
- # automatic installation of h5py via pip can also pull in quite
- # new versions of numpy as dependencies...
- install_via_pip("scipy>=1.0.0" ERRORCODE)
- if (${ERRORCODE})
- message(WARNING "Your versions of numpy and scipy are incompatible and updating scipy automatically failed. You will not be able to run w2dynamics before updating scipy.")
- endif()
-endif()
-if(NOT MPI4PY_FOUND AND MPI_Fortran_FOUND)
- install_via_pip("mpi4py" ERRORCODE)
- if (${ERRORCODE})
- MESSAGE(FATAL_ERROR "Couldn't install MPI4PY -> ABORTING!!!")
- endif()
-endif()
-if(NOT CONFIGOBJ_FOUND)
- install_via_pip("configobj" ERRORCODE)
- if (${ERRORCODE})
- MESSAGE(FATAL_ERROR "Couldn't install configobj(required for DMFT.py) -> ABORTING!!!")
- endif()
-endif()
+find_package(H5PY REQUIRED)
+find_package(HDF5 1.6 COMPONENTS Fortran)# enforce the availability of the Fortran bindings. FIXME: Test on a suitable computer
+find_package(MPI4PY REQUIRED)
+find_package(SCIPY 0.10 REQUIRED)
+find_package(CONFIGOBJ REQUIRED)
# Define the executable name
SET(CTQMCEXE ctqmc)
@@ -200,7 +152,7 @@ enable_testing()
message(STATUS "Configuration for installation (optional):")
# default / fallback paths relative to CMAKE_INSTALL_PREFIX
-set(INSTALL_PATH_SITE_PACKAGES "lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages")
+set(INSTALL_PATH_SITE_PACKAGES "lib/python${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}/site-packages")
set(INSTALL_PATH_SCRIPTS "bin")
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
@@ -246,7 +198,7 @@ option(INSTALL_EXECUTABLES "Install executable scripts DMFT.py, cthyb, Maxent.py
message(STATUS "Installing executable scripts DMFT.py, cthyb, Maxent.py, hgrep (option INSTALL_EXECUTABLES): ${INSTALL_EXECUTABLES}")
install(DIRECTORY w2dyn
- DESTINATION "${INSTALL_PATH_SITE_PACKAGES}"
+ DESTINATION ${INSTALL_PATH_SITE_PACKAGES}
COMPONENT Python_Package)
if(INSTALL_EXECUTABLES)
set(SCRIPT_FILES DMFT.py cthyb hgrep Maxent.py)
diff --git a/cmake/Modules/FindCONFIGOBJ.cmake b/cmake/Modules/FindCONFIGOBJ.cmake
index 4f4a9ee..59a81bc 100644
--- a/cmake/Modules/FindCONFIGOBJ.cmake
+++ b/cmake/Modules/FindCONFIGOBJ.cmake
@@ -10,17 +10,17 @@
# Finding ConfigObj involves calling the Python interpreter
#Check wether we have already searched the Python interpreter
-if(NOT PYTHONINTERP_FOUND)
- find_package(PythonInterp REQUIRED)
+if(NOT Python_FOUND)
+ find_package(Python REQUIRED)
endif()
execute_process(COMMAND
- "${PYTHON_EXECUTABLE}" "-c" "exec(\"try:\\n import configobj;\\n print(configobj.__version__);\\nexcept:\\n exit(1)\")"
+ "${Python_EXECUTABLE}" "-c" "exec(\"try:\\n import configobj;\\n print(configobj.__version__);\\nexcept:\\n exit(1)\")"
OUTPUT_VARIABLE CONFIGOBJ_VERSION
RESULT_VARIABLE CONFIGOBJ_COMMAND_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE)
-if(NOT CONFIGOBJ_FOUND AND PYTHONINTERP_FOUND)
+if(NOT CONFIGOBJ_FOUND AND Python_FOUND)
# if(NOT CONFIGOBJ_COMMAND_RESULT MATCHES 0)
# message("ConfigObj import failure:\n${_H5PY_ERROR_VALUE}")
# endif()
@@ -35,7 +35,7 @@ if(NOT CONFIGOBJ_FOUND AND PYTHONINTERP_FOUND)
math(EXPR CONFIGOBJ_VERSION_DECIMAL
"(${CONFIGOBJ_VERSION_MAJOR} * 10000) + (${CONFIGOBJ_VERSION_MINOR} * 100) + ${CONFIGOBJ_VERSION_PATCH}")
endif(CONFIGOBJ_COMMAND_RESULT MATCHES 0)
-endif(NOT CONFIGOBJ_FOUND AND PYTHONINTERP_FOUND)
+endif(NOT CONFIGOBJ_FOUND AND Python_FOUND)
find_package_handle_standard_args( CONFIGOBJ
REQUIRED_VARS CONFIGOBJ_VERSION
diff --git a/cmake/Modules/FindH5PY.cmake b/cmake/Modules/FindH5PY.cmake
index 34ddcdd..2ddedb9 100644
--- a/cmake/Modules/FindH5PY.cmake
+++ b/cmake/Modules/FindH5PY.cmake
@@ -11,13 +11,13 @@
# Finding H5Py involves calling the Python interpreter
#Check wether we have already searched the Python interpreter
-if(NOT PYTHONINTERP_FOUND)
- find_package(PythonInterp REQUIRED)
+if(NOT Python_FOUND)
+ find_package(Python REQUIRED)
endif()
-if(NOT H5PY_FOUND AND PYTHONINTERP_FOUND)
+if(NOT H5PY_FOUND AND Python_FOUND)
execute_process(COMMAND
- "${PYTHON_EXECUTABLE}" "-c" "exec(\"try:\\n import h5py;\\n print(h5py.version.version);\\nexcept:\\n exit(1)\")"
+ "${Python_EXECUTABLE}" "-c" "exec(\"try:\\n import h5py;\\n print(h5py.version.version);\\nexcept:\\n exit(1)\")"
OUTPUT_VARIABLE _H5PY_VALUES
RESULT_VARIABLE H5PY_COMMAND_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -44,7 +44,7 @@ if(NOT H5PY_FOUND AND PYTHONINTERP_FOUND)
"(${H5PY_VERSION_MAJOR} * 10000) + (${H5PY_VERSION_MINOR} * 100) + ${H5PY_VERSION_PATCH}")
endif(H5PY_COMMAND_RESULT MATCHES 0)
-endif(NOT H5PY_FOUND AND PYTHONINTERP_FOUND)
+endif(NOT H5PY_FOUND AND Python_FOUND)
find_package_handle_standard_args( H5PY
REQUIRED_VARS H5PY_VERSION
diff --git a/cmake/Modules/FindMPI4PY.cmake b/cmake/Modules/FindMPI4PY.cmake
index 1e797e2..6b98e20 100644
--- a/cmake/Modules/FindMPI4PY.cmake
+++ b/cmake/Modules/FindMPI4PY.cmake
@@ -11,13 +11,13 @@
# Finding mpi4Py involves calling the Python interpreter
#Check wether we have already searched the Python interpreter
-if(NOT PYTHONINTERP_FOUND)
- find_package(PythonInterp REQUIRED)
+if(NOT Python_FOUND)
+ find_package(Python REQUIRED)
endif()
-if(NOT MPI4PY_FOUND AND PYTHONINTERP_FOUND)
+if(NOT MPI4PY_FOUND AND Python_FOUND)
execute_process(COMMAND
- "${PYTHON_EXECUTABLE}" "-c" "exec(\"try:\\n import mpi4py;\\n print(mpi4py.__version__);\\n print(mpi4py.get_include())\\nexcept:\\n exit(1)\")"
+ "${Python_EXECUTABLE}" "-c" "exec(\"try:\\n import mpi4py;\\n print(mpi4py.__version__);\\n print(mpi4py.get_include())\\nexcept:\\n exit(1)\")"
OUTPUT_VARIABLE _MPI4PY_VALUES
RESULT_VARIABLE MPI4PY_COMMAND_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -44,7 +44,7 @@ if(NOT MPI4PY_FOUND AND PYTHONINTERP_FOUND)
"(${MPI4PY_VERSION_MAJOR} * 10000) + (${MPI4PY_VERSION_MINOR} * 100)")
endif(MPI4PY_COMMAND_RESULT MATCHES 0)
-endif(NOT MPI4PY_FOUND AND PYTHONINTERP_FOUND)
+endif(NOT MPI4PY_FOUND AND Python_FOUND)
find_package_handle_standard_args( MPI4PY
REQUIRED_VARS MPI4PY_INCLUDE_DIRS
diff --git a/cmake/Modules/FindNUMPY.cmake b/cmake/Modules/FindNUMPY.cmake
index 0510573..296d73f 100644
--- a/cmake/Modules/FindNUMPY.cmake
+++ b/cmake/Modules/FindNUMPY.cmake
@@ -12,13 +12,13 @@
# Finding NumPy involves calling the Python interpreter
#Check wether we have already searched the Python interpreter
-if(NOT PYTHONINTERP_FOUND)
- find_package(PythonInterp REQUIRED)
+if(NOT Python_FOUND)
+ find_package(Python REQUIRED)
endif()
-if(NOT NUMPY_FOUND AND PYTHONINTERP_FOUND)
+if(NOT NUMPY_FOUND AND Python_FOUND)
execute_process(COMMAND
- "${PYTHON_EXECUTABLE}" "-c" "exec(\"try:\\n import numpy;\\n print(numpy.__version__);\\n print(numpy.get_include())\\nexcept:\\n exit(1)\")"
+ "${Python_EXECUTABLE}" "-c" "exec(\"try:\\n import numpy;\\n print(numpy.__version__);\\n print(numpy.get_include())\\nexcept:\\n exit(1)\")"
OUTPUT_VARIABLE _NUMPY_VALUES
RESULT_VARIABLE NUMPY_COMMAND_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -43,7 +43,7 @@ if(NOT NUMPY_FOUND AND PYTHONINTERP_FOUND)
"(${NUMPY_VERSION_MAJOR} * 10000) + (${NUMPY_VERSION_MINOR} * 100) + ${NUMPY_VERSION_PATCH}")
endif(NUMPY_COMMAND_RESULT MATCHES 0)
-endif(NOT NUMPY_FOUND AND PYTHONINTERP_FOUND)
+endif(NOT NUMPY_FOUND AND Python_FOUND)
find_package_handle_standard_args( NUMPY
REQUIRED_VARS NUMPY_INCLUDE_DIRS
diff --git a/cmake/Modules/FindSCIPY.cmake b/cmake/Modules/FindSCIPY.cmake
index b56f9c2..5583a7d 100644
--- a/cmake/Modules/FindSCIPY.cmake
+++ b/cmake/Modules/FindSCIPY.cmake
@@ -11,13 +11,13 @@
# Finding SciPy involves calling the Python interpreter
#Check wether we have already searched the Python interpreter
-if(NOT PYTHONINTERP_FOUND)
- find_package(PythonInterp REQUIRED)
+if(NOT Python_FOUND)
+ find_package(Python REQUIRED)
endif()
-if(NOT SCIPY_FOUND AND PYTHONINTERP_FOUND)
+if(NOT SCIPY_FOUND AND Python_FOUND)
execute_process(COMMAND
- "${PYTHON_EXECUTABLE}" "-c" "exec(\"try:\\n import numpy;\\n import scipy;\\n print(scipy.__version__);\\n print(numpy.get_include())\\nexcept:\\n exit(1)\")"
+ "${Python_EXECUTABLE}" "-c" "exec(\"try:\\n import numpy;\\n import scipy;\\n print(scipy.__version__);\\n print(numpy.get_include())\\nexcept:\\n exit(1)\")"
OUTPUT_VARIABLE _SCIPY_VALUES
RESULT_VARIABLE SCIPY_COMMAND_RESULT
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -39,12 +39,11 @@ if(NOT SCIPY_FOUND AND PYTHONINTERP_FOUND)
list(GET _SCIPY_VERSION_LIST 0 SCIPY_VERSION_MAJOR)
list(GET _SCIPY_VERSION_LIST 1 SCIPY_VERSION_MINOR)
list(GET _SCIPY_VERSION_LIST 2 SCIPY_VERSION_PATCH)
- string(REGEX MATCH "[0-9]*" NUMPY_VERSION_PATCH ${NUMPY_VERSION_PATCH})
math(EXPR SCIPY_VERSION_DECIMAL
"(${SCIPY_VERSION_MAJOR} * 10000) + (${SCIPY_VERSION_MINOR} * 100) + ${SCIPY_VERSION_PATCH}")
endif(SCIPY_COMMAND_RESULT MATCHES 0)
-endif(NOT SCIPY_FOUND AND PYTHONINTERP_FOUND)
+endif(NOT SCIPY_FOUND AND Python_FOUND)
find_package_handle_standard_args( SCIPY
REQUIRED_VARS SCIPY_INCLUDE_DIRS
diff --git a/cmake/Modules/UseF2Py.cmake b/cmake/Modules/UseF2Py.cmake
index d5f985e..7e81aa9 100644
--- a/cmake/Modules/UseF2Py.cmake
+++ b/cmake/Modules/UseF2Py.cmake
@@ -19,10 +19,10 @@
# | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
# +-----------------------------------------------------------------------------+
-find_package(PythonInterp REQUIRED)
+find_package(Python REQUIRED)
if (NOT F2PY_SUFFIX)
- execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX') or sysconfig.get_config_var('SO'))"
+ execute_process(COMMAND "${Python_EXECUTABLE}" -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX') or sysconfig.get_config_var('SO'))"
OUTPUT_VARIABLE PYTHON_EXT_SUFFIX
RESULT_VARIABLE FOUND_PYTHON_EXT_SUFFIX)
if (NOT ${FOUND_PYTHON_EXT_SUFFIX} EQUAL 0)
@@ -98,7 +98,7 @@ macro (add_f2py_module _name)
# output will be a shared library that can be imported by python.
if ( "${_srcs}" MATCHES "^[^;]*\\.pyf;" )
add_custom_command(OUTPUT "${_name}${F2PY_SUFFIX}"
- COMMAND ${PYTHON_EXECUTABLE} -m numpy.f2py --quiet -m ${_name}
+ COMMAND ${Python_EXECUTABLE} -m numpy.f2py --quiet -m ${_name}
--build-dir "${CMAKE_CURRENT_BINARY_DIR}/f2py-${_name}"
${_fcompiler_opts} ${_inc_opts} -c ${_abs_srcs}
DEPENDS ${_srcs}
@@ -106,10 +106,10 @@ macro (add_f2py_module _name)
else ( "${_srcs}" MATCHES "^[^;]*\\.pyf;" )
add_custom_command(OUTPUT "${_name}${F2PY_SUFFIX}"
- COMMAND ${PYTHON_EXECUTABLE} -m numpy.f2py --quiet -m ${_name} -h ${_name}.pyf
+ COMMAND ${Python_EXECUTABLE} -m numpy.f2py --quiet -m ${_name} -h ${_name}.pyf
--build-dir "${CMAKE_CURRENT_BINARY_DIR}/f2py-${_name}"
--include-paths ${_inc_paths} --overwrite-signature ${_abs_srcs}
- COMMAND ${PYTHON_EXECUTABLE} -m numpy.f2py --quiet -m ${_name} -c "${CMAKE_CURRENT_BINARY_DIR}/f2py-${_name}/${_name}.pyf"
+ COMMAND ${Python_EXECUTABLE} -m numpy.f2py --quiet -m ${_name} -c "${CMAKE_CURRENT_BINARY_DIR}/f2py-${_name}/${_name}.pyf"
--build-dir "${CMAKE_CURRENT_BINARY_DIR}/f2py-${_name}"
${_fcompiler_opts} ${_inc_opts} ${_abs_srcs}
DEPENDS ${_srcs}
diff --git a/cmake/Modules/installviapip.cmake b/cmake/Modules/installviapip.cmake
index 8f26fa8..3aa6a1a 100644
--- a/cmake/Modules/installviapip.cmake
+++ b/cmake/Modules/installviapip.cmake
@@ -1,10 +1,10 @@
-if(NOT PYTHONINTERP_FOUND)
- find_package(PythonInterp REQUIRED)
+if(NOT Python_FOUND)
+ find_package(Python REQUIRED)
endif()
FUNCTION(INSTALL_VIA_PIP module RESULT_NAME)
#check for pip. The pip installer needs the python-xml module.
-execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pip freeze OUTPUT_VARIABLE PYTHON_PACKAGE_LIST)
+execute_process(COMMAND ${Python_EXECUTABLE} -m pip freeze OUTPUT_VARIABLE PYTHON_PACKAGE_LIST)
if ("${PYTHON_PACKAGE_LIST}" STREQUAL "")
execute_process(COMMAND pip freeze OUTPUT_VARIABLE PYTHON_PACKAGE_LIST)
if ("${PYTHON_PACKAGE_LIST}" STREQUAL "")
@@ -15,7 +15,7 @@ execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pip freeze OUTPUT_VARIABLE PYTHO
message(WARNING "CMake was not able to download pip. Trying with a direct call to curl")
execute_process(COMMAND curl -k https://bootstrap.pypa.io/get-pip.py -o get-pip.py RESULT_VARIABLE result)
endif()
- execute_process(COMMAND ${PYTHON_EXECUTABLE} ./get-pip.py --user RESULT_VARIABLE RES)
+ execute_process(COMMAND ${Python_EXECUTABLE} ./get-pip.py --user RESULT_VARIABLE RES)
# message(${RES})
if(${RES})#FIXME: Check wether this works for other versions...
message(WARNING "Not able to successfully execute Pip. assuming this is due to an old version of Python.")
@@ -37,7 +37,7 @@ execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pip freeze OUTPUT_VARIABLE PYTHO
message(STATUS "Installing ${module}")
-execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pip "install" "--user" ${module} RESULT_VARIABLE SUCCESS)
+execute_process(COMMAND ${Python_EXECUTABLE} -m pip "install" "--user" ${module} RESULT_VARIABLE SUCCESS)
if (NOT "${SUCCESS}" STREQUAL "0")
execute_process(COMMAND pip "install" "--user" ${module} RESULT_VARIABLE SUCCESS)
if (NOT "${SUCCESS}" STREQUAL "0")
diff --git a/testsuite/ctqmc.tests/CMakeLists.txt b/testsuite/ctqmc.tests/CMakeLists.txt
index 5c27ff4..403b464 100644
--- a/testsuite/ctqmc.tests/CMakeLists.txt
+++ b/testsuite/ctqmc.tests/CMakeLists.txt
@@ -1,5 +1,4 @@
cmake_minimum_required(VERSION 3.18)
-find_package(PythonLibs REQUIRED)
add_library(CTQMCMAIN STATIC ${SRCCTQMC}/CTQMC.F90)
set_property(TARGET CTQMCMAIN PROPERTY POSITION_INDEPENDENT_CODE ON)
target_link_libraries(CTQMCMAIN CTQMCLIB)
@@ -14,7 +13,7 @@ set_target_properties(${iter} PROPERTIES LINKER_LANGUAGE Fortran)
target_link_libraries(${iter} CTQMCMAIN)
target_link_libraries(${iter} CTQMCLIB)
target_link_libraries(${iter} mtrng)
-target_link_libraries(${iter} ${PYTHON_LIBRARIES})
+target_link_libraries(${iter} Python::Module)
target_link_libraries(${iter} ${LAPACK_LIBRARIES})
target_link_libraries(${iter} ${NFFT_LIBRARIES})
endforeach(iter)
diff --git a/testsuite/maxent.tests/CMakeLists.txt b/testsuite/maxent.tests/CMakeLists.txt
index 7b5f85f..9702d18 100644
--- a/testsuite/maxent.tests/CMakeLists.txt
+++ b/testsuite/maxent.tests/CMakeLists.txt
@@ -1,5 +1,4 @@
cmake_minimum_required(VERSION 3.18)
-find_package(PythonLibs REQUIRED)
add_library(MAXENTMAIN STATIC ${SRCMAXENT}/MaximumEntropy.F90)
set_property(TARGET MAXENTMAIN PROPERTY POSITION_INDEPENDENT_CODE ON)
target_link_libraries(MAXENTMAIN MAXENTLIB)
@@ -11,7 +10,7 @@ foreach(iter ${maxenttests})
set_target_properties(${iter} PROPERTIES LINKER_LANGUAGE Fortran)
target_link_libraries(${iter} MAXENTMAIN)
target_link_libraries(${iter} MAXENTLIB)
-target_link_libraries(${iter} ${PYTHON_LIBRARIES})
+target_link_libraries(${iter} Python::Module)
target_link_libraries(${iter} ${LAPACK_LIBRARIES})
endforeach(iter)
diff --git a/testsuite/w2dyn.tests/CMakeLists.txt b/testsuite/w2dyn.tests/CMakeLists.txt
index c592d91..18a3414 100644
--- a/testsuite/w2dyn.tests/CMakeLists.txt
+++ b/testsuite/w2dyn.tests/CMakeLists.txt
@@ -1,6 +1,5 @@
cmake_minimum_required(VERSION 3.18)
-find_package(PythonInterp REQUIRED)
enable_testing()
add_test(NAME 1-syntax_check
- COMMAND ${PYTHON_EXECUTABLE} -m compileall ${PROJECT_SOURCE_DIR})
+ COMMAND ${Python_EXECUTABLE} -m compileall ${PROJECT_SOURCE_DIR})