1
- cmake_minimum_required (VERSION 3.13.0 )
1
+ cmake_minimum_required (VERSION 3.18 )
2
2
3
3
cmake_policy (SET CMP0076 NEW)
4
4
5
+ if (CMAKE_GNUtoMS_VCVARS OR MINGW)
6
+ set (CMAKE_GNUtoMS ON )
7
+ endif ()
8
+
5
9
project (suanPan C CXX)
6
10
7
11
set (CMAKE_C_STANDARD 11)
8
12
set (CMAKE_CXX_STANDARD 20)
9
13
set (CMAKE_CXX_STANDARD_REQUIRED ON )
10
14
set (CMAKE_INCLUDE_CURRENT_DIR ON )
11
15
set (CMAKE_POSITION_INDEPENDENT_CODE ON )
12
- if (CMAKE_GNUtoMS_VCVARS)
13
- set (CMAKE_GNUtoMS ON )
14
- endif ()
15
16
16
17
include (CheckLanguage)
17
18
check_language(Fortran)
@@ -263,16 +264,21 @@ if (COMPILER_IDENTIFIER MATCHES "(linux|mac)")
263
264
endif ()
264
265
endif ()
265
266
if (CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM" )
266
- set (ONEAPI_LIB $ENV{ONEAPI_ROOT} /compiler/latest/linux/compiler/lib/intel64_lin)
267
- file (GLOB ONEAPI_FILES
268
- ${ONEAPI_LIB} /libifcoremt${DECOR} *${SUFFIX}
269
- ${ONEAPI_LIB} /libifport${DECOR} *${SUFFIX}
270
- ${ONEAPI_LIB} /libimf${DECOR} *${SUFFIX}
271
- ${ONEAPI_LIB} /libintlc${DECOR} *${SUFFIX}
272
- ${ONEAPI_LIB} /libiomp5${DECOR} *${SUFFIX}
273
- ${ONEAPI_LIB} /libsvml${DECOR} *${SUFFIX}
267
+ set (PATH_LIST
268
+ $ENV{ONEAPI_ROOT} /compiler/latest/lib # since 2024
269
+ $ENV{ONEAPI_ROOT} /compiler/latest/linux/compiler/lib/intel64_lin # prior to 2024
274
270
)
275
- install (PROGRAMS ${ONEAPI_FILES} DESTINATION lib)
271
+ foreach (PATHA ${PATH_LIST} )
272
+ file (GLOB ONEAPI_FILES
273
+ ${PATHA} /libifcoremt${DECOR} *${SUFFIX}
274
+ ${PATHA} /libifport${DECOR} *${SUFFIX}
275
+ ${PATHA} /libimf${DECOR} *${SUFFIX}
276
+ ${PATHA} /libintlc${DECOR} *${SUFFIX}
277
+ ${PATHA} /libiomp5${DECOR} *${SUFFIX}
278
+ ${PATHA} /libsvml${DECOR} *${SUFFIX}
279
+ )
280
+ install (PROGRAMS ${ONEAPI_FILES} DESTINATION lib)
281
+ endforeach ()
276
282
endif ()
277
283
if (USE_MAGMA)
278
284
file (GLOB MAGMA_FILES ${MAGMAROOT} /lib/libmagma*.so)
@@ -287,15 +293,18 @@ elseif (COMPILER_IDENTIFIER MATCHES "win")
287
293
install (FILES ${TBB_FILES} DESTINATION bin)
288
294
endif ()
289
295
if (USE_MKL AND MKLROOT MATCHES "(oneapi|oneAPI)" )
290
- file (GLOB MKL_FILES ${MKLROOT} /redist/intel64/mkl_rt*)
291
- install (FILES ${MKL_FILES} DESTINATION bin)
292
- file (GLOB MKL_FILES ${MKLROOT} /redist/intel64/mkl_core*)
293
- install (FILES ${MKL_FILES} DESTINATION bin)
294
- file (GLOB MKL_FILES ${MKLROOT} /redist/intel64/mkl_def*)
295
- install (FILES ${MKL_FILES} DESTINATION bin)
296
- file (GLOB MKL_FILES ${MKLROOT} /redist/intel64/mkl_avx*)
297
- install (FILES ${MKL_FILES} DESTINATION bin)
298
- file (GLOB MKL_FILES ${MKLROOT} /redist/intel64/mkl_intel_thread.*)
296
+ file (GLOB MKL_FILES
297
+ ${MKLROOT} /redist/intel64/mkl_rt*
298
+ ${MKLROOT} /redist/intel64/mkl_core*
299
+ ${MKLROOT} /redist/intel64/mkl_def*
300
+ ${MKLROOT} /redist/intel64/mkl_avx*
301
+ ${MKLROOT} /redist/intel64/mkl_intel_thread.*
302
+ ${MKLROOT} /bin/mkl_rt*
303
+ ${MKLROOT} /bin/mkl_core*
304
+ ${MKLROOT} /bin/mkl_def*
305
+ ${MKLROOT} /bin/mkl_avx*
306
+ ${MKLROOT} /bin/mkl_intel_thread.*
307
+ )
299
308
install (FILES ${MKL_FILES} DESTINATION bin)
300
309
else ()
301
310
install (FILES Libs/win/libopenblas.dll DESTINATION bin)
@@ -308,28 +317,37 @@ elseif (COMPILER_IDENTIFIER MATCHES "vs")
308
317
endif ()
309
318
if (USE_MKL AND MKLROOT MATCHES "(oneapi|oneAPI)" )
310
319
if (LINK_DYNAMIC_MKL)
311
- file (GLOB MKL_FILES ${MKLROOT} /redist/intel64/mkl_core*)
312
- install (FILES ${MKL_FILES} DESTINATION bin)
313
- file (GLOB MKL_FILES ${MKLROOT} /redist/intel64/mkl_def*)
314
- install (FILES ${MKL_FILES} DESTINATION bin)
315
- file (GLOB MKL_FILES ${MKLROOT} /redist/intel64/mkl_avx*)
320
+ file (GLOB MKL_FILES
321
+ ${MKLROOT} /redist/intel64/mkl_core*
322
+ ${MKLROOT} /redist/intel64/mkl_def*
323
+ ${MKLROOT} /redist/intel64/mkl_avx*
324
+ ${MKLROOT} /bin/mkl_core*
325
+ ${MKLROOT} /bin/mkl_def*
326
+ ${MKLROOT} /bin/mkl_avx*
327
+ )
316
328
install (FILES ${MKL_FILES} DESTINATION bin)
317
329
if (BUILD_MULTITHREAD)
318
- file (GLOB MKL_FILES ${MKLROOT} /redist/intel64/mkl_tbb_thread.*)
330
+ file (GLOB MKL_FILES
331
+ ${MKLROOT} /redist/intel64/mkl_tbb_thread.*
332
+ ${MKLROOT} /bin/mkl_tbb_thread.*
333
+ )
319
334
install (FILES ${MKL_FILES} DESTINATION bin)
320
335
else ()
321
- file (GLOB MKL_FILES ${MKLROOT} /redist/intel64/mkl_intel_thread.*)
336
+ file (GLOB MKL_FILES
337
+ ${MKLROOT} /redist/intel64/mkl_intel_thread.*
338
+ ${MKLROOT} /bin/mkl_intel_thread.*
339
+ )
322
340
install (FILES ${MKL_FILES} DESTINATION bin)
323
341
endif ()
324
342
endif ()
325
343
if (USE_INTEL_OPENMP)
326
- find_file (libifcoremd libifcoremd.dll PATHS ${MKLROOT} /../../)
344
+ find_file (libifcoremd libifcoremd.dll PATHS ${MKLROOT} /../../ ${MKLROOT} /../../compiler/latest/bin/ REQUIRED )
327
345
install (FILES ${libifcoremd} DESTINATION bin)
328
- find_file (libiomp5md libiomp5md.dll PATHS ${MKLROOT} /../../)
346
+ find_file (libiomp5md libiomp5md.dll PATHS ${MKLROOT} /../../ ${MKLROOT} /../../compiler/latest/bin/ REQUIRED )
329
347
install (FILES ${libiomp5md} DESTINATION bin)
330
- find_file (libmmd libmmd.dll PATHS ${MKLROOT} /../../)
348
+ find_file (libmmd libmmd.dll PATHS ${MKLROOT} /../../ ${MKLROOT} /../../compiler/latest/bin/ REQUIRED )
331
349
install (FILES ${libmmd} DESTINATION bin)
332
- find_file (svml_dispmd svml_dispmd.dll PATHS ${MKLROOT} /../../)
350
+ find_file (svml_dispmd svml_dispmd.dll PATHS ${MKLROOT} /../../ ${MKLROOT} /../../compiler/latest/bin/ REQUIRED )
333
351
install (FILES ${svml_dispmd} DESTINATION bin)
334
352
endif ()
335
353
else ()
@@ -395,7 +413,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
395
413
set (CPACK_PACKAGE_ICON ${ROOT} /Resource /suanPan-ua.svg)
396
414
set (CPACK_PACKAGE_RELEASE 1)
397
415
set (CPACK_PACKAGE_VENDOR "tlcfem" )
398
- set (CPACK_PACKAGE_VERSION "3.2 .0" )
416
+ set (CPACK_PACKAGE_VERSION "3.3 .0" )
399
417
set (CPACK_PACKAGE_DESCRIPTION "An Open Source, Parallel and Heterogeneous Finite Element Analysis Framework" )
400
418
set (CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/TLCFEM/suanPan" )
401
419
0 commit comments