summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark W. Krentel <krentel@rice.edu>2018-07-26 01:14:17 -0500
committerTodd Gamblin <tgamblin@llnl.gov>2018-07-25 23:14:17 -0700
commitaf60f962cdf5047bef2cd53ec72f38e033146aa4 (patch)
tree615313587e2e06b4787341ec41f86bf4a2c75066
parent7902f3eb49b616c681e6ca69d2ec70d1d1cbaa21 (diff)
downloadspack-af60f962cdf5047bef2cd53ec72f38e033146aa4.tar.gz
spack-af60f962cdf5047bef2cd53ec72f38e033146aa4.tar.bz2
spack-af60f962cdf5047bef2cd53ec72f38e033146aa4.tar.xz
spack-af60f962cdf5047bef2cd53ec72f38e033146aa4.zip
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.
-rw-r--r--var/spack/repos/builtin/packages/intel-tbb/disable-tm.patch15
-rw-r--r--var/spack/repos/builtin/packages/intel-tbb/package.py6
2 files changed, 21 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/intel-tbb/disable-tm.patch b/var/spack/repos/builtin/packages/intel-tbb/disable-tm.patch
new file mode 100644
index 0000000000..7ef0e93b78
--- /dev/null
+++ b/var/spack/repos/builtin/packages/intel-tbb/disable-tm.patch
@@ -0,0 +1,15 @@
+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 **/
+
diff --git a/var/spack/repos/builtin/packages/intel-tbb/package.py b/var/spack/repos/builtin/packages/intel-tbb/package.py
index ab486bf896..4e884dd0ab 100644
--- a/var/spack/repos/builtin/packages/intel-tbb/package.py
+++ b/var/spack/repos/builtin/packages/intel-tbb/package.py
@@ -73,6 +73,9 @@ class IntelTbb(Package):
multi=False,
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.
depends_on('cmake@3.0.0:', type='build', when='@2017.0:')
@@ -84,6 +87,9 @@ class IntelTbb(Package):
# Patch cmakeConfig.cmake.in to find the libraries where we install them.
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):
url = 'https://github.com/01org/tbb/archive/{0}.tar.gz'
if (version[0] >= 2017) and len(version) > 1: