summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2021-11-24 01:28:17 +0100
committerGitHub <noreply@github.com>2021-11-23 16:28:17 -0800
commitdfc95cdf1c07ad7cde2becc14db5692cd8d7f0dc (patch)
tree4de9573f82988f4003ab0b7bbd4fa5b891ab6ae9 /var
parent0f1c04ed7eda3cd7d3a784ba048ba69658829cf0 (diff)
downloadspack-dfc95cdf1c07ad7cde2becc14db5692cd8d7f0dc.tar.gz
spack-dfc95cdf1c07ad7cde2becc14db5692cd8d7f0dc.tar.bz2
spack-dfc95cdf1c07ad7cde2becc14db5692cd8d7f0dc.tar.xz
spack-dfc95cdf1c07ad7cde2becc14db5692cd8d7f0dc.zip
llvm: use ninja by default (#27521)
* llvm: use ninja by default * Use ninja for omp when it's not a runtime
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/llvm/package.py28
1 files changed, 18 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py
index cbfddc13e9..36c3984dc1 100644
--- a/var/spack/repos/builtin/packages/llvm/package.py
+++ b/var/spack/repos/builtin/packages/llvm/package.py
@@ -8,6 +8,7 @@ import sys
import llnl.util.tty as tty
+import spack.build_environment
import spack.util.executable
@@ -27,6 +28,8 @@ class Llvm(CMakePackage, CudaPackage):
tags = ['e4s']
+ generator = 'Ninja'
+
family = "compiler" # Used by lmod
# fmt: off
@@ -165,6 +168,7 @@ class Llvm(CMakePackage, CudaPackage):
# Build dependency
depends_on("cmake@3.4.3:", type="build")
+ depends_on("ninja", type="build")
depends_on("python@2.7:2.8", when="@:4 ~python", type="build")
depends_on("python", when="@5: ~python", type="build")
depends_on("pkgconfig", type="build")
@@ -626,27 +630,31 @@ class Llvm(CMakePackage, CudaPackage):
define = CMakePackage.define
# unnecessary if we build openmp via LLVM_ENABLE_RUNTIMES
- if "+cuda" in self.spec and "+omp_as_runtime" not in self.spec:
+ if "+cuda ~omp_as_runtime" in self.spec:
ompdir = "build-bootstrapped-omp"
+ prefix_paths = spack.build_environment.get_cmake_prefix_path(self)
+ prefix_paths.append(str(spec.prefix))
# rebuild libomptarget to get bytecode runtime library files
with working_dir(ompdir, create=True):
cmake_args = [
- self.stage.source_path + "/openmp",
+ '-G', 'Ninja',
+ define('CMAKE_BUILD_TYPE', spec.variants['build_type'].value),
define("CMAKE_C_COMPILER", spec.prefix.bin + "/clang"),
define("CMAKE_CXX_COMPILER", spec.prefix.bin + "/clang++"),
define("CMAKE_INSTALL_PREFIX", spec.prefix),
+ define('CMAKE_PREFIX_PATH', prefix_paths)
]
cmake_args.extend(self.cmake_args())
- cmake_args.append(define("LIBOMPTARGET_NVPTX_ENABLE_BCLIB",
- True))
-
- # work around bad libelf detection in libomptarget
- cmake_args.append(define("LIBOMPTARGET_DEP_LIBELF_INCLUDE_DIR",
- spec["libelf"].prefix.include))
+ cmake_args.extend([
+ define("LIBOMPTARGET_NVPTX_ENABLE_BCLIB", True),
+ define("LIBOMPTARGET_DEP_LIBELF_INCLUDE_DIR",
+ spec["libelf"].prefix.include),
+ self.stage.source_path + "/openmp",
+ ])
cmake(*cmake_args)
- make()
- make("install")
+ ninja()
+ ninja("install")
if "+python" in self.spec:
install_tree("llvm/bindings/python", site_packages_dir)