Skip to content

Commit

Permalink
El Capitan system: always include GCC compiler (LLNL#515)
Browse files Browse the repository at this point in the history
always include gcc in config for build deps that dont work with cce; add preference for cce when setting compiler=cce
  • Loading branch information
scheibelp authored Jan 13, 2025
1 parent 2e25190 commit 42a4651
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions systems/llnl-elcapitan/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,30 @@ def external_pkg_configs(self):
elif self.spec.satisfies("compiler=gcc"):
selections.append(externals / "libsci" / "00-gcc-packages.yaml")

cmp_preference_path = self.next_adhoc_cfg()
with open(cmp_preference_path, "w") as f:
f.write(self.compiler_weighting_cfg())
selections.append(cmp_preference_path)

return selections

def compiler_weighting_cfg(self):
compiler = self.spec.variants["compiler"][0]

if compiler == "cce":
return """\
packages:
all:
require:
- one_of: ["%cce", "@:"]
"""
elif compiler == "gcc":
return """\
packages: {}
"""
else:
raise ValueError(f"Unexpected value for compiler: {compiler}")

def compiler_configs(self):
compilers = LlnlElcapitan.resource_location / "compilers"

Expand All @@ -118,8 +140,10 @@ def compiler_configs(self):
self.rocm_cce_compiler_cfg(self.spec.variants["rocm"][0], "16.0.0")
)
selections.append(compiler_cfg_path)
elif self.spec.satisfies("compiler=gcc"):
selections.append(compilers / "gcc" / "00-gcc-12-compilers.yaml")

# Note: this is always included for some low-level dependencies
# that shouldn't build with %cce
selections.append(compilers / "gcc" / "00-gcc-12-compilers.yaml")

return selections

Expand Down

0 comments on commit 42a4651

Please sign in to comment.