go-skynet / go-llama.cpp

LLama.cpp golang bindings
MIT License
679 stars 83 forks source link

Unable to compile go-llama.cpp due to type mismatches #136

Open Lebed-kun opened 1 year ago

Lebed-kun commented 1 year ago

Configuration:

Steps to reproduce:

cd go-llama.cpp
make libbinding.a

Result:

[  4%] Building C object CMakeFiles/ggml.dir/k_quants.c.o
/usr/bin/cc -DGGML_USE_K_QUANTS -I"/path-to-golang-gpt4all-binding/go-llama.cpp/llama.cpp/." -O3 -DNDEBUG -std=gnu11 -Wall -Wextra -Wpedantic -Wcast-qual -Wdouble-promotion -Wshadow -Wstrict-prototypes -Wpointer-arith -mf16c -mfma -mavx -mavx2 -pthread -MD -MT CMakeFiles/ggml.dir/k_quants.c.o -MF CMakeFiles/ggml.dir/k_quants.c.o.d -o CMakeFiles/ggml.dir/k_quants.c.o -c "/path-to-golang-gpt4all-binding/go-llama.cpp/llama.cpp/k_quants.c"
/path-to-golang-gpt4all-binding/go-llama.cpp/llama.cpp/k_quants.c: In function ‘ggml_vec_dot_q2_K_q8_K’:
/path-to-golang-gpt4all-binding/go-llama.cpp/llama.cpp/k_quants.c:1356:36: warning: implicit declaration of function ‘_mm256_set_m128i’; did you mean ‘_mm256_set_epi8’? [-Wimplicit-function-declaration]
         const __m256i scales[2] = {_mm256_set_m128i(l_scales, l_scales), _mm256_set_m128i(h_scales, h_scales)};
                                    ^~~~~~~~~~~~~~~~
                                    _mm256_set_epi8
/path-to-golang-gpt4all-binding/go-llama.cpp/llama.cpp/k_quants.c:1356:35: warning: missing braces around initializer [-Wmissing-braces]
         const __m256i scales[2] = {_mm256_set_m128i(l_scales, l_scales), _mm256_set_m128i(h_scales, h_scales)};
                                   ^
                                    {                                                                         }
/path-to-golang-gpt4all-binding/go-llama.cpp/llama.cpp/k_quants.c: In function ‘ggml_vec_dot_q3_K_q8_K’:
/path-to-golang-gpt4all-binding/go-llama.cpp/llama.cpp/k_quants.c:1864:35: warning: missing braces around initializer [-Wmissing-braces]
         const __m256i scales[2] = {_mm256_set_m128i(l_scales, l_scales), _mm256_set_m128i(h_scales, h_scales)};
                                   ^
                                    {                                                                         }
/path-to-golang-gpt4all-binding/go-llama.cpp/llama.cpp/k_quants.c: In function ‘ggml_vec_dot_q4_K_q8_K’:
/path-to-golang-gpt4all-binding/go-llama.cpp/llama.cpp/k_quants.c:2480:32: error: incompatible types when initializing type ‘__m256i {aka const __vector(4) long long int}’ using type ‘int’
         const __m256i scales = _mm256_set_m128i(sc128, sc128);
                                ^~~~~~~~~~~~~~~~
/path-to-golang-gpt4all-binding/go-llama.cpp/llama.cpp/k_quants.c: In function ‘ggml_vec_dot_q5_K_q8_K’:
/path-to-golang-gpt4all-binding/go-llama.cpp/llama.cpp/k_quants.c:2966:32: error: incompatible types when initializing type ‘__m256i {aka const __vector(4) long long int}’ using type ‘int’
         const __m256i scales = _mm256_set_m128i(sc128, sc128);
                                ^~~~~~~~~~~~~~~~
CMakeFiles/ggml.dir/build.make:89: recipe for target 'CMakeFiles/ggml.dir/k_quants.c.o' failed
make[3]: *** [CMakeFiles/ggml.dir/k_quants.c.o] Error 1
make[3]: Leaving directory '/path-to-golang-gpt4all-binding/go-llama.cpp/build'
CMakeFiles/Makefile2:417: recipe for target 'CMakeFiles/ggml.dir/all' failed
make[2]: *** [CMakeFiles/ggml.dir/all] Error 2
make[2]: Leaving directory '/path-to-golang-gpt4all-binding/go-llama.cpp/build'
Makefile:100: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/path-to-golang-gpt4all-binding/go-llama.cpp/build'
Makefile:180: recipe for target 'llama.cpp/ggml.o' failed
make: *** [llama.cpp/ggml.o] Error 2