Can't compile on aarch64 on MacOS
tasansal opened this issue · 0 comments
tasansal commented
Hi, I am trying to compile the code in MacOS with an M1 Max chip (aarch64 / ARM64).
I am getting the following compilation error coming from ARM's Neon extensions.
To reproduce:
export CC=clang
export CXX=clang
git clone https://github.com/powturbo/Turbo-Run-Length-Encoding.git
cd Turbo-Run-Length-Encoding
make
- With gcc and g++, I get the same error. So, not Clang related.
- I tried adding another else statement to the makefile and set arch to
aarch64
ifuname -m
returnsarm64
, as M1 returnsarm64
, but notaarch64
. Without this I believe it goes on tonative
compiler optimizations, correct?
cc -O3 -DNDEBUG -s -w -Wall -std=gnu99 -DUSE_THREADS -fstrict-aliasing -Iext -falign-loops trlec.c -c -o trlec.o
cc -O3 -DNDEBUG -s -w -Wall -std=gnu99 -DUSE_THREADS -fstrict-aliasing -Iext -falign-loops trled.c -c -o trled.o
In file included from trled.c:46:
./include_/sse_neon.h:232:85: error: invalid conversion between vector type 'uint64x2_t' (vector of 2 'uint64_t' values) and 'uint8x8_t' (vector of 8 'uint8_t' values) of different size
static ALWAYS_INLINE uint64_t mm_movemask4_epu8(__m128i v) { return vgetq_lane_u64((uint64x2_t)vshrn_n_u16((uint8x16_t)v, 4), 0); } //uint8x16_t
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/15.0.0/include/arm_neon.h:7749:21: note: expanded from macro 'vgetq_lane_u64'
uint64x2_t __s0 = __p0; \
^~~~
Any ideas?