summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Benda <jacob.benda@gmail.com>2018-11-18 20:16:39 (GMT)
committerJakub Benda <jacob.benda@gmail.com>2018-11-18 20:16:39 (GMT)
commitd5f691be0b78a48e836dc42b97d000ba151c44d6 (patch)
tree9d75c68e0344851bd25d129c9a8db77ba4ecfa8c
parent8b63265ea53dbd2e035a6b616ba0e82bfc0decc0 (diff)
downloadCMake-d5f691be0b78a48e836dc42b97d000ba151c44d6.zip
CMake-d5f691be0b78a48e836dc42b97d000ba151c44d6.tar.gz
CMake-d5f691be0b78a48e836dc42b97d000ba151c44d6.tar.bz2
FindLAPACK: Additional libraries for MKL+gfortran combination
As per Intel MKL command line advisor, "libdl" is added to the list of libraries that provide LAPACK functionality. Furthermore, the implicit link directories are added to the searched libraries to allow finding of "libgomp".
-rw-r--r--Modules/FindLAPACK.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index 89a1430..7619664 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -96,6 +96,9 @@ if (NOT _libdir)
set(_libdir ENV LD_LIBRARY_PATH)
endif ()
endif ()
+
+list(APPEND _libdir "${CMAKE_C_IMPLICIT_LINK_DIRECTORIES}")
+
foreach(_library ${_list})
set(_combined_name ${_combined_name}_${_library})
@@ -179,6 +182,7 @@ if(BLAS_FOUND)
if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
if (NOT WIN32)
set(LAPACK_mkl_LM "-lm")
+ set(LAPACK_mkl_LDL "-ldl")
endif ()
if (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED)
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
@@ -240,7 +244,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
""
"${IT}"
"${_BLAS_LIBRARIES}"
- "${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM}"
+ "${CMAKE_THREAD_LIBS_INIT};${LAPACK_mkl_LM};${LAPACK_mkl_LDL}"
)
endif ()
endforeach ()
@@ -248,6 +252,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All")
unset(LAPACK_mkl_ILP_MODE)
unset(LAPACK_mkl_SEARCH_SYMBOL)
unset(LAPACK_mkl_LM)
+ unset(LAPACK_mkl_LDL)
endif ()
endif()