Skip to content
Snippets Groups Projects
Commit af60f962 authored by Mark W. Krentel's avatar Mark W. Krentel Committed by Todd Gamblin
Browse files

intel-tbb: Add `tm` variant to disable transactional memory. (#8799)

* intel-tbb: Add variant `tm` to disable transactional memory.

Some AMD or very old Intel systems don't support transactional memory. This commit adds a variant `tm` that defaults to `True`, but can be switched off to allow running on those systems.
parent 7902f3eb
No related branches found
No related tags found
No related merge requests found
Disable transactional memory. This is needed for some AMD or very old
Intel systems. See issue #6090.
diff -Naurb tbb-2018_U4.orig/include/tbb/tbb_config.h tbb-2018_U4/include/tbb/tbb_config.h
--- tbb-2018_U4.orig/include/tbb/tbb_config.h 2018-05-30 07:35:25.000000000 -0500
+++ tbb-2018_U4/include/tbb/tbb_config.h 2018-07-24 16:26:11.662673434 -0500
@@ -98,7 +98,7 @@
#define __TBB_DEFINE_MIC 1
#endif
-#define __TBB_TSX_AVAILABLE ((__TBB_x86_32 || __TBB_x86_64) && !__TBB_DEFINE_MIC)
+#define __TBB_TSX_AVAILABLE 0
/** Presence of compiler features **/
...@@ -73,6 +73,9 @@ class IntelTbb(Package): ...@@ -73,6 +73,9 @@ class IntelTbb(Package):
multi=False, multi=False,
description='Use the specified C++ standard when building.') description='Use the specified C++ standard when building.')
variant('tm', default=True,
description='Enable use of transactional memory on x86')
# Build and install CMake config files if we're new enough. # Build and install CMake config files if we're new enough.
depends_on('cmake@3.0.0:', type='build', when='@2017.0:') depends_on('cmake@3.0.0:', type='build', when='@2017.0:')
...@@ -84,6 +87,9 @@ class IntelTbb(Package): ...@@ -84,6 +87,9 @@ class IntelTbb(Package):
# Patch cmakeConfig.cmake.in to find the libraries where we install them. # Patch cmakeConfig.cmake.in to find the libraries where we install them.
patch("tbb_cmakeConfig.patch", level=0, when='@2017.0:') patch("tbb_cmakeConfig.patch", level=0, when='@2017.0:')
# Some very old systems don't support transactional memory.
patch("disable-tm.patch", when='~tm')
def url_for_version(self, version): def url_for_version(self, version):
url = 'https://github.com/01org/tbb/archive/{0}.tar.gz' url = 'https://github.com/01org/tbb/archive/{0}.tar.gz'
if (version[0] >= 2017) and len(version) > 1: if (version[0] >= 2017) and len(version) > 1:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment