Skip to content

Commit a0dfa48

Browse files
committed
Merge branch 'main' into LAMMPS_hook
2 parents 821a181 + 5bedd42 commit a0dfa48

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

eb_hooks.py

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,21 @@
6767
}
6868

6969

70+
# Ensure that we don't print any messages in --terse mode
71+
# Note that --terse was introduced in EB 4.9.1
72+
orig_print_msg = print_msg
73+
orig_print_warning = print_warning
74+
75+
def print_msg(*args, **kwargs):
76+
if EASYBUILD_VERSION < '4.9.1' or not build_option('terse'):
77+
orig_print_msg(*args, **kwargs)
78+
79+
80+
def print_warning(*args, **kwargs):
81+
if EASYBUILD_VERSION < '4.9.1' or not build_option('terse'):
82+
orig_print_warning(*args, **kwargs)
83+
84+
7085
def is_gcccore_1220_based(**kwargs):
7186
# ecname, ecversion, tcname, tcversion):
7287
"""
@@ -140,6 +155,9 @@ def parse_hook(ec, *args, **kwargs):
140155
if cpu_target == CPU_TARGET_ZEN4:
141156
parse_hook_zen4_module_only(ec, eprefix)
142157

158+
# All A64FX builds for the 2022b toolchain should use a newer Rust version, as the original one does not work
159+
parse_hook_bump_rust_version_in_2022b_for_a64fx(ec, eprefix)
160+
143161
# inject the GPU property (if required)
144162
ec = inject_gpu_property(ec)
145163

@@ -434,6 +452,26 @@ def parse_hook_openblas_relax_lapack_tests_num_errors(ec, eprefix):
434452
raise EasyBuildError("OpenBLAS-specific hook triggered for non-OpenBLAS easyconfig?!")
435453

436454

455+
def parse_hook_bump_rust_version_in_2022b_for_a64fx(ec, eprefix):
456+
"""
457+
Replace Rust 1.65.0 build dependency by version 1.75.0 for A64FX builds,
458+
because version 1.65.0 has build issues.
459+
"""
460+
cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR')
461+
if cpu_target == CPU_TARGET_A64FX:
462+
if is_gcccore_1220_based(ecname=ec['name'], ecversion=ec['version'],
463+
tcname=ec['toolchain']['name'], tcversion=ec['toolchain']['version']):
464+
465+
build_deps = ec['builddependencies']
466+
rust_name = 'Rust'
467+
rust_original_version = '1.65.0'
468+
rust_new_version = '1.75.0'
469+
for idx, build_dep in enumerate(build_deps):
470+
if build_dep[0] == rust_name and build_dep[1] == rust_original_version:
471+
build_deps[idx] = (rust_name, rust_new_version)
472+
break
473+
474+
437475
def parse_hook_pybind11_replace_catch2(ec, eprefix):
438476
"""
439477
Replace Catch2 build dependency in pybind11 easyconfigs with one that doesn't use system toolchain.
@@ -882,6 +920,42 @@ def pre_configure_hook_openblas_optarch_generic(self, *args, **kwargs):
882920
raise EasyBuildError("OpenBLAS-specific hook triggered for non-OpenBLAS easyconfig?!")
883921

884922

923+
def pre_configure_hook_openmpi_ipv6(self, *args, **kwargs):
924+
"""
925+
Pre-configure hook to enable IPv6 support in OpenMPI from EESSI 2025.06 onwards
926+
"""
927+
if self.name == 'OpenMPI':
928+
eessi_version = get_eessi_envvar('EESSI_VERSION')
929+
if eessi_version and LooseVersion(eessi_version) >= '2025.06':
930+
self.cfg.update('configopts', '--enable-ipv6')
931+
else:
932+
raise EasyBuildError("OpenMPI-specific hook triggered for non-OpenMPI easyconfig?!")
933+
934+
935+
def pre_configure_hook_pmix_ipv6(self, *args, **kwargs):
936+
"""
937+
Pre-configure hook to enable IPv6 support in PMIx from EESSI 2025.06 onwards
938+
"""
939+
if self.name == 'PMIx':
940+
eessi_version = get_eessi_envvar('EESSI_VERSION')
941+
if eessi_version and LooseVersion(eessi_version) >= '2025.06':
942+
self.cfg.update('configopts', '--enable-ipv6')
943+
else:
944+
raise EasyBuildError("PMIx-specific hook triggered for non-PMIx easyconfig?!")
945+
946+
947+
def pre_configure_hook_prrte_ipv6(self, *args, **kwargs):
948+
"""
949+
Pre-configure hook to enable IPv6 support in PRRTE from EESSI 2025.06 onwards
950+
"""
951+
if self.name == 'PRRTE':
952+
eessi_version = get_eessi_envvar('EESSI_VERSION')
953+
if eessi_version and LooseVersion(eessi_version) >= '2025.06':
954+
self.cfg.update('configopts', '--enable-ipv6')
955+
else:
956+
raise EasyBuildError("PRRTE-specific hook triggered for non-PRRTE easyconfig?!")
957+
958+
885959
def pre_configure_hook_libfabric_disable_psm3_x86_64_generic(self, *args, **kwargs):
886960
"""Add --disable-psm3 to libfabric configure options when building with --optarch=GENERIC on x86_64."""
887961
if self.name == 'libfabric':
@@ -1525,6 +1599,9 @@ def post_easyblock_hook(self, *args, **kwargs):
15251599
'ROCm-LLVM': pre_configure_hook_llvm,
15261600
'MetaBAT': pre_configure_hook_metabat_filtered_zlib_dep,
15271601
'OpenBLAS': pre_configure_hook_openblas_optarch_generic,
1602+
'OpenMPI': pre_configure_hook_openmpi_ipv6,
1603+
'PMIx': pre_configure_hook_pmix_ipv6,
1604+
'PRRTE': pre_configure_hook_prrte_ipv6,
15281605
'WRF': pre_configure_hook_wrf_aarch64,
15291606
'LAMMPS': pre_configure_hook_LAMMPS_zen4_and_Aarch64_cuda,
15301607
'Score-P': pre_configure_hook_score_p,

0 commit comments

Comments
 (0)