Skip to content

[User] Error building server; possibly faulty libllama.so build; possible fix #1712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alk0 opened this issue Jun 6, 2023 · 1 comment
Closed

Comments

@alk0
Copy link

alk0 commented Jun 6, 2023

Really sorry for not following the whole template, I just believe it will save some time.

I believe the current Makefile is missing ggml-quants-k.o in libllama.so: and server: targets. I couldn't build server before adding it, and, while libllama.so was built successfully, it seemed to be unusable. Adding ggml-quants-k.o to both target solved these two problems for me.

Environment: Linux, Arch, OpenBLAS, no-AVX CPU (although I don't think any of that matters).

@alk0
Copy link
Author

alk0 commented Jun 6, 2023

Relevant output:

$ make -j2 LLAMA_OPENBLAS=1 LLAMA_BUILD_SERVER=1
I llama.cpp build info: 
I UNAME_S:  Linux
I UNAME_P:  unknown
I UNAME_M:  x86_64
I CFLAGS:   -I.              -O3 -std=c11   -fPIC -DNDEBUG -Wall -Wextra -Wpedantic -Wcast-qual -Wdouble-promotion -Wshadow -Wstrict-prototypes -Wpointer-arith -pthread -march=native -mtune=native -DGGML_USE_OPENBLAS -I/usr/local/include/openblas -I/usr/include/openblas
I CXXFLAGS: -I. -I./examples -O3 -std=c++11 -fPIC -DNDEBUG -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wno-multichar -pthread -march=native -mtune=native
I LDFLAGS:  -lopenblas -lcblas
I CC:       cc (GCC) 13.1.1 20230429
I CXX:      g++ (GCC) 13.1.1 20230429

g++ -I. -I./examples -O3 -std=c++11 -fPIC -DNDEBUG -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wno-multichar -pthread -march=native -mtune=native -Iexamples/server examples/server/server.cpp ggml.o llama.o common.o -o server -lopenblas -lcblas
/usr/bin/ld: ggml.o: in function `ggml_quantize_chunk':
ggml.c:(.text+0x343b9): undefined reference to `ggml_quantize_q2_k'
/usr/bin/ld: ggml.c:(.text+0x343f0): undefined reference to `ggml_quantize_q3_k'
/usr/bin/ld: ggml.c:(.text+0x34427): undefined reference to `ggml_quantize_q4_k'
/usr/bin/ld: ggml.c:(.text+0x3445e): undefined reference to `ggml_quantize_q5_k'
/usr/bin/ld: ggml.c:(.text+0x34492): undefined reference to `ggml_quantize_q6_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x1e0): undefined reference to `dequantize_row_q2_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x1e8): undefined reference to `quantize_row_q2_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x1f0): undefined reference to `quantize_row_q2_k_reference'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x1f8): undefined reference to `quantize_row_q8_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x200): undefined reference to `ggml_vec_dot_q2_k_q8_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x210): undefined reference to `dequantize_row_q3_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x218): undefined reference to `quantize_row_q3_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x220): undefined reference to `quantize_row_q3_k_reference'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x228): undefined reference to `quantize_row_q8_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x230): undefined reference to `ggml_vec_dot_q3_k_q8_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x240): undefined reference to `dequantize_row_q4_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x248): undefined reference to `quantize_row_q4_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x250): undefined reference to `quantize_row_q4_k_reference'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x258): undefined reference to `quantize_row_q8_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x260): undefined reference to `ggml_vec_dot_q4_k_q8_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x270): undefined reference to `dequantize_row_q5_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x278): undefined reference to `quantize_row_q5_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x280): undefined reference to `quantize_row_q5_k_reference'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x288): undefined reference to `quantize_row_q8_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x290): undefined reference to `ggml_vec_dot_q5_k_q8_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x2a0): undefined reference to `dequantize_row_q6_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x2a8): undefined reference to `quantize_row_q6_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x2b0): undefined reference to `quantize_row_q6_k_reference'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x2b8): undefined reference to `quantize_row_q8_k'
/usr/bin/ld: ggml.o:(.data.rel.ro+0x2c0): undefined reference to `ggml_vec_dot_q6_k_q8_k'
collect2: error: ld returned 1 exit status
make: *** [Makefile:278: server] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant