diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 0f99cc6274..2fa3170415 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -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) diff --git a/cmake/Modules/Packages/USER-PLUMED.cmake b/cmake/Modules/Packages/USER-PLUMED.cmake index 500558fc72..f71d59901d 100644 --- a/cmake/Modules/Packages/USER-PLUMED.cmake +++ b/cmake/Modules/Packages/USER-PLUMED.cmake @@ -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)