summaryrefslogtreecommitdiffstats
path: root/Modules/FindLAPACK.cmake
diff options
context:
space:
mode:
authorMario Emmenlauer <mario@emmenlauer.de>2020-01-31 10:29:58 (GMT)
committerMario Emmenlauer <mario@emmenlauer.de>2020-01-31 10:36:07 (GMT)
commit807a129f3c4c59d594aea5842d249ba35815d3fb (patch)
treede06dfb41f5935640973ed00b315453cfd55d6d6 /Modules/FindLAPACK.cmake
parentfe86dc43fec40e96ee6670a3a62a25da6c2667a5 (diff)
downloadCMake-807a129f3c4c59d594aea5842d249ba35815d3fb.zip
CMake-807a129f3c4c59d594aea5842d249ba35815d3fb.tar.gz
CMake-807a129f3c4c59d594aea5842d249ba35815d3fb.tar.bz2
Find{BLAS,LAPACK}: Include parent of points directory in search
This is required if MKLROOT points to the subdirectory .../mkl/ instead of the root of an Intel MKL library installation. Only in this case the MKL will be searched starting from the parent directory, to detect relevant dependencies in parallel subdirectories, like 'compiler' and 'tbb'.
Diffstat (limited to 'Modules/FindLAPACK.cmake')
-rw-r--r--Modules/FindLAPACK.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index 54b4866..c962976 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -268,6 +268,12 @@ if(BLAS_FOUND)
endif()
if(DEFINED ENV{MKLROOT})
set(LAPACK_mkl_MKLROOT "$ENV{MKLROOT}")
+ # If MKLROOT points to the subdirectory 'mkl', use the parent directory instead
+ # so we can better detect other relevant libraries in 'compiler' or 'tbb':
+ get_filename_component(LAPACK_mkl_MKLROOT_LAST_DIR "${LAPACK_mkl_MKLROOT}" NAME)
+ if(LAPACK_mkl_MKLROOT_LAST_DIR STREQUAL "mkl")
+ get_filename_component(LAPACK_mkl_MKLROOT "${LAPACK_mkl_MKLROOT}" DIRECTORY)
+ endif()
endif()
set(LAPACK_mkl_LIB_PATH_SUFFIXES
"compiler/lib" "compiler/lib/${LAPACK_mkl_ARCH_NAME}_${LAPACK_mkl_OS_NAME}"