openblas: prevent microarch flags for generic targets (#22270)

As of OpenBLAS 0.3.13, leaving off `TARGET` by default optimizes most
code for the host system -- adding flags that cause the resulting
library to fail (SIGILL) on older systems.  This change should ensure
that a "x86_64" target for example will work across deployment systems.

https://github.com/xianyi/OpenBLAS/issues/3139
This commit is contained in:
Seth R. Johnson 2021-03-13 06:00:15 -05:00 committed by GitHub
parent 746081e933
commit 5b2a54952c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -218,8 +218,10 @@ def _microarch_target_args(self):
if microarch.vendor == 'generic': if microarch.vendor == 'generic':
# User requested a generic platform, or we couldn't find a good # User requested a generic platform, or we couldn't find a good
# match for the requested one. Allow OpenBLAS to determine # match for the requested one. Allow OpenBLAS to determine
# an optimized kernel at run time. # an optimized kernel at run time, including older CPUs, while
args.append('DYNAMIC_ARCH=1') # forcing it not to add flags for the current host compiler.
args.extend(['DYNAMIC_ARCH=1', 'DYNAMIC_OLDER=1',
'TARGET=GENERIC'])
elif microarch.name in skylake: elif microarch.name in skylake:
# Special case for renaming skylake family # Special case for renaming skylake family
args.append('TARGET=SKYLAKEX') args.append('TARGET=SKYLAKEX')