-
Notifications
You must be signed in to change notification settings - Fork 1
/
FindMKL.cmake
62 lines (50 loc) · 1.35 KB
/
FindMKL.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
if (MKL_LIBRARIES)
set(MKL_FIND_QUIETLY TRUE)
endif (MKL_LIBRARIES)
if(CMAKE_MINOR_VERSION GREATER 4)
if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
find_library(MKL_LIBRARIES
mkl_rt
HINTS
$ENV{MKLLIB}
$ENV{MKLROOT}/lib/intel64
$ENV{MKL_HOME}/lib/intel64
/opt/mkl-*/lib/em64t
/opt/intel/mkl/*/lib/em64t
/opt/intel/Compiler/*/*/mkl/lib/em64t
${LIB_INSTALL_DIR}
)
if(MKL_LIBRARIES)
set(MKL_LIBRARIES ${MKL_LIBRARIES} mkl_intel_ilp64 mkl_intel_thread mkl_core pthread m)
endif()
else(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
find_library(MKL_LIBRARIES
mkl_core
HINTS
$ENV{MKLLIB}
/opt/mkl-*/lib/32
/opt/intel/mkl/*/lib/32
/opt/intel/Compiler/*/*/mkl/lib/32
${LIB_INSTALL_DIR}
)
if(MKL_LIBRARIES)
set(MKL_LIBRARIES ${MKL_LIBRARIES} mkl_intel mkl_intel_thread mkl_core pthread m)
add_definitions(-DMKL_ILP64)
endif()
endif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")
find_path(MKL_INCLUDE_DIR
NAMES mkl.h
HINTS
$ENV{MKLINCLUDE}
$ENV{MKLROOT}/include
$ENV{MKL_HOME}/include
/opt/mkl-*/
/opt/intel/mkl/*/
/opt/intel/Compiler/*/*/mkl/
${CMAKE_INSTALL_PREFIX}/include
PATH_SUFFIXES include
)
endif(CMAKE_MINOR_VERSION GREATER 4)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MKL DEFAULT_MSG MKL_LIBRARIES MKL_INCLUDE_DIR)
mark_as_advanced(MKL_LIBRARIES MKL_INCLUDE_DIR)