Skip to content
Snippets Groups Projects
Unverified Commit ebd86bd1 authored by Nichols A. Romero's avatar Nichols A. Romero Committed by GitHub
Browse files

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.
parent ac54b7d5
No related branches found
No related tags found
No related merge requests found
...@@ -170,6 +170,9 @@ class Llvm(CMakePackage, CudaPackage): ...@@ -170,6 +170,9 @@ class Llvm(CMakePackage, CudaPackage):
# OMP TSAN exists in > 5.x # OMP TSAN exists in > 5.x
conflicts("+omp_tsan", when="@:5.99") 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 # MLIR exists in > 10.x
conflicts("+mlir", when="@:9") conflicts("+mlir", when="@:9")
...@@ -233,7 +236,8 @@ def cmake_args(self): ...@@ -233,7 +236,8 @@ def cmake_args(self):
"-DLLVM_ENABLE_EH:BOOL=ON", "-DLLVM_ENABLE_EH:BOOL=ON",
"-DCLANG_DEFAULT_OPENMP_RUNTIME:STRING=libomp", "-DCLANG_DEFAULT_OPENMP_RUNTIME:STRING=libomp",
"-DPYTHON_EXECUTABLE:PATH={0}".format(spec["python"].command.path), "-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 = [] projects = []
...@@ -388,13 +392,14 @@ def post_install(self): ...@@ -388,13 +392,14 @@ def post_install(self):
"-DCMAKE_INSTALL_PREFIX:PATH={0}".format(spec.prefix), "-DCMAKE_INSTALL_PREFIX:PATH={0}".format(spec.prefix),
] ]
cmake_args.extend(self.cmake_args()) 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 # work around bad libelf detection in libomptarget
cmake_args.append( cmake_args.append(
"-DCMAKE_CXX_FLAGS:String=-I{0} -I{1}".format( "-DLIBOMPTARGET_DEP_LIBELF_INCLUDE_DIR:String={0}".format(
spec["libelf"].prefix.include, spec["libelf"].prefix.include
spec["hwloc"].prefix.include,
) )
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment