diff options
Diffstat (limited to 'var')
4 files changed, 16 insertions, 35 deletions
diff --git a/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py b/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py index a4e85c77de..7f601fc3d1 100644 --- a/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py +++ b/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py @@ -5,6 +5,7 @@ import platform +import spack.compilers from spack.build_environment import dso_suffix from spack.package import * @@ -113,6 +114,15 @@ class IntelOneapiCompilers(IntelOneApiPackage): depends_on("patchelf", type="build") + # TODO: effectively gcc is a direct dependency of intel-oneapi-compilers, but we + # cannot express that properly. For now, add conflicts for non-gcc compilers + # instead. + for __compiler in spack.compilers.supported_compilers(): + if __compiler != "gcc": + conflicts( + "%{0}".format(__compiler), msg="intel-oneapi-compilers must be installed with %gcc" + ) + if platform.system() == "Linux": for v in linux_versions: version(v["version"], expand=False, **v["cpp"]) @@ -186,7 +196,9 @@ class IntelOneapiCompilers(IntelOneApiPackage): # TODO: it is unclear whether we should really use all elements of # _ld_library_path because it looks like the only rpath that needs to be # injected is self.component_prefix.linux.compiler.lib.intel64_lin. - flags = " ".join(["-Wl,-rpath,{0}".format(d) for d in self._ld_library_path()]) + flags_list = ["-Wl,-rpath,{}".format(d) for d in self._ld_library_path()] + flags_list.append("--gcc-toolchain={}".format(self.compiler.prefix)) + flags = " ".join(flags_list) for cmp in [ "icx", "icpx", diff --git a/var/spack/repos/builtin/packages/llvm-amdgpu/package.py b/var/spack/repos/builtin/packages/llvm-amdgpu/package.py index f6192e6080..6002351a64 100644 --- a/var/spack/repos/builtin/packages/llvm-amdgpu/package.py +++ b/var/spack/repos/builtin/packages/llvm-amdgpu/package.py @@ -234,18 +234,7 @@ class LlvmAmdgpu(CMakePackage): # Get the GCC prefix for LLVM. if self.compiler.name == "gcc": - compiler = Executable(self.compiler.cc) - gcc_output = compiler("-print-search-dirs", output=str, error=str) - - gcc_prefix = "" - 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 - args.append(self.define("GCC_INSTALL_PREFIX", gcc_prefix)) + args.append(self.define("GCC_INSTALL_PREFIX", self.compiler.prefix)) return args diff --git a/var/spack/repos/builtin/packages/llvm-doe/package.py b/var/spack/repos/builtin/packages/llvm-doe/package.py index 29bdc912b7..e2ec14fa0d 100644 --- a/var/spack/repos/builtin/packages/llvm-doe/package.py +++ b/var/spack/repos/builtin/packages/llvm-doe/package.py @@ -582,17 +582,7 @@ class LlvmDoe(CMakePackage, CudaPackage): cmake_args.append("-DLIBOMP_USE_ARGOBOTS=ON") 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 spec.satisfies("platform=cray") or spec.satisfies("platform=linux"): # cmake_args.append("-DCMAKE_BUILD_WITH_INSTALL_RPATH=1") 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)) |