macOS 中“brew install openblas”出错

macOS 中“brew install openblas”出错

我正在尝试使用以下命令openblas进行安装macOS HighSierra 10.13.6

brew install openblas

不幸的是我收到了这个错误...

brew install openblas
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
==> Updated Casks
Updated 1 cask.

Warning: You are using macOS 10.13.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
old version.

==> Downloading https://github.com/xianyi/OpenBLAS/archive/v0.3.17.tar.gz
Already downloaded: /Users/JohnRambo/Library/Caches/Homebrew/downloads/54106543af17b56e0603879978f1cc3f09459952d7a716fa5168ae43bef77a4e--OpenBLAS-0.3.17.tar.gz
==> make CC=gcc-11 FC=gfortran libs netlib shared
Last 15 lines from /Users/JohnRambo/Library/Logs/Homebrew/openblas/01.make:
                             ^
<stdin>:618:27: error: unexpected token in argument list
        vfmadd231ps     (%r12,%rsi,4){1to16}, %zmm2, %zmm1
                                     ^
<stdin>:623:23: error: unexpected token in argument list
        vmovups (%rcx), %zmm2{%k1}{z}
                             ^
<stdin>:624:2: error: instruction requires: AVX-512 ISA
        vfmadd132ps     %zmm0, %zmm2, %zmm1
        ^
<stdin>:625:23: error: unexpected token in argument list
        vmovups %zmm1, (%rcx){%k1}
                             ^
make[1]: *** [sgemv_n_SKYLAKEX.o] Error 1
make: *** [libs] Error 1

Do not report this issue to Homebrew/brew or Homebrew/core!


Error: You are using macOS 10.13.
We (and Apple) do not provide support for this old version.
You will encounter build failures with some formulae.
Please create pull requests instead of asking for help on Homebrew's GitHub,
Twitter or any other official channels. You are responsible for resolving
any issues you experience while you are running this
old version.

我该如何修复这个错误?

答案1

对于那些拥有旧硬件且无法更新到较新 macOS 版本的人,有一个解决方案指出在OpenBLAS 用户组

编辑文件/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/openblas.rb并添加"NO_AVX512=1"到第一个 make 调用的末尾(写入时位于第 43 行),因此它看起来像:

system "make", "CC=#{ENV.cc}", "FC=gfortran", "libs", "netlib", "shared", "NO_AVX512=1"

然后运行安装而不更新brew(使用HOMEBREW_NO_AUTO_UPDATE=1),否则它将存储更改并将公式恢复到原始状态:

HOMEBREW_NO_AUTO_UPDATE=1 brew install openblas

答案2

通过将 macOS 从 升级到 解决macOS High Sierra 10.13.6问题macOS Big Sur 11.5.2

相关内容