gcc compiling errors using macOS BigSur M1 chip

1k Views Asked by At

I recently switched from Windows to mac and bravely took the new MacBook with macOS BigSur and M1 chip. I'm trying to install BPP (https://github.com/bpp/bpp) following the program's installation guide, but run into problems when trying to compile an executable file.

git clone https://github.com/bpp/bpp.git
cd bpp/src
make

This gave multiple errors like this:

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);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

So I thought maybe the problem is that the default compiler is Clang 12 and after installing gcc-11 (which should be appropriate for M1) run:

make CC=/opt/homebrew/bin/gcc-11

But it gave an error too:

gcc-11: error: unrecognized command-line option '-msse3'
make: *** [bpp.o] Error 1

Since I'm not an experienced coder and with M1 being so new that finding solutions from forums is not simple, I'm kind of in a dead end. Any suggestions how to work through this problem?

I guess it is due to the fact that SSE3 is an x86 feature?

0

There are 0 best solutions below