summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/llvm/package.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py
index 4f7e1583a0..a2e6ae1a94 100644
--- a/var/spack/repos/builtin/packages/llvm/package.py
+++ b/var/spack/repos/builtin/packages/llvm/package.py
@@ -30,6 +30,17 @@ class Llvm(CMakePackage):
variant('clang', default=True,
description="Build the LLVM C/C++/Objective-C compiler frontend")
+
+ # TODO: The current version of this package unconditionally disables CUDA.
+ # Better would be to add a "cuda" variant that:
+ # - Adds dependency on the "cuda" package when enabled
+ # - Sets the necessary CMake flags when enabled
+ # - Disables CUDA (as this current version does) only when the
+ # variant is also disabled.
+
+ # variant('cuda', default=False,
+ # description="Build the LLVM with CUDA features enabled")
+
variant('lldb', default=True, description="Build the LLVM debugger")
variant('lld', default=True, description="Build the LLVM linker")
variant('internal_unwind', default=True,
@@ -588,6 +599,14 @@ class Llvm(CMakePackage):
'-DPYTHON_EXECUTABLE:PATH={0}'.format(spec['python'].command.path),
]
+ # TODO: Instead of unconditionally disabling CUDA, add a "cuda" variant
+ # (see TODO above), and set the paths if enabled.
+ cmake_args.extend([
+ '-DCUDA_TOOLKIT_ROOT_DIR:PATH=IGNORE',
+ '-DCUDA_SDK_ROOT_DIR:PATH=IGNORE',
+ '-DCUDA_NVCC_EXECUTABLE:FILEPATH=IGNORE',
+ '-DLIBOMPTARGET_DEP_CUDA_DRIVER_LIBRARIES:STRING=IGNORE'])
+
if '+gold' in spec:
cmake_args.append('-DLLVM_BINUTILS_INCDIR=' +
spec['binutils'].prefix.include)