From ebd86bd1eb0ea09b3568b7cc1901c0ce9a5ece57 Mon Sep 17 00:00:00 2001 From: "Nichols A. Romero" Date: Fri, 17 Apr 2020 15:18:27 -0500 Subject: 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. --- var/spack/repos/builtin/packages/llvm/package.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'var') 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 ) ) -- cgit v1.2.3-70-g09d2