From 650502469aad4fdbefb8151691091696e18e2e47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Wed, 1 Oct 2025 11:28:17 +0200 Subject: [PATCH 1/7] add pre+post prepare hooks for LLVM to solve A64FX build issue --- eb_hooks.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/eb_hooks.py b/eb_hooks.py index 3932eb6b..adb8f346 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -736,6 +736,28 @@ def post_prepare_hook_highway_handle_test_compilation_issues(self, *args, **kwar update_build_option('optarch', self.orig_optarch) +def pre_prepare_hook_llvm_a64fx(self, *args, **kwargs): + """ + Solve issues with compiling LLVM on A64FX by changing the optarch build option. + cfr. https://github.com/EESSI/software-layer/issues/1213 + """ + cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR') + if self.name == 'LLVM' and self.version == '15.0.5' and cpu_target == CPU_TARGET_A64FX: + self.orig_optarch = build_option('optarch') + update_build_option('optarch', 'march=armv8.2-a') + else: + raise EasyBuildError("LLVM-specific hook triggered for non-Highway easyconfig?!") + + +def post_prepare_hook_llvm_a64fx(self, *args, **kwargs): + """ + Post-prepare hook for LLVM to reset optarch build option. + """ + cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR') + if self.name == 'LLVM' and self.version == '15.0.5' and cpu_target == CPU_TARGET_A64FX: + update_build_option('optarch', self.orig_optarch) + + def pre_configure_hook(self, *args, **kwargs): """Main pre-configure hook: trigger custom functions based on software name.""" if self.name in PRE_CONFIGURE_HOOKS: @@ -1610,11 +1632,13 @@ def post_easyblock_hook(self, *args, **kwargs): PRE_PREPARE_HOOKS = { 'Highway': pre_prepare_hook_highway_handle_test_compilation_issues, + 'LLVM': pre_prepare_hook_llvm_a64fx, } POST_PREPARE_HOOKS = { 'GCCcore': post_prepare_hook_gcc_prefixed_ld_rpath_wrapper, 'Highway': post_prepare_hook_highway_handle_test_compilation_issues, + 'LLVM': post_prepare_hook_llvm_a64fx, } PRE_CONFIGURE_HOOKS = { From ee61746cc569964bf28bcc0a2e3a92e15250f563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 3 Oct 2025 08:59:02 +0200 Subject: [PATCH 2/7] apply the LLVM pre/post prepare hook to Rust as well --- eb_hooks.py | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index adb8f346..9409b046 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -736,26 +736,27 @@ def post_prepare_hook_highway_handle_test_compilation_issues(self, *args, **kwar update_build_option('optarch', self.orig_optarch) -def pre_prepare_hook_llvm_a64fx(self, *args, **kwargs): +def pre_prepare_hook_llvm15_a64fx(self, *args, **kwargs): """ - Solve issues with compiling LLVM on A64FX by changing the optarch build option. + Solve issues with compiling LLVM 15.0.5 on A64FX by changing the optarch build option. + Rust 1.65.0 also includes LLVM 15, so we do the same for that application. cfr. https://github.com/EESSI/software-layer/issues/1213 """ cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR') - if self.name == 'LLVM' and self.version == '15.0.5' and cpu_target == CPU_TARGET_A64FX: - self.orig_optarch = build_option('optarch') - update_build_option('optarch', 'march=armv8.2-a') - else: - raise EasyBuildError("LLVM-specific hook triggered for non-Highway easyconfig?!") + if cpu_target == CPU_TARGET_A64FX: + if (self.name == 'LLVM' and self.version == '15.0.5') or (self.name == 'Rust' and self.version == '1.65.0'): + self.orig_optarch = build_option('optarch') + update_build_option('optarch', 'march=armv8.2-a') -def post_prepare_hook_llvm_a64fx(self, *args, **kwargs): +def post_prepare_hook_llvm15_a64fx(self, *args, **kwargs): """ - Post-prepare hook for LLVM to reset optarch build option. + Post-prepare hook for LLVM 15 to reset optarch build option. """ cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR') - if self.name == 'LLVM' and self.version == '15.0.5' and cpu_target == CPU_TARGET_A64FX: - update_build_option('optarch', self.orig_optarch) + if cpu_target == CPU_TARGET_A64FX: + if (self.name == 'LLVM' and self.version == '15.0.5') or (self.name == 'Rust' and self.version == '1.65.0'): + update_build_option('optarch', self.orig_optarch) def pre_configure_hook(self, *args, **kwargs): @@ -1632,13 +1633,15 @@ def post_easyblock_hook(self, *args, **kwargs): PRE_PREPARE_HOOKS = { 'Highway': pre_prepare_hook_highway_handle_test_compilation_issues, - 'LLVM': pre_prepare_hook_llvm_a64fx, + 'LLVM': post_prepare_hook_llvm15_a64fx, + 'Rust': post_prepare_hook_llvm15_a64fx, } POST_PREPARE_HOOKS = { 'GCCcore': post_prepare_hook_gcc_prefixed_ld_rpath_wrapper, 'Highway': post_prepare_hook_highway_handle_test_compilation_issues, - 'LLVM': post_prepare_hook_llvm_a64fx, + 'LLVM': post_prepare_hook_llvm15_a64fx, + 'Rust': post_prepare_hook_llvm15_a64fx, } PRE_CONFIGURE_HOOKS = { From 1d6db72882e31118a3647012662e99511c70f788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 3 Oct 2025 09:00:52 +0200 Subject: [PATCH 3/7] remove hook that disabled Rust 1.65.0 and replaced it by 1.75.0 --- eb_hooks.py | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 9409b046..d2f57c81 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -50,7 +50,6 @@ HOST_INJECTIONS_LOCATION = "/cvmfs/software.eessi.io/host_injections/" # Make sure a single environment variable name is used for this throughout the hooks -EESSI_IGNORE_A64FX_RUST1650_ENVVAR="EESSI_IGNORE_LMOD_ERROR_A64FX_RUST1650" EESSI_IGNORE_ZEN4_GCC1220_ENVVAR="EESSI_IGNORE_LMOD_ERROR_ZEN4_GCC1220" STACK_REPROD_SUBDIR = 'reprod' @@ -156,9 +155,6 @@ def parse_hook(ec, *args, **kwargs): if cpu_target == CPU_TARGET_ZEN4: parse_hook_zen4_module_only(ec, eprefix) - # All A64FX builds for the 2022b toolchain should use a newer Rust version, as the original one does not work - parse_hook_bump_rust_version_in_2022b_for_a64fx(ec, eprefix) - # inject the GPU property (if required) ec = inject_gpu_property(ec) @@ -453,33 +449,6 @@ def parse_hook_openblas_relax_lapack_tests_num_errors(ec, eprefix): raise EasyBuildError("OpenBLAS-specific hook triggered for non-OpenBLAS easyconfig?!") -def parse_hook_bump_rust_version_in_2022b_for_a64fx(ec, eprefix): - """ - Replace Rust 1.65.0 build dependency by version 1.75.0 for A64FX builds, - because version 1.65.0 has build issues. - """ - cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR') - - if cpu_target == CPU_TARGET_A64FX: - # For Rust 1.65.0 itself we inject an error message in the module file - if ec['name'] == 'Rust' and ec['version'] == '1.65.0': - errmsg = "Rust 1.65.0 is not supported on A64FX. Please use version 1.75.0 instead." - ec['modluafooter'] = 'if (not os.getenv("%s")) then LmodError("%s") end' % (EESSI_IGNORE_A64FX_RUST1650_ENVVAR, errmsg) - - # For any builds that have a build dependency on Rust 1.65.0, we bump the version to 1.75.0 - if is_gcccore_1220_based(ecname=ec['name'], ecversion=ec['version'], - tcname=ec['toolchain']['name'], tcversion=ec['toolchain']['version']): - - build_deps = ec['builddependencies'] - rust_name = 'Rust' - rust_original_version = '1.65.0' - rust_new_version = '1.75.0' - for idx, build_dep in enumerate(build_deps): - if build_dep[0] == rust_name and build_dep[1] == rust_original_version: - build_deps[idx] = (rust_name, rust_new_version) - break - - def parse_hook_pybind11_replace_catch2(ec, eprefix): """ Replace Catch2 build dependency in pybind11 easyconfigs with one that doesn't use system toolchain. @@ -605,8 +574,6 @@ def is_unsupported_module(ec): """ cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR') - if cpu_target == CPU_TARGET_A64FX and ec.name == 'Rust' and ec.version == '1.65.0': - return EESSI_IGNORE_A64FX_RUST1650_ENVVAR if cpu_target == CPU_TARGET_ZEN4 and is_gcccore_1220_based(ecname=ec.name, ecversion=ec.version, tcname=ec.toolchain.name, tcversion=ec.toolchain.version): return EESSI_IGNORE_ZEN4_GCC1220_ENVVAR return False From 0e92f399db6188bd78a3fbd5e1d84c7d37e2d8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 3 Oct 2025 09:09:08 +0200 Subject: [PATCH 4/7] add easystack for rebuild Rust 1.65.0 --- .../20251003-eb-4.8.2-Rust-1.65.0-a64fx-with-optarch.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 easystacks/software.eessi.io/2023.06/rebuilds/20251003-eb-4.8.2-Rust-1.65.0-a64fx-with-optarch.yml diff --git a/easystacks/software.eessi.io/2023.06/rebuilds/20251003-eb-4.8.2-Rust-1.65.0-a64fx-with-optarch.yml b/easystacks/software.eessi.io/2023.06/rebuilds/20251003-eb-4.8.2-Rust-1.65.0-a64fx-with-optarch.yml new file mode 100644 index 00000000..20c35ce3 --- /dev/null +++ b/easystacks/software.eessi.io/2023.06/rebuilds/20251003-eb-4.8.2-Rust-1.65.0-a64fx-with-optarch.yml @@ -0,0 +1,8 @@ +# 2025.10.03 +# Rust 1.65.0 had build failures on A64FX (related to its included LLVM), +# and we worked around by using 1.75.0 and adding a dummy module file for 1.65.0. +# It should be possible to build it with optarch=march=armv8.2-a, so we need to rebuild it. +# +# See https://github.com/EESSI/software-layer/issues/1213 +easyconfigs: + - Rust-1.65.0-GCCcore-12.2.0.eb From f14aa6711d9b7e3be7ace7da34146d1661d4b8e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 3 Oct 2025 09:09:25 +0200 Subject: [PATCH 5/7] add easystack that adds LLVM 15 --- .../2023.06/a64fx/eessi-2023.06-eb-4.8.2-2022b.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 easystacks/software.eessi.io/2023.06/a64fx/eessi-2023.06-eb-4.8.2-2022b.yml diff --git a/easystacks/software.eessi.io/2023.06/a64fx/eessi-2023.06-eb-4.8.2-2022b.yml b/easystacks/software.eessi.io/2023.06/a64fx/eessi-2023.06-eb-4.8.2-2022b.yml new file mode 100644 index 00000000..170e9308 --- /dev/null +++ b/easystacks/software.eessi.io/2023.06/a64fx/eessi-2023.06-eb-4.8.2-2022b.yml @@ -0,0 +1,2 @@ +easyconfigs: + - LLVM-15.0.5-GCCcore-12.2.0.eb From 1ddd58e67268eb23a0c1e2e9e4c89f1141e0f53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 3 Oct 2025 09:20:30 +0200 Subject: [PATCH 6/7] fix name of pre prepare hook for LLVM --- eb_hooks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index d2f57c81..c8f014f2 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1600,8 +1600,8 @@ def post_easyblock_hook(self, *args, **kwargs): PRE_PREPARE_HOOKS = { 'Highway': pre_prepare_hook_highway_handle_test_compilation_issues, - 'LLVM': post_prepare_hook_llvm15_a64fx, - 'Rust': post_prepare_hook_llvm15_a64fx, + 'LLVM': pre_prepare_hook_llvm15_a64fx, + 'Rust': pre_prepare_hook_llvm15_a64fx, } POST_PREPARE_HOOKS = { From c7eb0367a6cd253590e70eaff4165c01c6b1ff81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bob=20Dr=C3=B6ge?= Date: Fri, 3 Oct 2025 14:24:26 +0200 Subject: [PATCH 7/7] remove easystacks again --- .../2023.06/a64fx/eessi-2023.06-eb-4.8.2-2022b.yml | 2 -- .../20251003-eb-4.8.2-Rust-1.65.0-a64fx-with-optarch.yml | 8 -------- 2 files changed, 10 deletions(-) delete mode 100644 easystacks/software.eessi.io/2023.06/a64fx/eessi-2023.06-eb-4.8.2-2022b.yml delete mode 100644 easystacks/software.eessi.io/2023.06/rebuilds/20251003-eb-4.8.2-Rust-1.65.0-a64fx-with-optarch.yml diff --git a/easystacks/software.eessi.io/2023.06/a64fx/eessi-2023.06-eb-4.8.2-2022b.yml b/easystacks/software.eessi.io/2023.06/a64fx/eessi-2023.06-eb-4.8.2-2022b.yml deleted file mode 100644 index 170e9308..00000000 --- a/easystacks/software.eessi.io/2023.06/a64fx/eessi-2023.06-eb-4.8.2-2022b.yml +++ /dev/null @@ -1,2 +0,0 @@ -easyconfigs: - - LLVM-15.0.5-GCCcore-12.2.0.eb diff --git a/easystacks/software.eessi.io/2023.06/rebuilds/20251003-eb-4.8.2-Rust-1.65.0-a64fx-with-optarch.yml b/easystacks/software.eessi.io/2023.06/rebuilds/20251003-eb-4.8.2-Rust-1.65.0-a64fx-with-optarch.yml deleted file mode 100644 index 20c35ce3..00000000 --- a/easystacks/software.eessi.io/2023.06/rebuilds/20251003-eb-4.8.2-Rust-1.65.0-a64fx-with-optarch.yml +++ /dev/null @@ -1,8 +0,0 @@ -# 2025.10.03 -# Rust 1.65.0 had build failures on A64FX (related to its included LLVM), -# and we worked around by using 1.75.0 and adding a dummy module file for 1.65.0. -# It should be possible to build it with optarch=march=armv8.2-a, so we need to rebuild it. -# -# See https://github.com/EESSI/software-layer/issues/1213 -easyconfigs: - - Rust-1.65.0-GCCcore-12.2.0.eb