From 893f76da53f2ca53fc18f3a08e370b4dfd80ebb4 Mon Sep 17 00:00:00 2001 From: "Seth R. Johnson" Date: Tue, 18 Feb 2020 15:23:54 -0500 Subject: Fix OpenBLAS 0.3.8 build on darwin (#15041) * Fix OpenBLAS 0.3.8 build on darwin See https://github.com/xianyi/OpenBLAS/issues/2431, patched in https://github.com/xianyi/OpenBLAS/issues/2431 . * Add references for patchfile --- .../packages/openblas/openblas-0.3.8-darwin.patch | 23 ++++++++++++++++++++++ .../repos/builtin/packages/openblas/package.py | 4 ++++ 2 files changed, 27 insertions(+) create mode 100644 var/spack/repos/builtin/packages/openblas/openblas-0.3.8-darwin.patch diff --git a/var/spack/repos/builtin/packages/openblas/openblas-0.3.8-darwin.patch b/var/spack/repos/builtin/packages/openblas/openblas-0.3.8-darwin.patch new file mode 100644 index 0000000000..e844e0be24 --- /dev/null +++ b/var/spack/repos/builtin/packages/openblas/openblas-0.3.8-darwin.patch @@ -0,0 +1,23 @@ +diff --git a/c_check b/c_check +index fbd1838a..e10def2e 100644 +--- a/c_check ++++ b/c_check +@@ -263,18 +263,6 @@ if ($architecture ne $hostarch) { + + $cross = 1 if ($os ne $hostos); + +-# rework cross suffix and architecture if we are on OSX cross-compiling for ARMV8-based IOS +-# the initial autodetection will have been confused by the command-line arguments to clang +-# and the cross-compiler apparently still claims to build for x86_64 in its CC -E output +-if (($os eq "Darwin") && ($cross_suffix ne "")) { +- my $tmpnam = `xcrun --sdk iphoneos --find clang`; +- $cross_suffix = substr($tmpnam, 0, rindex($tmpnam, "/")+1 ); +-# this should produce something like $cross_suffix="/Applications/Xcode-10.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/"; +- $cross =1; +- $architecture = arm64; +-} +- +- + + $openmp = "" if $ENV{USE_OPENMP} != 1; + diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index 607a41e85d..0ad58605c4 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -86,6 +86,10 @@ class Openblas(MakefilePackage): sha256='f1b066a4481a50678caeb7656bf3e6764f45619686ac465f257c8017a2dc1ff0', when='@0.3.0:0.3.3') + # Fix https://github.com/xianyi/OpenBLAS/issues/2431 + # Patch derived from https://github.com/xianyi/OpenBLAS/pull/2424 + patch('openblas-0.3.8-darwin.patch', when='@0.3.8 platform=darwin') + # Add conditions to f_check to determine the Fujitsu compiler patch('openblas_fujitsu.patch', when='%fj') -- cgit v1.2.3-60-g2f50