Skip to content

Commit 188938a

Browse files
committed
use updated OpenBLAS easyblock that sets DYNAMIC_ARCH=1 for generic builds + uses TARGET=ARMV8 for aarch64/generic
1 parent abde580 commit 188938a

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

easystacks/software.eessi.io/2023.06/rebuilds/20241017-eb-4.9.4-OpenBLAS-aarch64-generic.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
# on systems that only support a minimal instruction set like Arm v8 (like Raspberry Pi SBCs);
55
# see also https://github.com/OpenMathLib/OpenBLAS/issues/4945
66
easyconfigs:
7-
- OpenBLAS-0.3.21-GCC-12.2.0.eb
8-
- OpenBLAS-0.3.23-GCC-12.3.0.eb
9-
- OpenBLAS-0.3.24-GCC-13.2.0.eb
7+
- OpenBLAS-0.3.21-GCC-12.2.0.eb:
8+
options:
9+
# see https://github.com/easybuilders/easybuild-easyblocks/pull/3492
10+
include-easyblocks-from-commit: d06d9617d9bfb63d338b6879eab9da81c8a312d8
11+
- OpenBLAS-0.3.23-GCC-12.3.0.eb:
12+
options:
13+
# see https://github.com/easybuilders/easybuild-easyblocks/pull/3492
14+
include-easyblocks-from-commit: d06d9617d9bfb63d338b6879eab9da81c8a312d8
15+
- OpenBLAS-0.3.24-GCC-13.2.0.eb:
16+
options:
17+
# see https://github.com/easybuilders/easybuild-easyblocks/pull/3492
18+
include-easyblocks-from-commit: d06d9617d9bfb63d338b6879eab9da81c8a312d8

eb_hooks.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -486,25 +486,33 @@ def pre_configure_hook_openblas_optarch_generic(self, *args, **kwargs):
486486
"""
487487
Pre-configure hook for OpenBLAS: add DYNAMIC_ARCH=1 to build/test/install options when using --optarch=GENERIC
488488
"""
489+
# note: OpenBLAS easyblock was updated in https://github.com/easybuilders/easybuild-easyblocks/pull/3492
490+
# to take care of this already, so at some point this hook can be removed...
489491
if self.name == 'OpenBLAS':
490492
if build_option('optarch') == OPTARCH_GENERIC:
493+
dynamic_arch = 'DYNAMIC_ARCH=1'
491494
for step in ('build', 'test', 'install'):
492-
self.cfg.update(f'{step}opts', "DYNAMIC_ARCH=1")
495+
if dynamic_arch not in self.cfg[f'{step}opts']:
496+
self.cfg.update(f'{step}opts', dynamic_arch)
493497

494498
if get_cpu_architecture() == AARCH64:
495499
# when building for aarch64/generic, we also need to set TARGET=ARMV8 to make sure
496500
# that the driver parts of OpenBLAS are compiled generically;
497501
# see also https://github.com/OpenMathLib/OpenBLAS/issues/4945
502+
target_armv8 = 'TARGET=ARMV8'
498503
for step in ('build', 'test', 'install'):
499-
self.cfg.update(f'{step}opts', "TARGET=ARMV8")
504+
if target_armv8 not in self.cfg[f'{step}opts']:
505+
self.cfg.update(f'{step}opts', target_armv8)
500506

501507
# use -mtune=generic rather than -mcpu=generic in $CFLAGS for aarch64/generic,
502508
# because -mcpu=generic implies a particular -march=armv* which clashes with those used by OpenBLAS
503509
# when building with DYNAMIC_ARCH=1
504-
cflags = os.getenv('CFLAGS').replace('-mcpu=generic', '-mtune=generic')
505-
self.log.info("Replaced -mcpu=generic with -mtune=generic in $CFLAGS")
506-
self.log.info("Updating $CFLAGS to: %s", cflags)
507-
env.setvar('CFLAGS', cflags)
510+
mcpu_generic = '-mcpu=generic'
511+
cflags = os.getenv('CFLAGS')
512+
if mcpu_generic in cflags:
513+
cflags = cflags.replace(mcpu_generic, '-mtune=generic')
514+
self.log.info("Replaced -mcpu=generic with -mtune=generic in $CFLAGS")
515+
env.setvar('CFLAGS', cflags)
508516
else:
509517
raise EasyBuildError("OpenBLAS-specific hook triggered for non-OpenBLAS easyconfig?!")
510518

0 commit comments

Comments
 (0)