diff options
author | Brad King <brad.king@kitware.com> | 2019-06-18 11:58:21 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-06-18 11:58:48 (GMT) |
commit | 7af2dedc0895e0ba685b49092c7ec48b3468e833 (patch) | |
tree | c6d6d0965c7ba22dc7014dcaba3f6def72970573 /Modules | |
parent | 1b5a7adf5e5b9343f6f6dc608b1dee0b17316af8 (diff) | |
parent | 68dcbeee01a301876011a8310509e3860cbb9b34 (diff) | |
download | CMake-7af2dedc0895e0ba685b49092c7ec48b3468e833.zip CMake-7af2dedc0895e0ba685b49092c7ec48b3468e833.tar.gz CMake-7af2dedc0895e0ba685b49092c7ec48b3468e833.tar.bz2 |
Merge topic 'implicit_lapack_library'
68dcbeee01 FindLAPACK: Test for implicitly linked LAPACK libraries
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3451
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindLAPACK.cmake | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake index c9c3cce..844d36d 100644 --- a/Modules/FindLAPACK.cmake +++ b/Modules/FindLAPACK.cmake @@ -173,11 +173,15 @@ if(_libraries_work) #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") endif() -if(_libraries_work) - set(${LIBRARIES} ${${LIBRARIES}} ${_blas} ${_threads}) -else() - set(${LIBRARIES} FALSE) -endif() + if(_libraries_work) + if("${_list}" STREQUAL "") + set(${LIBRARIES} "${LIBRARIES}-PLACEHOLDER-FOR-EMPTY-LIBRARIES") + else() + set(${LIBRARIES} ${${LIBRARIES}} ${_blas} ${_threads}) + endif() + else() + set(${LIBRARIES} FALSE) + endif() endmacro() @@ -206,6 +210,7 @@ if(BLAS_FOUND) #intel lapack if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") + if(NOT LAPACK_LIBRARIES) if (NOT WIN32) set(LAPACK_mkl_LM "-lm") set(LAPACK_mkl_LDL "-ldl") @@ -280,6 +285,7 @@ if (BLA_VENDOR MATCHES "Intel" OR BLA_VENDOR STREQUAL "All") unset(LAPACK_mkl_LM) unset(LAPACK_mkl_LDL) endif () + endif() endif() if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") @@ -426,5 +432,11 @@ else() endif() endif() +# On compilers that implicitly link LAPACK (such as ftn, cc, and CC on Cray HPC machines) +# we used a placeholder for empty LAPACK_LIBRARIES to get through our logic above. +if (LAPACK_LIBRARIES STREQUAL "LAPACK_LIBRARIES-PLACEHOLDER-FOR-EMPTY-LIBRARIES") + set(LAPACK_LIBRARIES "") +endif() + cmake_pop_check_state() set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) |