Commit 77fc0c2c authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Support 'latest_gcc', 'latest_intel' meta compilers

parent f1ce5e94
Pipeline #67015 failed with stage
in 16 seconds
...@@ -294,6 +294,13 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False, filter_r ...@@ -294,6 +294,13 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False, filter_r
default_mpis = try_get_attribute(None, "default_mpi") default_mpis = try_get_attribute(None, "default_mpi")
default_cudas = try_get_attribute(None, "default_cuda") default_cudas = try_get_attribute(None, "default_cuda")
def sort_key(string):
name, *version = string.split("_")
return (name,) + tuple(map(int, version))
latest_intel = sorted((c for c in all_compilers if c.startswith("intel")), key=sort_key)[-1]
latest_gcc = sorted((c for c in all_compilers if c.startswith("gcc")), key=sort_key)[-1]
def enable(name): def enable(name):
if any(filtered_repo in name for filtered_repo in filter_repos): if any(filtered_repo in name for filtered_repo in filter_repos):
return return
...@@ -305,7 +312,7 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False, filter_r ...@@ -305,7 +312,7 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False, filter_r
print("Enabling", name) print("Enabling", name)
def actual_compilers(): def actual_compilers():
for compiler in (c for c in compilers if c in all_compilers + ["default_compiler", "intel", "gcc"]): for compiler in (c for c in compilers if c in all_compilers + ["default_compiler", "intel", "gcc", "latest_intel", "latest_gcc"]):
if compiler == "intel": if compiler == "intel":
for intel_compiler in [cc for cc in all_compilers if cc.startswith("intel")]: for intel_compiler in [cc for cc in all_compilers if cc.startswith("intel")]:
yield intel_compiler yield intel_compiler
...@@ -315,6 +322,10 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False, filter_r ...@@ -315,6 +322,10 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False, filter_r
elif compiler == "default_compiler": elif compiler == "default_compiler":
for default_compiler in default_compilers: for default_compiler in default_compilers:
yield default_compiler yield default_compiler
elif compiler == "latest_intel":
yield latest_intel
elif compiler == "latest_gcc":
yield latest_gcc
else: else:
yield compiler yield compiler
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment