Skip to content

Commit 6505024

Browse files
committed
add pre+post prepare hooks for LLVM to solve A64FX build issue
1 parent 38ca6af commit 6505024

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

eb_hooks.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,28 @@ def post_prepare_hook_highway_handle_test_compilation_issues(self, *args, **kwar
736736
update_build_option('optarch', self.orig_optarch)
737737

738738

739+
def pre_prepare_hook_llvm_a64fx(self, *args, **kwargs):
740+
"""
741+
Solve issues with compiling LLVM on A64FX by changing the optarch build option.
742+
cfr. https://github.com/EESSI/software-layer/issues/1213
743+
"""
744+
cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR')
745+
if self.name == 'LLVM' and self.version == '15.0.5' and cpu_target == CPU_TARGET_A64FX:
746+
self.orig_optarch = build_option('optarch')
747+
update_build_option('optarch', 'march=armv8.2-a')
748+
else:
749+
raise EasyBuildError("LLVM-specific hook triggered for non-Highway easyconfig?!")
750+
751+
752+
def post_prepare_hook_llvm_a64fx(self, *args, **kwargs):
753+
"""
754+
Post-prepare hook for LLVM to reset optarch build option.
755+
"""
756+
cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR')
757+
if self.name == 'LLVM' and self.version == '15.0.5' and cpu_target == CPU_TARGET_A64FX:
758+
update_build_option('optarch', self.orig_optarch)
759+
760+
739761
def pre_configure_hook(self, *args, **kwargs):
740762
"""Main pre-configure hook: trigger custom functions based on software name."""
741763
if self.name in PRE_CONFIGURE_HOOKS:
@@ -1610,11 +1632,13 @@ def post_easyblock_hook(self, *args, **kwargs):
16101632

16111633
PRE_PREPARE_HOOKS = {
16121634
'Highway': pre_prepare_hook_highway_handle_test_compilation_issues,
1635+
'LLVM': pre_prepare_hook_llvm_a64fx,
16131636
}
16141637

16151638
POST_PREPARE_HOOKS = {
16161639
'GCCcore': post_prepare_hook_gcc_prefixed_ld_rpath_wrapper,
16171640
'Highway': post_prepare_hook_highway_handle_test_compilation_issues,
1641+
'LLVM': post_prepare_hook_llvm_a64fx,
16181642
}
16191643

16201644
PRE_CONFIGURE_HOOKS = {

0 commit comments

Comments
 (0)