only search for LAPACK when building in static mode and when it is not needed for something else

This commit is contained in:
Axel Kohlmeyer 2019-07-24 16:01:46 -04:00
parent f4df51763d
commit 24d9c537c0
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
2 changed files with 7 additions and 2 deletions

View File

@ -219,8 +219,7 @@ if(BUILD_OMP)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
if(PKG_MSCG OR PKG_USER-ATC OR PKG_USER-AWPMD OR PKG_USER-PLUMED OR PKG_USER-QUIP OR PKG_LATTE)
if(PKG_MSCG OR PKG_USER-ATC OR PKG_USER-AWPMD OR PKG_USER-QUIP OR PKG_LATTE)
find_package(LAPACK)
find_package(BLAS)
if(NOT LAPACK_FOUND OR NOT BLAS_FOUND)

View File

@ -6,6 +6,12 @@ if(PKG_USER-PLUMED)
validate_option(PLUMED_MODE PLUMED_MODE_VALUES)
string(TOUPPER ${PLUMED_MODE} PLUMED_MODE)
if((PLUMED_MODE STREQUAL "STATIC") AND NOT LAPACK_LIBRARIES)
find_package(LAPACK REQUIRED)
find_package(BLAS REQUIRED)
list(APPEND LAPACK_LIBRARIES ${BLAS_LIBRARIES})
endif()
find_package(PkgConfig QUIET)
set(DOWNLOAD_PLUMED_DEFAULT ON)
if(PKG_CONFIG_FOUND)