summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/llvm/package.py
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2022-10-12 01:45:51 +0200
committerGitHub <noreply@github.com>2022-10-11 17:45:51 -0600
commit926dca9e5fa159201989ebef464984aab92716d2 (patch)
tree778431d8db8b633740e85222fff435feb27ae7f3 /var/spack/repos/builtin/packages/llvm/package.py
parent4b866e8ffc69d89064cf011675f63de12684ef76 (diff)
downloadspack-926dca9e5fa159201989ebef464984aab92716d2.tar.gz
spack-926dca9e5fa159201989ebef464984aab92716d2.tar.bz2
spack-926dca9e5fa159201989ebef464984aab92716d2.tar.xz
spack-926dca9e5fa159201989ebef464984aab92716d2.zip
Specify GCC prefix in LLVM-based compilers (#33146)
* spack.compiler.Compiler: introduce prefix property We currently don't really have something that gives the GCC install path, which is used by many LLVM-based compilers (llvm, llvm-amdgpu, nvhpc, ...) to fix the GCC toolchain once and for all. This `prefix` property is dynamic in the sense that it queries the compiler itself. This is necessary because it's not easy to deduce the install path from the `cc` property (might be a symlink, might be a filename like `gcc` which works by having the compiler load a module that sets the PATH variable, might be a generic compiler wrapper based on environment variables like on cray...). With this property introduced, we can clean up some recipes that have the logic repeated for GCC. * intel-oneapi-compilers: set --gcc-sysroot to %gcc prefix
Diffstat (limited to 'var/spack/repos/builtin/packages/llvm/package.py')
-rw-r--r--var/spack/repos/builtin/packages/llvm/package.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py
index 5751629f5f..d7958bd6f8 100644
--- a/var/spack/repos/builtin/packages/llvm/package.py
+++ b/var/spack/repos/builtin/packages/llvm/package.py
@@ -721,17 +721,7 @@ class Llvm(CMakePackage, CudaPackage):
cmake_args.append(from_variant("LIBOMP_TSAN_SUPPORT", "omp_tsan"))
if self.compiler.name == "gcc":
- compiler = Executable(self.compiler.cc)
- gcc_output = compiler("-print-search-dirs", output=str, error=str)
-
- for line in gcc_output.splitlines():
- if line.startswith("install:"):
- # Get path and strip any whitespace
- # (causes oddity with ancestor)
- gcc_prefix = line.split(":")[1].strip()
- gcc_prefix = ancestor(gcc_prefix, 4)
- break
- cmake_args.append(define("GCC_INSTALL_PREFIX", gcc_prefix))
+ cmake_args.append(define("GCC_INSTALL_PREFIX", self.compiler.prefix))
if self.spec.satisfies("~code_signing platform=darwin"):
cmake_args.append(define("LLDB_USE_SYSTEM_DEBUGSERVER", True))