LLVM package: disable CUDA (#10858)

This avoids using a system-installed CUDA package. In the future a
variant can be added to allow using Spack-installed CUDA, but for
now CUDA support is always disabled.
This commit is contained in:
Omar Padron 2019-03-25 20:43:18 -04:00 committed by Peter Scheibel
parent a88b540723
commit bf03edb51b

View file

@ -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)