From 3e02dc258bd6e9f4d4e604f21c482bf2005ab662 Mon Sep 17 00:00:00 2001 From: Jon Rood Date: Mon, 29 Jul 2019 13:23:15 -0600 Subject: 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. --- var/spack/repos/builtin/packages/llvm/package.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'var') 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 -- cgit v1.2.3-70-g09d2