diff --git a/easystacks/software.eessi.io/2023.06/rebuilds/20241017-eb-4.9.4-OpenBLAS-aarch64-generic.yml b/easystacks/software.eessi.io/2023.06/rebuilds/20241017-eb-4.9.4-OpenBLAS-aarch64-generic.yml new file mode 100644 index 0000000000..4ba7983da6 --- /dev/null +++ b/easystacks/software.eessi.io/2023.06/rebuilds/20241017-eb-4.9.4-OpenBLAS-aarch64-generic.yml @@ -0,0 +1,9 @@ +# 2024.10.17 +# TARGET=ARMV8 must be used when building OpenBLAS for aarch64/generic, +# since otherwise "Illegal instruction" errors may happen in the driver part of OpenBLAS +# on systems that only support a minimal instruction set like Arm v8 (like Raspberry Pi SBCs); +# see also https://github.com/OpenMathLib/OpenBLAS/issues/4945 +easyconfigs: + - OpenBLAS-0.3.21-GCC-12.2.0.eb + - OpenBLAS-0.3.23-GCC-12.3.0.eb + - OpenBLAS-0.3.24-GCC-13.2.0.eb diff --git a/eb_hooks.py b/eb_hooks.py index 33bdf53c52..ba6f9ad5da 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -491,11 +491,19 @@ def pre_configure_hook_openblas_optarch_generic(self, *args, **kwargs): for step in ('build', 'test', 'install'): self.cfg.update(f'{step}opts', "DYNAMIC_ARCH=1") - # use -mtune=generic rather than -mcpu=generic in $CFLAGS on aarch64, - # because -mcpu=generic implies a particular -march=armv* which clashes with those used by OpenBLAS - # when building with DYNAMIC_ARCH=1 if get_cpu_architecture() == AARCH64: + # when building for aarch64/generic, we also need to set TARGET=ARMV8 to make sure + # that the driver parts of OpenBLAS are compiled generically; + # see also https://github.com/OpenMathLib/OpenBLAS/issues/4945 + for step in ('build', 'test', 'install'): + self.cfg.update(f'{step}opts', "TARGET=ARMV8") + + # use -mtune=generic rather than -mcpu=generic in $CFLAGS for aarch64/generic, + # because -mcpu=generic implies a particular -march=armv* which clashes with those used by OpenBLAS + # when building with DYNAMIC_ARCH=1 cflags = os.getenv('CFLAGS').replace('-mcpu=generic', '-mtune=generic') + self.log.info("Replaced -mcpu=generic with -mtune=generic in $CFLAGS") + self.log.info("Updating $CFLAGS to: %s", cflags) env.setvar('CFLAGS', cflags) else: raise EasyBuildError("OpenBLAS-specific hook triggered for non-OpenBLAS easyconfig?!")