From 3badbee4dd7d52e4e6b553c35b56c7ad03ab4cd9 Mon Sep 17 00:00:00 2001 From: conrad Date: Thu, 20 Jan 2022 22:06:25 +1000 Subject: [PATCH] don't link with LAPACK if OpenBLAS found and OPENBLAS_PROVIDES_LAPACK enabled --- CMakeLists.txt | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a039aa4..73c6cba7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -381,12 +381,12 @@ else() if(OpenBLAS_FOUND AND ATLAS_FOUND) message(STATUS "") - message(STATUS "*** WARNING: found both OpenBLAS and ATLAS; ATLAS will not be used") + message(STATUS "*** NOTE: found both OpenBLAS and ATLAS; ATLAS will not be used") endif() if(OpenBLAS_FOUND AND BLAS_FOUND) message(STATUS "") - message(STATUS "*** WARNING: found both OpenBLAS and BLAS; BLAS will not be used") + message(STATUS "*** NOTE: found both OpenBLAS and BLAS; BLAS will not be used") endif() if(OpenBLAS_FOUND) @@ -396,6 +396,11 @@ else() if(OPENBLAS_PROVIDES_LAPACK) set(ARMA_USE_LAPACK true) + else() + message(STATUS "") + message(STATUS "*** NOTE: if OpenBLAS is known to provide LAPACK functions,") + message(STATUS "*** NOTE: recommend to re-run the CMake installer") + message(STATUS "*** NOTE: with the OPENBLAS_PROVIDES_LAPACK option enabled.") endif() message(STATUS "") @@ -424,10 +429,17 @@ else() endif() if(LAPACK_FOUND) - set(ARMA_USE_LAPACK true) - set(ARMA_LIBS ${ARMA_LIBS} ${LAPACK_LIBRARIES}) + if(OpenBLAS_FOUND AND OPENBLAS_PROVIDES_LAPACK) + message(STATUS "*** NOTE: found both OpenBLAS and LAPACK;") + message(STATUS "*** NOTE: option OPENBLAS_PROVIDES_LAPACK is enabled,") + message(STATUS "*** NOTE: so will not link with plain LAPACK.") + message(STATUS "") + else() + set(ARMA_USE_LAPACK true) + set(ARMA_LIBS ${ARMA_LIBS} ${LAPACK_LIBRARIES}) + endif() endif() - + endif() endif()