@@ -943,6 +943,24 @@ def pre_configure_hook_LAMMPS_zen4(self, *args, **kwargs):
943
943
raise EasyBuildError ("LAMMPS-specific hook triggered for non-LAMMPS easyconfig?!" )
944
944
945
945
946
+ def pre_configure_hook_cmake_system (self , * args , ** kwargs ):
947
+ """
948
+ pre-configure hook for CMake built with SYSTEM toolchain:
949
+ - remove configure options that link to ncurses static libraries for CMake with system toolchain;
950
+ see also https://github.com/EESSI/software-layer/issues/1175
951
+ """
952
+
953
+ if self .name == 'CMake' :
954
+ if is_system_toolchain (self .toolchain .name ):
955
+ self .log .info ("Removing configure options that require ncurses static libraries..." )
956
+ self .log .info (f"Original configopts value: { self .cfg ['configopts' ]} " )
957
+ regex = re .compile ("-DCURSES_[A-Z]+_LIBRARY=\$EBROOTNCURSES/lib/lib[a-z]+\.a" )
958
+ self .cfg ['configopts' ] = regex .sub (self .cfg ['configopts' ], '' )
959
+ self .log .info (f"Updated configopts value: { self .cfg ['configopts' ]} " )
960
+ else :
961
+ raise EasyBuildError ("CMake-specific hook triggered for non-CMake easyconfig?!" )
962
+
963
+
946
964
def pre_test_hook (self , * args , ** kwargs ):
947
965
"""Main pre-test hook: trigger custom functions based on software name."""
948
966
if self .name in PRE_TEST_HOOKS :
@@ -1484,6 +1502,7 @@ def post_easyblock_hook(self, *args, **kwargs):
1484
1502
'LAMMPS' : pre_configure_hook_LAMMPS_zen4 ,
1485
1503
'Score-P' : pre_configure_hook_score_p ,
1486
1504
'VSEARCH' : pre_configure_hook_vsearch ,
1505
+ 'CMake' : pre_configure_hook_cmake_system ,
1487
1506
}
1488
1507
1489
1508
PRE_TEST_HOOKS = {
0 commit comments