summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-03-19 12:56:30 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-03-19 12:56:37 (GMT)
commit51a1a7e64f1d01a293eb848260925743f0fabf68 (patch)
tree3b8d1d5a1ec3a149d3bb70454b81f87922eff1e1 /Modules
parent0587c4b247626cda58e55f3bdc0adc8c09ac8e16 (diff)
parent90b775848913296af976d05dc82b8a45add4c6cf (diff)
downloadCMake-51a1a7e64f1d01a293eb848260925743f0fabf68.zip
CMake-51a1a7e64f1d01a293eb848260925743f0fabf68.tar.gz
CMake-51a1a7e64f1d01a293eb848260925743f0fabf68.tar.bz2
Merge topic 'FindBLAS-mklroot'
90b7758489 FindBLAS: respect MKLROOT and MKL_ROOT if available Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3108
Diffstat (limited to 'Modules')
-rw-r--r--Modules/FindBLAS.cmake26
1 files changed, 26 insertions, 0 deletions
diff --git a/Modules/FindBLAS.cmake b/Modules/FindBLAS.cmake
index 0aa4f50..bfa449f 100644
--- a/Modules/FindBLAS.cmake
+++ b/Modules/FindBLAS.cmake
@@ -83,6 +83,13 @@ This module defines the following variables:
set(BLA_VENDOR Intel10_64lp)
find_package(BLAS)
+
+Hints
+^^^^^
+
+Set ``MKLROOT`` environment variable to a directory that contains an MKL
+installation.
+
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/CheckFunctionExists.cmake)
@@ -394,6 +401,24 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
endif ()
endif ()
+ if (DEFINED ENV{MKLROOT})
+ set(_BLAS_MKLROOT_LIB_DIR "$ENV{MKLROOT}")
+ endif ()
+ if (_BLAS_MKLROOT_LIB_DIR)
+ if( SIZEOF_INTEGER EQUAL 8 )
+ set( _BLAS_MKL_PATH_PREFIX "intel64" )
+ else()
+ set( _BLAS_MKL_PATH_PREFIX "ia32" )
+ endif()
+ if (WIN32)
+ string(APPEND _BLAS_MKLROOT_LIB_DIR "/lib/${_BLAS_MKL_PATH_PREFIX}_win")
+ elseif (APPLE)
+ string(APPEND _BLAS_MKLROOT_LIB_DIR "/lib/${_BLAS_MKL_PATH_PREFIX}_mac")
+ else ()
+ string(APPEND _BLAS_MKLROOT_LIB_DIR "/lib/${_BLAS_MKL_PATH_PREFIX}_lin")
+ endif ()
+ endif ()
+
foreach (IT ${BLAS_SEARCH_LIBS})
string(REPLACE " " ";" SEARCH_LIBS ${IT})
if (NOT ${_LIBRARIES})
@@ -404,6 +429,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
""
"${SEARCH_LIBS}"
"${CMAKE_THREAD_LIBS_INIT};${BLAS_mkl_LM};${BLAS_mkl_LDL}"
+ "${_BLAS_MKLROOT_LIB_DIR}"
)
endif ()
endforeach ()