]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix our TBB version check. 9208/head
authorDavid Wells <drwells@email.unc.edu>
Tue, 31 Dec 2019 22:00:15 +0000 (17:00 -0500)
committerDavid Wells <drwells@email.unc.edu>
Tue, 31 Dec 2019 23:10:32 +0000 (18:10 -0500)
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
cmake/modules/FindTBB.cmake

index b039497a131dfea88b5cc7b4d21667487b1b24dd..dea761738a0010e5ca160cb7301ad5023be6d113 100644 (file)
@@ -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
index 68001253b2358ca189039809f78f30cd7dabe618..33c9b83d1d45fa9193fa3700b0eb8ec7559d6043 100644 (file)
@@ -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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.