summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Wibking <ben@wibking.com>2023-12-05 03:53:54 -0500
committerGitHub <noreply@github.com>2023-12-05 09:53:54 +0100
commit8727195b84a7b7d28c2ed1051554f97b62fe7def (patch)
treeaf0de4b0e0b075116822f56a61549b5cfe2c912b
parent456f2ca40fbf33d19f9cf690ce2b5bf7eb9a68df (diff)
downloadspack-8727195b84a7b7d28c2ed1051554f97b62fe7def.tar.gz
spack-8727195b84a7b7d28c2ed1051554f97b62fe7def.tar.bz2
spack-8727195b84a7b7d28c2ed1051554f97b62fe7def.tar.xz
spack-8727195b84a7b7d28c2ed1051554f97b62fe7def.zip
openblas: fix macOS build when using XCode 15 or newer (#41420)
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
-rw-r--r--var/spack/repos/builtin/packages/openblas/package.py3
-rw-r--r--var/spack/repos/builtin/packages/openblas/xcode15-fortran.patch22
2 files changed, 25 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py
index e88a3f418e..ea9f82bf26 100644
--- a/var/spack/repos/builtin/packages/openblas/package.py
+++ b/var/spack/repos/builtin/packages/openblas/package.py
@@ -93,6 +93,9 @@ class Openblas(CMakePackage, MakefilePackage):
provides("lapack@3.9.1:", when="@0.3.15:")
provides("lapack@3.7.0", when="@0.2.20")
+ # https://github.com/OpenMathLib/OpenBLAS/pull/4328
+ patch("xcode15-fortran.patch", when="@0.3.25 %apple-clang@15:")
+
# https://github.com/xianyi/OpenBLAS/pull/2519/files
patch("ifort-msvc.patch", when="%msvc")
diff --git a/var/spack/repos/builtin/packages/openblas/xcode15-fortran.patch b/var/spack/repos/builtin/packages/openblas/xcode15-fortran.patch
new file mode 100644
index 0000000000..7f56a3b5d0
--- /dev/null
+++ b/var/spack/repos/builtin/packages/openblas/xcode15-fortran.patch
@@ -0,0 +1,22 @@
+From 47b03fd4b4ce7bc51d5b56397e52e6da3c5f3f36 Mon Sep 17 00:00:00 2001
+From: Martin Kroeker <martin@ruby.chemie.uni-freiburg.de>
+Date: Sat, 18 Nov 2023 23:45:02 +0100
+Subject: [PATCH] Copy XCode15-specific workaround to Fortran flags to fix
+ build of tests
+
+---
+ Makefile.system | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.system b/Makefile.system
+index 1b84195e45..ff06e503cb 100644
+--- a/Makefile.system
++++ b/Makefile.system
+@@ -407,6 +407,7 @@ XCVER = $(shell pkgutil --pkg-info=com.apple.pkg.CLTools_Executables |awk '/vers
+ endif
+ ifeq (x$(XCVER), x 15)
+ CCOMMON_OPT += -Wl,-ld_classic
++FCOMMON_OPT += -Wl,-ld_classic
+ endif
+ endif
+