summaryrefslogtreecommitdiff
path: root/Modules/FindLAPACK.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-21 14:26:18 -0400
committerBrad King <brad.king@kitware.com>2021-04-21 14:41:46 -0400
commitcb6889a09c8cd538a0856942e429fddc78dbd24e (patch)
treed42c72ba9ba1d2e2682855d7eb95de240a0f48c5 /Modules/FindLAPACK.cmake
parent193714d67ddddee36f7b5245e05d40b96f1de802 (diff)
downloadcmake-cb6889a09c8cd538a0856942e429fddc78dbd24e.tar.gz
FindLAPACK: Fix finding generic LAPACK with BLA_STATIC
Fixes: #21071
Diffstat (limited to 'Modules/FindLAPACK.cmake')
-rw-r--r--Modules/FindLAPACK.cmake10
1 files changed, 9 insertions, 1 deletions
diff --git a/Modules/FindLAPACK.cmake b/Modules/FindLAPACK.cmake
index 37ea1565a9..ab6214b48d 100644
--- a/Modules/FindLAPACK.cmake
+++ b/Modules/FindLAPACK.cmake
@@ -620,17 +620,25 @@ if(NOT LAPACK_NOT_FOUND_MESSAGE)
AND (BLA_VENDOR STREQUAL "Generic"
OR BLA_VENDOR STREQUAL "ATLAS"
OR BLA_VENDOR STREQUAL "All"))
+ if(BLA_STATIC)
+ # We do not know for sure how the LAPACK reference implementation
+ # is built on this host. Guess typical dependencies.
+ set(_lapack_generic_deps "-lgfortran;-lm")
+ else()
+ set(_lapack_generic_deps "")
+ endif()
check_lapack_libraries(
LAPACK_LIBRARIES
LAPACK
cheev
""
"lapack"
- ""
+ "${_lapack_generic_deps}"
""
""
"${BLAS_LIBRARIES}"
)
+ unset(_lapack_generic_deps)
endif()
endif()