Skip to content

Commit 174d1a5

Browse files
authored
Merge branch 'EESSI:main' into patch-1
2 parents bf32fd8 + a1b77a3 commit 174d1a5

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

eb_hooks.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ def verify_toolchains_supported_by_eessi_version(easyconfigs):
188188
site_top_level_toolchains_envvar = 'EESSI_SITE_TOP_LEVEL_TOOLCHAINS_' + eessi_version.replace('.', '_')
189189
site_top_level_toolchains = parse_list_of_dicts_env(site_top_level_toolchains_envvar)
190190
for top_level_toolchain in EESSI_SUPPORTED_TOP_LEVEL_TOOLCHAINS[eessi_version] + site_top_level_toolchains:
191-
supported_eessi_toolchains += get_toolchain_hierarchy(top_level_toolchain)
191+
try:
192+
supported_eessi_toolchains += get_toolchain_hierarchy(top_level_toolchain)
193+
except EasyBuildError as error:
194+
print_msg(f"No toolchain hierarchy found for {top_level_toolchain}, ignoring! ({error})")
192195
for ec in easyconfigs:
193196
toolchain = ec['ec']['toolchain']
194197
# if it is a system toolchain or appears in the list, we are all good
@@ -957,6 +960,24 @@ def pre_configure_hook_LAMMPS_zen4(self, *args, **kwargs):
957960
raise EasyBuildError("LAMMPS-specific hook triggered for non-LAMMPS easyconfig?!")
958961

959962

963+
def pre_configure_hook_cmake_system(self, *args, **kwargs):
964+
"""
965+
pre-configure hook for CMake built with SYSTEM toolchain:
966+
- remove configure options that link to ncurses static libraries for CMake with system toolchain;
967+
see also https://github.com/EESSI/software-layer/issues/1175
968+
"""
969+
970+
if self.name == 'CMake':
971+
if is_system_toolchain(self.toolchain.name):
972+
self.log.info("Removing configure options that require ncurses static libraries...")
973+
self.log.info(f"Original configopts value: {self.cfg['configopts']}")
974+
regex = re.compile(r"-DCURSES_[A-Z]+_LIBRARY=\$EBROOTNCURSES/lib/lib[a-z]+\.a")
975+
self.cfg['configopts'] = regex.sub(self.cfg['configopts'], '')
976+
self.log.info(f"Updated configopts value: {self.cfg['configopts']}")
977+
else:
978+
raise EasyBuildError("CMake-specific hook triggered for non-CMake easyconfig?!")
979+
980+
960981
def pre_test_hook(self, *args, **kwargs):
961982
"""Main pre-test hook: trigger custom functions based on software name."""
962983
if self.name in PRE_TEST_HOOKS:
@@ -1498,6 +1519,7 @@ def post_easyblock_hook(self, *args, **kwargs):
14981519
'LAMMPS': pre_configure_hook_LAMMPS_zen4,
14991520
'Score-P': pre_configure_hook_score_p,
15001521
'VSEARCH': pre_configure_hook_vsearch,
1522+
'CMake': pre_configure_hook_cmake_system,
15011523
}
15021524

15031525
PRE_TEST_HOOKS = {

0 commit comments

Comments
 (0)