我最近从 Windows 切换到 mac,勇敢地拿起了带有 macOS BigSur 和 M1 芯片的新 MacBook。我正在尝试按照程序的安装指南安装 BPP ( https://github.com/bpp/bpp ),但在尝试编译可执行文件时遇到问题。
git clone https://github.com/bpp/bpp.git
cd bpp/src
make
这给出了多个这样的错误:
cc -D_GNU_SOURCE -DHAVE_SSE3 -DHAVE_AVX -DHAVE_AVX2 -g -msse3 -O3 -Wall -Wsign-compare -c -o bpp.o bpp.c
clang: warning: argument unused during compilation: '-msse3' [-Wunused-command-line-argument]
In file included from bpp.c:22:
In file included from ./bpp.h:43:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/x86intrin.h:15:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/immintrin.h:14:
Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/mmintrin.h:373:12: error:
invalid conversion between vector type '__m64' (vector of 1 'long long'
value) and integer type 'int' of different size
return (__m64)__builtin_ia32_paddw((__v4hi)__m1, (__v4hi)__m2);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
所以我认为问题可能在于默认编译器是 Clang 12,并且在安装 gcc-11(应该适用于 M1)之后运行:
make CC=/opt/homebrew/bin/gcc-11
但它也给出了一个错误:
gcc-11: error: unrecognized command-line option '-msse3'
make: *** [bpp.o] Error 1
由于我不是经验丰富的编码员,而且 M1 是如此新,以至于从论坛中找到解决方案并不简单,我有点走入了死胡同。有什么建议可以解决这个问题吗?
我想这是因为 SSE3 是 x86 功能吗?