From 84fb0b705f09eace90d2c42d59a8b862578daa85 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Fri, 30 Oct 2026 13:28:12 -0500 Subject: [PATCH 1/3] Drop UCX --enable-optimizations for generic CPU targets UCX's configure runs an AVX test program on the machine doing the build when optimizations are enabled, and adds -mavx to the flags for the whole package if it passes. The x86_64/generic UCX installs in 2023.06, 2025.06 and 2026.06 all came out with AVX in nearly every library. Strip the option in a pre-configure hook when the target is one of the generic ones or optarch is GENERIC, and check the configure line in the hooks workflow. See EESSI/software-layer#1778. --- .github/workflows/test-eb-hooks.yml | 49 +++++++++++++++++++++++++++++ eb_hooks.py | 23 ++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/.github/workflows/test-eb-hooks.yml b/.github/workflows/test-eb-hooks.yml index 178c7cdf3..9126300e0 100644 --- a/.github/workflows/test-eb-hooks.yml +++ b/.github/workflows/test-eb-hooks.yml @@ -179,3 +179,52 @@ jobs: # echo "$OUT" | grep -qiF 'add_property("arch","gpu")' # echo "$OUT" | grep -qiF 'setenv("EESSIROCMVERSION","6.4.1")' # echo "rompi toolchain handled" + + check_ucx_generic_optimizations: + runs-on: ubuntu-24.04 + strategy: + matrix: + include: + - EESSI_VERSION: '2023.06' + EASYCONFIG: 'UCX-1.15.0-GCCcore-13.2.0.eb' + - EESSI_VERSION: '2025.06' + EASYCONFIG: 'UCX-1.19.0-GCCcore-14.3.0.eb' + + steps: + - name: Check out software-layer repository + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Mount EESSI CernVM-FS repository + uses: eessi/github-action-eessi@v3 + with: + eessi_stack_version: ${{matrix.EESSI_VERSION}} + use_eessi_module: true + + - name: Test that UCX is configured without --enable-optimizations for generic targets + if: ${{ github.event_name == 'pull_request' }} + run: | + module load EESSI-extend/${{matrix.EESSI_VERSION}}-easybuild + + # print the ./configure command line of an extended dry run (eb wraps it at 80 columns) + configure_line() { + eb --hooks=$PWD/eb_hooks.py --extended-dry-run "$@" ${{matrix.EASYCONFIG}} 2>&1 \ + | grep -A6 'running shell command "./configure' | tr -d '\n' + } + + # the runner's own CPU target keeps the option + line=$(configure_line) + grep -q -- '--enable-cma' <<< "$line" + grep -q -- '--enable-optimizations' <<< "$line" + echo "Native target keeps --enable-optimizations" + + for target in x86_64/generic aarch64/generic; do + line=$(EESSI_SOFTWARE_SUBDIR=$target configure_line) + grep -q -- '--enable-cma' <<< "$line" + grep -q -- '--enable-optimizations' <<< "$line" && exit 1 + echo "$target drops --enable-optimizations" + done + + line=$(configure_line --optarch=GENERIC) + grep -q -- '--enable-cma' <<< "$line" + grep -q -- '--enable-optimizations' <<< "$line" && exit 1 + echo "--optarch=GENERIC drops --enable-optimizations" diff --git a/eb_hooks.py b/eb_hooks.py index fd3aed755..0c73b15b2 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1720,6 +1720,28 @@ def pre_configure_hook_libfabric_disable_psm3_x86_64_generic(self, *args, **kwar raise EasyBuildError("libfabric-specific hook triggered for non-libfabric easyconfig?!") +def pre_configure_hook_ucx_generic(self, *args, **kwargs): + """ + Pre-configure hook for UCX: drop --enable-optimizations when building for a generic CPU target. + With that option, UCX's configure runs an AVX test program on the build host and adds -mavx to the + compiler flags of the whole package when it passes (on aarch64 it may add -mcpu for the build host); + UCX does not check the CPU at run time, so the result needs AVX. + See https://github.com/EESSI/software-layer/issues/1778 + """ + if self.name == 'UCX': + cpu_target = get_eessi_envvar('EESSI_SOFTWARE_SUBDIR') + generic = cpu_target in (CPU_TARGET_X86_64_GENERIC, CPU_TARGET_AARCH64_GENERIC) + if generic or build_option('optarch') == OPTARCH_GENERIC: + configopts = self.cfg['configopts'] + opts = configopts.split() + if '--enable-optimizations' in opts: + self.cfg['configopts'] = ' '.join(opt for opt in opts if opt != '--enable-optimizations') + print_msg("Removed --enable-optimizations from configure options for %s: %s", + self.name, self.cfg['configopts']) + else: + raise EasyBuildError("UCX-specific hook triggered for non-UCX easyconfig?!") + + def pre_configure_hook_metabat_filtered_zlib_dep(self, *args, **kwargs): """ Pre-configure hook for MetaBAT: @@ -2772,6 +2794,7 @@ def post_easyblock_hook(self, *args, **kwargs): 'ROCm-LLVM': pre_configure_hook_llvm, 'Score-P': pre_configure_hook_score_p, 'SymEngine': pre_configure_hook_symengine, + 'UCX': pre_configure_hook_ucx_generic, 'Visit': pre_configure_hook_visit, 'WRF': pre_configure_hook_wrf_aarch64, 'Zoltan': pre_configure_hook_Zoltan, From 29489964e3947f9599ed6ce528aae0f72914ac98 Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Fri, 30 Oct 2026 13:29:12 -0500 Subject: [PATCH 2/3] Drop the UCX CI check and name the generic target in the hook message The workflow job cannot pass until the rebuilds in EESSI/software-layer#1780 are deployed, and a CI job per hook fix is more than this change needs. --- .github/workflows/test-eb-hooks.yml | 49 ----------------------------- eb_hooks.py | 4 +-- 2 files changed, 2 insertions(+), 51 deletions(-) diff --git a/.github/workflows/test-eb-hooks.yml b/.github/workflows/test-eb-hooks.yml index 9126300e0..178c7cdf3 100644 --- a/.github/workflows/test-eb-hooks.yml +++ b/.github/workflows/test-eb-hooks.yml @@ -179,52 +179,3 @@ jobs: # echo "$OUT" | grep -qiF 'add_property("arch","gpu")' # echo "$OUT" | grep -qiF 'setenv("EESSIROCMVERSION","6.4.1")' # echo "rompi toolchain handled" - - check_ucx_generic_optimizations: - runs-on: ubuntu-24.04 - strategy: - matrix: - include: - - EESSI_VERSION: '2023.06' - EASYCONFIG: 'UCX-1.15.0-GCCcore-13.2.0.eb' - - EESSI_VERSION: '2025.06' - EASYCONFIG: 'UCX-1.19.0-GCCcore-14.3.0.eb' - - steps: - - name: Check out software-layer repository - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - - name: Mount EESSI CernVM-FS repository - uses: eessi/github-action-eessi@v3 - with: - eessi_stack_version: ${{matrix.EESSI_VERSION}} - use_eessi_module: true - - - name: Test that UCX is configured without --enable-optimizations for generic targets - if: ${{ github.event_name == 'pull_request' }} - run: | - module load EESSI-extend/${{matrix.EESSI_VERSION}}-easybuild - - # print the ./configure command line of an extended dry run (eb wraps it at 80 columns) - configure_line() { - eb --hooks=$PWD/eb_hooks.py --extended-dry-run "$@" ${{matrix.EASYCONFIG}} 2>&1 \ - | grep -A6 'running shell command "./configure' | tr -d '\n' - } - - # the runner's own CPU target keeps the option - line=$(configure_line) - grep -q -- '--enable-cma' <<< "$line" - grep -q -- '--enable-optimizations' <<< "$line" - echo "Native target keeps --enable-optimizations" - - for target in x86_64/generic aarch64/generic; do - line=$(EESSI_SOFTWARE_SUBDIR=$target configure_line) - grep -q -- '--enable-cma' <<< "$line" - grep -q -- '--enable-optimizations' <<< "$line" && exit 1 - echo "$target drops --enable-optimizations" - done - - line=$(configure_line --optarch=GENERIC) - grep -q -- '--enable-cma' <<< "$line" - grep -q -- '--enable-optimizations' <<< "$line" && exit 1 - echo "--optarch=GENERIC drops --enable-optimizations" diff --git a/eb_hooks.py b/eb_hooks.py index 0c73b15b2..6899b2c1b 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1736,8 +1736,8 @@ def pre_configure_hook_ucx_generic(self, *args, **kwargs): opts = configopts.split() if '--enable-optimizations' in opts: self.cfg['configopts'] = ' '.join(opt for opt in opts if opt != '--enable-optimizations') - print_msg("Removed --enable-optimizations from configure options for %s: %s", - self.name, self.cfg['configopts']) + print_msg("Removed --enable-optimizations from configure options for %s, " + "since this is a build for a generic CPU target: %s", self.name, self.cfg['configopts']) else: raise EasyBuildError("UCX-specific hook triggered for non-UCX easyconfig?!") From 5888a366e21bfffde7ec9bc576de2bec865ecdfc Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Mon, 2 Nov 2026 09:34:38 +0000 Subject: [PATCH 3/3] Correct the UCX hook comment on the runtime CPU check ucs_check_cpu_flags in UCX 1.13.1 through 1.20.0 exits with FATAL when the library was compiled with avx and the CPU lacks it. The comment said UCX does not check the CPU at run time. --- eb_hooks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eb_hooks.py b/eb_hooks.py index 6899b2c1b..3e279b042 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -1723,9 +1723,9 @@ def pre_configure_hook_libfabric_disable_psm3_x86_64_generic(self, *args, **kwar def pre_configure_hook_ucx_generic(self, *args, **kwargs): """ Pre-configure hook for UCX: drop --enable-optimizations when building for a generic CPU target. - With that option, UCX's configure runs an AVX test program on the build host and adds -mavx to the - compiler flags of the whole package when it passes (on aarch64 it may add -mcpu for the build host); - UCX does not check the CPU at run time, so the result needs AVX. + With that option, UCX's configure runs an AVX test program on the build host and, when it passes, + adds -mavx to the compiler flags of the whole package (on aarch64 it may add -mcpu for the build host). + ucs_check_cpu_flags then aborts at load time if the CPU does not support those flags. See https://github.com/EESSI/software-layer/issues/1778 """ if self.name == 'UCX':