@@ -17,10 +17,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
17
17
include (CheckLanguage )
18
18
check_language (Fortran )
19
19
if (CMAKE_Fortran_COMPILER )
20
- set (FORTRAN_STATUS TRUE )
21
20
enable_language (Fortran )
22
- else ()
23
- set (FORTRAN_STATUS FALSE )
24
21
endif ()
25
22
26
23
set (ROOT ${CMAKE_CURRENT_SOURCE_DIR} )
@@ -67,9 +64,11 @@ else ()
67
64
set (SP_OPENBLAS_PATH "" CACHE PATH "Manually assign the path to the OpenBLAS library, if not set, the bundled version will be used." )
68
65
endif ()
69
66
if (SP_ENABLE_AOCL )
70
- set (AOCL_BLIS_PATH "${CMAKE_SOURCE_DIR} /Libs/linux/libblis-mt.a" CACHE FILEPATH "AOCL libblis path." )
71
- set (AOCL_FLAME_PATH "${CMAKE_SOURCE_DIR} /Libs/linux/libflame.a" CACHE FILEPATH "AOCL libflame path." )
72
- set (AOCL_UTILS_PATH "${CMAKE_SOURCE_DIR} /Libs/linux/libaoclutils.a" CACHE FILEPATH "AOCL libaoclutils path." )
67
+ set (AOCL_PATH "${CMAKE_SOURCE_DIR} /Libs/linux/libaocl.a" CACHE FILEPATH "AOCL all-in-one library path." )
68
+ if (NOT AOCL_PATH MATCHES "aocl" )
69
+ message (FATAL_ERROR "Please point AOCL_PATH to the all-in-one library file of AOCL." )
70
+ endif ()
71
+ add_compile_definitions (SUANPAN_AOCL )
73
72
endif ()
74
73
75
74
set (COMPILER_IDENTIFIER "unknown" )
@@ -105,8 +104,7 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin") # MAC PLATFORM
105
104
set (COMPILER_IDENTIFIER "clang-mac" )
106
105
include_directories ("/usr/local/include" "/usr/local/opt/llvm/include" "/usr/local/opt/libomp/include" )
107
106
link_directories ("/usr/local/lib" "/usr/local/opt/llvm/lib" "/usr/local/opt/libomp/lib/" )
108
- message (STATUS "On macOS, make sure llvm and libomp are installed." )
109
- message (STATUS "brew install llvm libomp" )
107
+ message (STATUS "On macOS, make sure `llvm` and `libomp` are installed." )
110
108
endif ()
111
109
endif ()
112
110
@@ -174,38 +172,16 @@ if (SP_ENABLE_MKL)
174
172
add_compile_definitions (SUANPAN_MKL )
175
173
add_compile_definitions (EZP_MKL )
176
174
# add_compile_definitions(ARMA_USE_MKL_ALLOC)
177
- elseif (FORTRAN_STATUS AND CMAKE_Fortran_COMPILER_ID MATCHES "Intel" )
175
+ elseif (CMAKE_Fortran_COMPILER_ID MATCHES "Intel" )
178
176
message (WARNING "Since Intel compilers are used, why not enabling MKL?" )
179
- else ()
180
- if (SP_ENABLE_64BIT_INDEXING )
181
- message (NOTICE "64-bit indexing is enabled, please make sure the linear algebra driver is compiled using 64-bit integer as well." )
182
- endif ()
183
- if (SP_ENABLE_AOCL )
184
- if (NOT AOCL_BLIS_PATH MATCHES "blis" )
185
- message (FATAL_ERROR "Please point AOCL_BLIS_PATH to the library file of BLIS." )
186
- endif ()
187
- if (NOT AOCL_FLAME_PATH MATCHES "flame" )
188
- message (FATAL_ERROR "Please point AOCL_FLAME_PATH to the library file of FLAME." )
189
- endif ()
190
- if (NOT AOCL_UTILS_PATH MATCHES "aoclutils" )
191
- message (FATAL_ERROR "Please point AOCL_UTILS_PATH to the library file of AOCL Utils." )
192
- endif ()
193
- add_compile_definitions (SUANPAN_AOCL )
194
- endif ()
177
+ elseif (SP_ENABLE_64BIT_INDEXING )
178
+ message (NOTICE "64-bit indexing is enabled, please make sure the linear algebra driver is compiled using 64-bit integer as well." )
195
179
endif ()
196
180
197
181
if (SP_ENABLE_CUDA )
198
- if (POLICY CMP0146 )
199
- cmake_policy (SET CMP0146 OLD )
200
- endif ()
201
- find_package (CUDA PATHS ${CUDA_PATH} )
202
- if (NOT CUDA_FOUND )
203
- set (CUDA_PATH "" CACHE PATH "CUDA library path that contains /include folder." )
204
- message (FATAL_ERROR "CUDA library is not found, please indicate its path." )
205
- endif ()
182
+ find_package (CUDAToolkit REQUIRED )
183
+ link_libraries (CUDA::cudart_static CUDA::cublas_static CUDA::cusolver_static CUDA::cusparse_static )
206
184
add_compile_definitions (SUANPAN_CUDA )
207
- include_directories (${CUDA_INCLUDE_DIRS} )
208
- link_libraries (${CUDA_LIBRARIES} ${CUDA_CUBLAS_LIBRARIES} ${CUDA_cusolver_LIBRARY} ${CUDA_cusparse_LIBRARY} )
209
185
if (SP_ENABLE_MAGMA )
210
186
set (MAGMAROOT "" CACHE PATH "Magma library path which contains /include and /lib folders." )
211
187
find_file (MAGMA_HEADER NAMES magma.h PATHS ${MAGMAROOT} /include )
@@ -279,6 +255,11 @@ if (SP_BUILD_PARALLEL)
279
255
endif ()
280
256
endif ()
281
257
258
+ if (CMAKE_BUILD_TYPE MATCHES "Rel" )
259
+ add_compile_definitions (ARMA_WARN_LEVEL=1 )
260
+ add_compile_definitions (ARMA_DONT_CHECK_CONFORMANCE )
261
+ endif ()
262
+
282
263
if (BUILD_SHARED_LIBS )
283
264
message (STATUS "BUILD SHARED LIBRARY" )
284
265
else ()
@@ -423,7 +404,7 @@ if (SP_ENABLE_MKL)
423
404
elseif (COMPILER_IDENTIFIER MATCHES "vs" )
424
405
link_libraries (libopenblas )
425
406
elseif (SP_ENABLE_AOCL )
426
- link_libraries (${AOCL_FLAME_PATH} ${AOCL_BLIS_PATH} ${AOCL_UTILS_PATH } )
407
+ link_libraries (${AOCL_PATH } )
427
408
else ()
428
409
link_libraries (openblas )
429
410
if (COMPILER_IDENTIFIER MATCHES "linux" )
@@ -433,26 +414,15 @@ endif ()
433
414
434
415
add_executable (${PROJECT_NAME}
435
416
suanPan.cpp
417
+ Include /catch/catch_amalgamated.cpp
436
418
Include /fmt/src/format.cc
437
419
Include /whereami/whereami.c
438
- Include /catch/catch_amalgamated.cpp
439
- Constraint/CMakeLists.txt
440
- Database/CMakeLists.txt
441
- Domain/CMakeLists.txt
442
- Load/CMakeLists.txt
443
- Recorder/CMakeLists.txt
444
- Step/CMakeLists.txt
445
- Toolbox/CMakeLists.txt
446
- UnitTest/CMakeLists.txt
447
420
)
448
421
449
422
set_property (TARGET ${PROJECT_NAME} PROPERTY ENABLE_EXPORTS 1 )
450
423
451
- if (COMPILER_IDENTIFIER MATCHES "vs" )
452
- target_link_options (${PROJECT_NAME} PRIVATE /NODEFAULTLIB:LIBCMT )
453
- endif ()
454
-
455
424
if (MSVC )
425
+ target_link_options (${PROJECT_NAME} PRIVATE "/NODEFAULTLIB:LIBCMT" )
456
426
target_compile_options (${PROJECT_NAME} PRIVATE "/bigobj" )
457
427
elseif (MINGW )
458
428
target_compile_options (${PROJECT_NAME} PRIVATE "-Wa,-mbig-obj" )
@@ -478,9 +448,7 @@ add_subdirectory(Step)
478
448
add_subdirectory (Toolbox )
479
449
add_subdirectory (UnitTest )
480
450
481
- target_link_libraries (${PROJECT_NAME} Element Material Section Solver )
482
-
483
- if (FORTRAN_STATUS )
451
+ if (CMAKE_Fortran_COMPILER )
484
452
message (STATUS "Linking additional amd arpack feast libraries." )
485
453
add_subdirectory (Toolbox/amd-src )
486
454
add_subdirectory (Toolbox/arpack-src )
@@ -565,38 +533,40 @@ if (COMPILER_IDENTIFIER MATCHES "(linux|mac)")
565
533
if (SP_ENABLE_SHARED_MKL )
566
534
file (GLOB MKL_FILES ${MKL_ROOT} /lib/intel64/libmkl_core${DECOR}*${SUFFIX} )
567
535
install (PROGRAMS ${MKL_FILES} DESTINATION lib )
568
- file (GLOB MKL_FILES ${MKL_ROOT} /lib/intel64/libmkl_intel_lp64${DECOR}*${SUFFIX} )
569
- install (PROGRAMS ${MKL_FILES} DESTINATION lib )
570
536
file (GLOB MKL_FILES ${MKL_ROOT} /lib/intel64/libmkl_def${DECOR}*${SUFFIX} )
571
537
install (PROGRAMS ${MKL_FILES} DESTINATION lib )
572
538
file (GLOB MKL_FILES ${MKL_ROOT} /lib/intel64/libmkl_avx*${DECOR}*${SUFFIX} )
573
539
install (PROGRAMS ${MKL_FILES} DESTINATION lib )
540
+ if (SP_ENABLE_64BIT_INDEXING )
541
+ file (GLOB MKL_FILES ${MKL_ROOT} /lib/intel64/libmkl_intel_ilp64${DECOR}*${SUFFIX} )
542
+ else ()
543
+ file (GLOB MKL_FILES ${MKL_ROOT} /lib/intel64/libmkl_intel_lp64${DECOR}*${SUFFIX} )
544
+ endif ()
545
+ install (PROGRAMS ${MKL_FILES} DESTINATION lib )
574
546
if (SP_ENABLE_IOMP )
575
547
file (GLOB MKL_FILES ${MKL_ROOT} /lib/intel64/libmkl_intel_thread${DECOR}*${SUFFIX} )
576
- install (PROGRAMS ${MKL_FILES} DESTINATION lib )
577
548
else ()
578
549
file (GLOB MKL_FILES ${MKL_ROOT} /lib/intel64/libmkl_gnu_thread${DECOR}*${SUFFIX} )
579
- install (PROGRAMS ${MKL_FILES} DESTINATION lib )
580
550
endif ()
551
+ install (PROGRAMS ${MKL_FILES} DESTINATION lib )
581
552
endif ()
582
553
if (SP_ENABLE_IOMP )
583
554
file (GLOB MKL_FILES ${IOMPPATH} /libiomp5${DECOR}*${SUFFIX} )
584
555
install (PROGRAMS ${MKL_FILES} DESTINATION lib )
585
556
endif ()
586
557
endif ()
587
558
if (CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM" )
588
- set ( PATH_LIST
559
+ foreach ( ONEAPI_PATH
589
560
$ENV{ONEAPI_ROOT} /compiler/latest/lib # since 2024
590
561
$ENV{ONEAPI_ROOT} /compiler/latest/linux/compiler/lib/intel64_lin # prior to 2024
591
562
)
592
- foreach (PATHA ${PATH_LIST} )
593
563
file (GLOB ONEAPI_FILES
594
- ${PATHA } /libifcoremt${DECOR}*${SUFFIX}
595
- ${PATHA } /libifport${DECOR}*${SUFFIX}
596
- ${PATHA } /libimf${DECOR}*${SUFFIX}
597
- ${PATHA } /libintlc${DECOR}*${SUFFIX}
598
- ${PATHA } /libiomp5${DECOR}*${SUFFIX}
599
- ${PATHA } /libsvml${DECOR}*${SUFFIX}
564
+ ${ONEAPI_PATH } /libifcoremt${DECOR}*${SUFFIX}
565
+ ${ONEAPI_PATH } /libifport${DECOR}*${SUFFIX}
566
+ ${ONEAPI_PATH } /libimf${DECOR}*${SUFFIX}
567
+ ${ONEAPI_PATH } /libintlc${DECOR}*${SUFFIX}
568
+ ${ONEAPI_PATH } /libiomp5${DECOR}*${SUFFIX}
569
+ ${ONEAPI_PATH } /libsvml${DECOR}*${SUFFIX}
600
570
)
601
571
install (PROGRAMS ${ONEAPI_FILES} DESTINATION lib )
602
572
endforeach ()
@@ -650,16 +620,10 @@ elseif (COMPILER_IDENTIFIER MATCHES "vs")
650
620
)
651
621
install (FILES ${MKL_FILES} DESTINATION bin )
652
622
endif ()
653
- if (SP_ENABLE_IOMP )
654
- find_file (libifcoremd libifcoremd.dll PATHS ${MKL_ROOT} /../../ ${MKL_ROOT} /../../compiler/latest/bin/ REQUIRED )
655
- install (FILES ${libifcoremd} DESTINATION bin )
656
- find_file (libiomp5md libiomp5md.dll PATHS ${MKL_ROOT} /../../ ${MKL_ROOT} /../../compiler/latest/bin/ REQUIRED )
657
- install (FILES ${libiomp5md} DESTINATION bin )
658
- find_file (libmmd libmmd.dll PATHS ${MKL_ROOT} /../../ ${MKL_ROOT} /../../compiler/latest/bin/ REQUIRED )
659
- install (FILES ${libmmd} DESTINATION bin )
660
- find_file (svml_dispmd svml_dispmd.dll PATHS ${MKL_ROOT} /../../ ${MKL_ROOT} /../../compiler/latest/bin/ REQUIRED )
661
- install (FILES ${svml_dispmd} DESTINATION bin )
662
- endif ()
623
+ foreach (IOMP_DLL libifcoremd libiomp5md libmmd svml_dispmd )
624
+ find_file (IOMP_${IOMP_DLL} ${IOMP_DLL} .dll PATHS ${MKL_ROOT} /../../ ${MKL_ROOT} /../../compiler/latest/bin/ REQUIRED NO_DEFAULT_PATH )
625
+ install (FILES ${IOMP_${IOMP_DLL}} DESTINATION bin )
626
+ endforeach ()
663
627
else ()
664
628
file (GLOB DLL_FILES Libs/win/lib*.dll )
665
629
install (FILES ${DLL_FILES} DESTINATION bin )
@@ -671,7 +635,7 @@ endif ()
671
635
message (STATUS "Flags and Dirs:" )
672
636
message (STATUS "suanPan C_FLAGS: ${CMAKE_C_FLAGS} " )
673
637
message (STATUS "suanPan CXX_FLAGS: ${CMAKE_CXX_FLAGS} " )
674
- if (FORTRAN_STATUS )
638
+ if (CMAKE_Fortran_COMPILER )
675
639
message (STATUS "suanPan Fortran_FLAGS: ${CMAKE_Fortran_FLAGS} " )
676
640
endif ()
677
641
@@ -712,7 +676,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
712
676
set (CPACK_PACKAGE_ICON ${ROOT} /Resource/suanPan-ua.svg )
713
677
set (CPACK_PACKAGE_RELEASE 1 )
714
678
set (CPACK_PACKAGE_VENDOR "tlcfem" )
715
- set (CPACK_PACKAGE_VERSION "3.7.0 " )
679
+ set (CPACK_PACKAGE_VERSION "3.7.1 " )
716
680
set (CPACK_PACKAGE_DESCRIPTION "An Open Source, Parallel and Heterogeneous Finite Element Analysis Framework" )
717
681
set (CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/TLCFEM/suanPan" )
718
682
0 commit comments