Skip to content
Snippets Groups Projects
Commit 962f5d9b authored by Martin Lang's avatar Martin Lang
Browse files

Rewrite compiler installation

- install intel compiler using on toolchain gcc
- load compiler before searching (avoids problems with oneapi v2 layout)
- disable updates in compilers.yaml
parent 002a3407
No related branches found
No related tags found
2 merge requests!6Several fixes for compiler installation,!1Code review of main
Pipeline #541566 failed
...@@ -588,7 +588,7 @@ def install_toolchain_compiler(spack_environment: str) -> dict[str, dict[str, st ...@@ -588,7 +588,7 @@ def install_toolchain_compiler(spack_environment: str) -> dict[str, dict[str, st
gcc_package = line.split('"')[1] gcc_package = line.split('"')[1]
compilers["default"] = { compilers["default"] = {
"name": intel_compiler, "name": intel_compiler,
"package": f"{intel_package}%{Config().system_compiler}", "package": f"{intel_package}%{gcc_package}",
} }
compilers["fallback"] = { compilers["fallback"] = {
"name": gcc_package, "name": gcc_package,
...@@ -598,15 +598,15 @@ def install_toolchain_compiler(spack_environment: str) -> dict[str, dict[str, st ...@@ -598,15 +598,15 @@ def install_toolchain_compiler(spack_environment: str) -> dict[str, dict[str, st
logger.debug("Required toolchain compiler: %s", compilers) logger.debug("Required toolchain compiler: %s", compilers)
for compiler_definition in compilers.values(): for compiler_definition in compilers.values():
spack_install_package(compiler_definition["package"]) compiler_package = compiler_definition["package"]
compiler_path = spack( spack_install_package(compiler_package)
f"location -i {compiler_definition['package']}"
).stdout.strip()
logger.debug( logger.debug(
spack(f"compiler find --scope site {compiler_path}").stdout.strip() spack(
f"load {compiler_package} && spack compiler find --scope site"
).stdout.strip()
) )
if len(compilers) == 2: if False: # len(compilers) == 2:
gcc = compilers["fallback"] gcc = compilers["fallback"]
intel = compilers["default"] intel = compilers["default"]
arch_tag = platform.machine() arch_tag = platform.machine()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment