Skip to content

Commit 21e5bee

Browse files
committed
add hook for BLIS on zen5
1 parent 8ad1a7c commit 21e5bee

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

eb_hooks.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
CPU_TARGET_ICELAKE = 'x86_64/intel/icelake'
4141
CPU_TARGET_SAPPHIRE_RAPIDS = 'x86_64/intel/sapphirerapids'
4242
CPU_TARGET_ZEN4 = 'x86_64/amd/zen4'
43+
CPU_TARGET_ZEN5 = 'x86_64/amd/zen5'
4344

4445
EESSI_RPATH_OVERRIDE_ATTR = 'orig_rpath_override_dirs'
4546
EESSI_MODULE_ONLY_ATTR = 'orig_module_only'
@@ -960,10 +961,11 @@ def pre_configure_hook(self, *args, **kwargs):
960961
self.cfg.update('configopts', 'CPPFLAGS="-DOF=_Z_OF ${CPPFLAGS}"')
961962

962963

963-
def pre_configure_hook_BLIS_a64fx(self, *args, **kwargs):
964+
def pre_configure_hook_BLIS(self, *args, **kwargs):
964965
"""
965-
Pre-configure hook for BLIS when building for A64FX to fix "Illegal instruction" problem
966-
- add -DCACHE_SECTOR_SIZE_READONLY to $CFLAGS for BLIS 0.9.0, cfr. https://github.com/flame/blis/issues/800
966+
Pre-configure hook for BLIS
967+
- fix "Illegal instruction" problem on A64FX by adding -DCACHE_SECTOR_SIZE_READONLY to $CFLAGS for BLIS 0.9.0, cfr. https://github.com/flame/blis/issues/800
968+
- fall back to zen3 for zen5 to solve "Unable to automatically detect hardware type" error
967969
"""
968970
if self.name == 'BLIS':
969971
cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR')
@@ -974,6 +976,8 @@ def pre_configure_hook_BLIS_a64fx(self, *args, **kwargs):
974976
cflags_var = 'CFLAGS="$CFLAGS -DCACHE_SECTOR_SIZE_READONLY"'
975977
config_target = config_opts[-1]
976978
self.cfg['configopts'] = ' '.join(config_opts[:-1] + [cflags_var, config_target])
979+
if self.version in ('1.0', '1.1', '2.0') and cpu_target == CPU_TARGET_ZEN5:
980+
self.cfg['cpu_architecture'] = 'zen3'
977981
else:
978982
raise EasyBuildError("BLIS-specific hook triggered for non-BLIS easyconfig?!")
979983

@@ -1873,7 +1877,7 @@ def post_easyblock_hook(self, *args, **kwargs):
18731877
}
18741878

18751879
PRE_CONFIGURE_HOOKS = {
1876-
'BLIS': pre_configure_hook_BLIS_a64fx,
1880+
'BLIS': pre_configure_hook_BLIS,
18771881
'CUDA-Samples': pre_configure_hook_CUDA_Samples_test_remove,
18781882
'GObject-Introspection': pre_configure_hook_gobject_introspection,
18791883
'Extrae': pre_configure_hook_extrae,

0 commit comments

Comments
 (0)