-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Driver.cmake
67 lines (67 loc) · 2.64 KB
/
Driver.cmake
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
if (BUILD_SHARED AND USE_MKL)
if (EXISTS ${MKLROOT}/lib/intel64)
link_directories(${MKLROOT}/lib/intel64)
else (EXISTS ${MKLROOT}/lib/intel64)
link_directories(${MKLROOT}/lib)
endif ()
if (MKLROOT MATCHES "(oneapi|oneAPI)")
if (COMPILER_IDENTIFIER MATCHES "linux")
find_library(IOMPPATH iomp5 PATHS
${MKLROOT}/../../compiler/latest/linux/compiler/lib/intel64_lin
${MKLROOT}/../../compiler/latest/lib
REQUIRED
)
get_filename_component(IOMPPATH ${IOMPPATH} DIRECTORY)
link_directories(${IOMPPATH})
if (USE_INTEL_OPENMP)
link_libraries(mkl_intel_lp64 mkl_intel_thread mkl_core iomp5 m)
else ()
link_libraries(mkl_intel_lp64 mkl_gnu_thread mkl_core gomp m)
endif ()
if (USE_MPI)
link_libraries(mkl_scalapack_lp64)
if (USE_INTEL_MPI)
link_libraries(mkl_blacs_intelmpi_lp64 impi impicxx)
else ()
link_libraries(mkl_blacs_openmpi_lp64 mpi_mpifh mpi)
endif ()
endif ()
elseif (COMPILER_IDENTIFIER MATCHES "win")
link_libraries(mkl_rt)
if (USE_MPI)
link_libraries(impi impicxx)
endif ()
elseif (COMPILER_IDENTIFIER MATCHES "vs")
find_library(IOMPPATH libiomp5md PATHS
${MKLROOT}/../../compiler/latest/windows/compiler/lib/intel64_win
${MKLROOT}/../../compiler/latest/lib
REQUIRED
)
get_filename_component(IOMPPATH ${IOMPPATH} DIRECTORY)
link_directories(${IOMPPATH})
set(DSUFIX "_dll")
if (BUILD_MULTITHREAD)
link_libraries(mkl_intel_lp64${DSUFIX} mkl_tbb_thread${DSUFIX} mkl_core${DSUFIX})
else ()
link_libraries(mkl_intel_lp64${DSUFIX} mkl_intel_thread${DSUFIX} mkl_core${DSUFIX} libiomp5md)
endif ()
if (USE_MPI)
link_libraries(mkl_scalapack_lp64 mkl_blacs_intelmpi_lp64 impi impicxx)
endif ()
endif ()
endif ()
else ()
if (NOT COMPILER_IDENTIFIER MATCHES "vs") # GCC OR CLANG COMPILER
find_library(HAS_QUADMATH quadmath)
if (HAS_QUADMATH)
link_libraries(quadmath)
endif ()
link_libraries(pthread gfortran openblas)
else () # MSVC COMPILER
if (USE_MPI)
link_libraries(mkl_scalapack_lp64 mkl_blacs_intelmpi_lp64)
else ()
link_libraries(libopenblas)
endif ()
endif ()
endif ()