From 80b13fe5a2eaefc77fa8c9266566fa8a2de91edf Mon Sep 17 00:00:00 2001 From: David Wells Date: Tue, 31 Dec 2019 17:00:15 -0500 Subject: [PATCH] Fix our TBB version check. Since the regular expression we used was eager it matched the 202 in 2020, yielding a version number of 0.0. Note that this worked with older versions of TBB since we would get, e.g., version 8.0 instead of version 2018.0. --- cmake/configure/configure_1_threads.cmake | 12 ++++++++++++ cmake/modules/FindTBB.cmake | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cmake/configure/configure_1_threads.cmake b/cmake/configure/configure_1_threads.cmake index b039497a13..dea761738a 100644 --- a/cmake/configure/configure_1_threads.cmake +++ b/cmake/configure/configure_1_threads.cmake @@ -149,6 +149,18 @@ MACRO(FEATURE_THREADS_FIND_EXTERNAL var) SET(${var} TRUE) ENDIF() + # + # TBB currently uses the version numbering scheme + # + # YYYY.X + # + # (e.g., 2018.0) where YYYY is the year of the release and X is the yearly + # release number. Older versions use + # + # X.Y.Z + # + # (e.g., 4.2.1). Since we are compatible with all versions that use the new + # numbering scheme we only check for very old versions here. # # TBB versions before 4.2 are missing some explicit calls to std::atomic::load # in ternary expressions; these cause compilation errors in some compilers diff --git a/cmake/modules/FindTBB.cmake b/cmake/modules/FindTBB.cmake index 68001253b2..33c9b83d1d 100644 --- a/cmake/modules/FindTBB.cmake +++ b/cmake/modules/FindTBB.cmake @@ -65,12 +65,12 @@ DEAL_II_FIND_PATH(TBB_INCLUDE_DIR tbb/tbb_stddef.h IF(EXISTS ${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h) FILE(STRINGS "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" TBB_VERSION_MAJOR_STRING REGEX "#define.*TBB_VERSION_MAJOR") - STRING(REGEX REPLACE "^.*TBB_VERSION_MAJOR.*([0-9]+).*" "\\1" + STRING(REGEX REPLACE "^.*TBB_VERSION_MAJOR +([0-9]+).*" "\\1" TBB_VERSION_MAJOR "${TBB_VERSION_MAJOR_STRING}" ) FILE(STRINGS "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" TBB_VERSION_MINOR_STRING REGEX "#define.*TBB_VERSION_MINOR") - STRING(REGEX REPLACE "^.*TBB_VERSION_MINOR.*([0-9]+).*" "\\1" + STRING(REGEX REPLACE "^.*TBB_VERSION_MINOR +([0-9]+).*" "\\1" TBB_VERSION_MINOR "${TBB_VERSION_MINOR_STRING}" ) SET(TBB_VERSION -- 2.39.5