Skip to content

Commit 90fd5b9

Browse files
committed
Add support mkl
1 parent 3254fd0 commit 90fd5b9

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

CMakeLists.txt

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,23 @@ option(FIND_BLAS "Find external BLAS and LAPACK" ON)
4646

4747
# --- find BLAS and LAPACK
4848
if(FIND_BLAS)
49-
find_package(BLAS)
49+
if(NOT BLAS_FOUND)
50+
#Required for MKL
51+
if(DEFINED ENV{MKLROOT} OR "${BLA_VENDOR}" MATCHES "^Intel")
52+
enable_language("C")
53+
endif()
54+
find_package("BLAS")
55+
endif()
5056
if(BLAS_FOUND)
5157
add_compile_definitions(STDLIB_EXTERNAL_BLAS)
5258
endif()
53-
find_package(LAPACK)
59+
if(NOT LAPACK_FOUND)
60+
#Required for MKL
61+
if(DEFINED ENV{MKLROOT} OR "${BLA_VENDOR}" MATCHES "^Intel")
62+
enable_language("C")
63+
endif()
64+
find_package("LAPACK")
65+
endif()
5466
if(LAPACK_FOUND)
5567
add_compile_definitions(STDLIB_EXTERNAL_LAPACK)
5668
endif()

src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ add_library(${PROJECT_NAME} ${SRC})
122122

123123
# Link to BLAS and LAPACK
124124
if(BLAS_FOUND)
125-
target_link_libraries(${PROJECT_NAME} BLAS::BLAS)
125+
target_link_libraries(${PROJECT_NAME} "BLAS::BLAS")
126126
endif()
127127
if(LAPACK_FOUND)
128-
target_link_libraries(${PROJECT_NAME} LAPACK::LAPACK)
128+
target_link_libraries(${PROJECT_NAME} "LAPACK::LAPACK")
129129
endif()
130130

131131
set_target_properties(

0 commit comments

Comments
 (0)