diff --git a/systems/llnl-elcapitan/system.py b/systems/llnl-elcapitan/system.py index 81612a602..335e39390 100644 --- a/systems/llnl-elcapitan/system.py +++ b/systems/llnl-elcapitan/system.py @@ -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", "%gcc"] +""" + elif compiler == "gcc": + return """\ +packages: {} +""" + else: + raise ValueError(f"Unexpected value for compiler: {compiler}") + def compiler_configs(self): compilers = LlnlElcapitan.resource_location / "compilers"