From 1710fb86d392eb84696f021589dad8b621e3ea5f Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 18 Mar 2021 20:33:36 -0400 Subject: [PATCH] when using INTEL_LR_THREADS from C++11 we must add the threads library --- cmake/Modules/Packages/USER-INTEL.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/Packages/USER-INTEL.cmake b/cmake/Modules/Packages/USER-INTEL.cmake index ff0858f0ff..90ab6167a3 100644 --- a/cmake/Modules/Packages/USER-INTEL.cmake +++ b/cmake/Modules/Packages/USER-INTEL.cmake @@ -30,7 +30,12 @@ if(INTEL_LRT_MODE STREQUAL "THREADS") endif() endif() if(INTEL_LRT_MODE STREQUAL "C++11") - target_compile_definitions(lammps PRIVATE -DLMP_INTEL_USELRT -DLMP_INTEL_LRT11) + if(Threads_FOUND) + target_compile_definitions(lammps PRIVATE -DLMP_INTEL_USELRT -DLMP_INTEL_LRT11) + target_link_libraries(lammps PRIVATE Threads::Threads) + else() + message(FATAL_ERROR "Must have working threads library for Long-range thread support") + endif() endif() if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")