Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions eb_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,24 @@ def pre_configure_hook_LAMMPS_zen4(self, *args, **kwargs):
raise EasyBuildError("LAMMPS-specific hook triggered for non-LAMMPS easyconfig?!")


def pre_configure_hook_cmake_system(self, *args, **kwargs):
"""
pre-configure hook for CMake built with SYSTEM toolchain:
- remove configure options that link to ncurses static libraries for CMake with system toolchain;
see also https://github.com/EESSI/software-layer/issues/1175
"""

if self.name == 'CMake':
if is_system_toolchain(self.toolchain.name):
self.log.info("Removing configure options that require ncurses static libraries...")
self.log.info(f"Original configopts value: {self.cfg['configopts']}")
regex = re.compile("-DCURSES_[A-Z]+_LIBRARY=\$EBROOTNCURSES/lib/lib[a-z]+\.a")
self.cfg['configopts'] = regex.sub(self.cfg['configopts'], '')
self.log.info(f"Updated configopts value: {self.cfg['configopts']}")
else:
raise EasyBuildError("CMake-specific hook triggered for non-CMake easyconfig?!")


def pre_test_hook(self, *args, **kwargs):
"""Main pre-test hook: trigger custom functions based on software name."""
if self.name in PRE_TEST_HOOKS:
Expand Down Expand Up @@ -1484,6 +1502,7 @@ def post_easyblock_hook(self, *args, **kwargs):
'LAMMPS': pre_configure_hook_LAMMPS_zen4,
'Score-P': pre_configure_hook_score_p,
'VSEARCH': pre_configure_hook_vsearch,
'CMake': pre_configure_hook_cmake_system,
}

PRE_TEST_HOOKS = {
Expand Down