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

Fix insertion of gcc dependence in intel-oneapi-compilers module

parent 67f2006c
No related branches found
No related tags found
1 merge request!1Code review of main
Pipeline #573950 failed
...@@ -334,9 +334,15 @@ def refresh_modules(compilers: dict[str, Any] | None = None) -> None: ...@@ -334,9 +334,15 @@ def refresh_modules(compilers: dict[str, Any] | None = None) -> None:
with module_file.open() as f: with module_file.open() as f:
content = f.read() content = f.read()
content = content.replace('family("compiler")', 'family("intel_compiler")') content = content.replace('family("compiler")', 'family("intel_compiler")')
# insert gcc as dependency before other dependencies # insert gcc as dependency before other dependencies and before modifying
content = content.replace( # MODULE_PATH
"depends_on(", f'depends_on("{gcc_module}")\ndepends_on(', 1 insertion_point = min(
content.find("depends_on("), content.find('prepend_path("MODULEPATH"')
)
content = (
content[:insertion_point]
+ f'depends_on("{gcc_module}")\n'
+ content[insertion_point:]
) )
with module_file.open("w") as f: with module_file.open("w") as f:
f.write(content) f.write(content)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment