openblas: optimize flags for A64FX (#41093)

This commit is contained in:
Sergio Sánchez Ramírez 2023-11-20 11:20:11 +01:00 committed by GitHub
parent 87a9b428e5
commit 8003f18709
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -192,6 +192,13 @@ class Openblas(CMakePackage, MakefilePackage):
when="@0.3.21 %gcc@:9",
)
# Fix build on A64FX for OpenBLAS v0.3.24
patch(
"https://github.com/OpenMathLib/OpenBLAS/commit/90231bfc4e4afc51f67c248328fbef0cecdbd2c2.patch?full_index=1",
sha256="139e314f3408dc5c080d28887471f382e829d1bd06c8655eb72593e4e7b921cc",
when="@0.3.24 target=a64fx",
)
# See https://github.com/spack/spack/issues/19932#issuecomment-733452619
# Notice: fixed on Amazon Linux GCC 7.3.1 (which is an unofficial version
# as GCC only has major.minor releases. But the bound :7.3.0 doesn't hurt)
@ -370,6 +377,14 @@ def _microarch_target_args(self):
# case can go away.
args.append("TARGET=" + "RISCV64_GENERIC")
elif self.spec.satisfies("@0.3.19: target=a64fx"):
# Special case for Fujitsu's A64FX
if any(self.spec.satisfies(i) for i in ["%gcc@11:", "%clang", "%fj"]):
args.append("TARGET=A64FX")
else:
# fallback to armv8-a+sve without -mtune=a64fx flag
args.append("TARGET=ARMV8SVE")
else:
args.append("TARGET=" + microarch.name.upper())