Skip to content
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

Openblas linking broken on Arch #1113

Closed
daniandtheweb opened this issue Apr 22, 2023 · 3 comments
Closed

Openblas linking broken on Arch #1113

daniandtheweb opened this issue Apr 22, 2023 · 3 comments

Comments

@daniandtheweb
Copy link
Contributor

Using Arch and trying to build the latest commit with openblas cmake outputs this error:

/home/daniandtheweb/Applications/chat/llama.cpp/ggml.c:1082:13: warning: ‘quantize_row_q4_2_reference’ defined but not used [-Wunused-function]
 1082 | static void quantize_row_q4_2_reference(const float * restrict x, block_q4_2 * restrict y, int k) {
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
[  4%] Built target ggml
[  9%] Building CXX object CMakeFiles/llama.dir/llama.cpp.o
[ 13%] Linking CXX static library libllama.a
[ 13%] Built target llama
[ 18%] Building C object tests/CMakeFiles/test-quantize.dir/test-quantize.c.o
[ 22%] Linking CXX executable ../bin/test-quantize
/usr/bin/ld: ../libllama.a(ggml.c.o): in function `ggml_compute_forward_mul_mat_f16_f32':
ggml.c:(.text+0x7fdb): undefined reference to `cblas_sgemm'
/usr/bin/ld: ../libllama.a(ggml.c.o): in function `ggml_compute_forward_mul_mat_q_f32':
ggml.c:(.text+0x89cc): undefined reference to `cblas_sgemm'
/usr/bin/ld: ../libllama.a(ggml.c.o): in function `ggml_compute_forward':
ggml.c:(.text+0xf07a): undefined reference to `cblas_sgemm'
collect2: error: ld returned 1 exit status
make[2]: *** [tests/CMakeFiles/test-quantize.dir/build.make:98: bin/test-quantize] Error 1
make[1]: *** [CMakeFiles/Makefile2:1055: tests/CMakeFiles/test-quantize.dir/all] Error 2
make: *** [Makefile:101: all] Error 2
@Piezoid
Copy link
Contributor

Piezoid commented Apr 22, 2023

See #634: on Arch Linux, openblas doesn't have the cblas interface enabled. The solution is to compile openblas-lapack from AUR.

@daniandtheweb
Copy link
Contributor Author

Hadn't found that issue before, thanks!

@CubeTheThird
Copy link

It looks like this will no longer be an issue with an upcoming release of the openblas packages:

https://lists.archlinux.org/archives/list/arch-dev-public@lists.archlinux.org/thread/REXPJGNLOMBZAB47D5JYX4B3TM62YJTD/

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

3 participants