summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Rood <jon.rood@nrel.gov>2019-07-29 13:23:15 -0600
committerPeter Scheibel <scheibel1@llnl.gov>2019-07-29 12:23:15 -0700
commit3e02dc258bd6e9f4d4e604f21c482bf2005ab662 (patch)
tree802f62e7e798145243969b253d05e1ed46ab3594
parentee1c36a2b02e7e9d0b26ebd000074c0b97bda416 (diff)
downloadspack-3e02dc258bd6e9f4d4e604f21c482bf2005ab662.tar.gz
spack-3e02dc258bd6e9f4d4e604f21c482bf2005ab662.tar.bz2
spack-3e02dc258bd6e9f4d4e604f21c482bf2005ab662.tar.xz
spack-3e02dc258bd6e9f4d4e604f21c482bf2005ab662.zip
LLVM package: add optional libomp_tsan support (#11793)
This is only available for LLVM version 6 or greater. So this also adds a conflict statement for earlier versions of LLVM.
-rw-r--r--var/spack/repos/builtin/packages/llvm/package.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py
index d319da702b..c45928c9fe 100644
--- a/var/spack/repos/builtin/packages/llvm/package.py
+++ b/var/spack/repos/builtin/packages/llvm/package.py
@@ -66,6 +66,8 @@ class Llvm(CMakePackage):
variant('build_type', default='Release',
description='CMake build type',
values=('Debug', 'Release', 'RelWithDebInfo', 'MinSizeRel'))
+ variant('omp_tsan', default=False,
+ description="Build with OpenMP capable thread sanitizer")
variant('python', default=False, description="Install python bindings")
extends('python', when='+python')
@@ -576,6 +578,9 @@ class Llvm(CMakePackage):
conflicts('%gcc@8:', when='@:5')
conflicts('%gcc@:5.0.999', when='@8:')
+ # OMP TSAN exists in > 5.x
+ conflicts('+omp_tsan', when='@:5.99')
+
# Github issue #4986
patch('llvm_gcc7.patch', when='@4.0.0:4.0.1+lldb %gcc@7.0:')
@@ -689,6 +694,9 @@ class Llvm(CMakePackage):
cmake_args.append(
'-DLLVM_TARGETS_TO_BUILD:STRING=' + ';'.join(targets))
+ if '+omp_tsan' in spec:
+ cmake_args.append('-DLIBOMP_TSAN_SUPPORT=ON')
+
if spec.satisfies('@4.0.0:') and spec.satisfies('platform=linux'):
cmake_args.append('-DCMAKE_BUILD_WITH_INSTALL_RPATH=1')
return cmake_args