whisper.cpp
whisper.cpp copied to clipboard
ppc64le and intrinsics
ggml.c fails to compile on Debian ppc64le, GCC 11, with:
ggml.c:135:10: fatal error: immintrin.h: No such file or directory 135 | #include <immintrin.h>
If I comment out that line, the build succeeds and the output binary works.
Should be better than commenting it out:
diff --git a/Makefile b/Makefile
index a52df41..3aa7657 100644
--- a/Makefile
+++ b/Makefile
@@ -27,8 +27,10 @@ endif
# Compile flags
#
-CFLAGS = -I. -O3 -std=c11 -fPIC
-CXXFLAGS = -I. -I./examples -O3 -std=c++11 -fPIC
+CC=clang
+CXX=clang++
+CFLAGS = -I. -O3 -std=c11 -fPIC -mcpu=native -DNO_WARN_X86_INTRINSICS
+CXXFLAGS = -I. -I./examples -O3 -std=c++11 -fPIC -mcpu=native -DNO_WARN_X86_INTRINSICS
LDFLAGS =
# OS specific
diff --git a/ggml.c b/ggml.c
index 7c79129..881883a 100644
--- a/ggml.c
+++ b/ggml.c
@@ -133,6 +134,8 @@ ggml_fp16_t ggml_fp32_to_fp16(float x) {
#include <wasm_simd128.h>
#else
#include <immintrin.h>
+#undef bool
+#define bool _Bool
#endif
// FP16 <-> FP32
Looks like my patch builds, but doesn't actually use intrinsics :/