summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorNichols A. Romero <naromero77@users.noreply.github.com>2020-04-17 15:18:27 -0500
committerGitHub <noreply@github.com>2020-04-17 15:18:27 -0500
commitebd86bd1eb0ea09b3568b7cc1901c0ce9a5ece57 (patch)
treec5b3e9e6f1575e5e06e1d5497fc6303af02eff91 /var
parentac54b7d5c130caac5b1296fa71613951d2ee08ab (diff)
downloadspack-ebd86bd1eb0ea09b3568b7cc1901c0ce9a5ece57.tar.gz
spack-ebd86bd1eb0ea09b3568b7cc1901c0ce9a5ece57.tar.bz2
spack-ebd86bd1eb0ea09b3568b7cc1901c0ce9a5ece57.tar.xz
spack-ebd86bd1eb0ea09b3568b7cc1901c0ce9a5ece57.zip
LLVM libomptarget fixes (#16104)
* Throw an error at spack install invocation instead of most of the way through the build process when cuda_arch is unspecified. * Clean-up of CMake booleans. No actual change. * Use CMake variables for hwloc and libelf installation directories and avoid injecting extra flags into CMAKE_CXX_FLAGS * Conflict should only exist for +cuda variant.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/llvm/package.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py
index 3057184882..f56a68403b 100644
--- a/var/spack/repos/builtin/packages/llvm/package.py
+++ b/var/spack/repos/builtin/packages/llvm/package.py
@@ -170,6 +170,9 @@ class Llvm(CMakePackage, CudaPackage):
# OMP TSAN exists in > 5.x
conflicts("+omp_tsan", when="@:5.99")
+ # cuda_arch value must be specified
+ conflicts("cuda_arch=none", when="+cuda", msg="A value for cuda_arch must be specified.")
+
# MLIR exists in > 10.x
conflicts("+mlir", when="@:9")
@@ -233,7 +236,8 @@ class Llvm(CMakePackage, CudaPackage):
"-DLLVM_ENABLE_EH:BOOL=ON",
"-DCLANG_DEFAULT_OPENMP_RUNTIME:STRING=libomp",
"-DPYTHON_EXECUTABLE:PATH={0}".format(spec["python"].command.path),
- "-DLIBOMP_USE_HWLOC=On",
+ "-DLIBOMP_USE_HWLOC:BOOL=ON",
+ "-DLIBOMP_HWLOC_INSTALL_DIR={0}".format(spec["hwloc"].prefix),
]
projects = []
@@ -388,13 +392,14 @@ class Llvm(CMakePackage, CudaPackage):
"-DCMAKE_INSTALL_PREFIX:PATH={0}".format(spec.prefix),
]
cmake_args.extend(self.cmake_args())
- cmake_args.append('-DLIBOMPTARGET_NVPTX_ENABLE_BCLIB=true')
+ cmake_args.append(
+ "-DLIBOMPTARGET_NVPTX_ENABLE_BCLIB:BOOL=TRUE"
+ )
# work around bad libelf detection in libomptarget
cmake_args.append(
- "-DCMAKE_CXX_FLAGS:String=-I{0} -I{1}".format(
- spec["libelf"].prefix.include,
- spec["hwloc"].prefix.include,
+ "-DLIBOMPTARGET_DEP_LIBELF_INCLUDE_DIR:String={0}".format(
+ spec["libelf"].prefix.include
)
)