diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index 4f7e1583a0646d6318e79f7a5aebd9abe4426a3c..a2e6ae1a9412a12c07b9c265a3aca742328325f7 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 @@ def cmake_args(self): '-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)