llama.cpp
llama.cpp copied to clipboard
Cannot compile with openblas on Windows
C:/Users/cross/Downloads/w64devkit/bin/ld.exe: ggml.o:ggml.c:(.text+0x1a892): undefined reference to `cblas_sgemm'
C:/Users/cross/Downloads/w64devkit/bin/ld.exe: ggml.o:ggml.c:(.text+0x2189c): undefined reference to `cblas_sgemm'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:596: main] Error 1
Experiencing the exact same error under Ubuntu
I solved it changing in the Makefile the line:
MK_LDFLAGS += $(shell pkg-config --libs openblas)
to:
MK_LDFLAGS += -lopenblas -L/usr/local/lib
I guess that the original Makefile assumes that OpenBLAS has been installed as a package, whereas the instructions tell how to stuff manually the library and the headers in the respective directories of w64devkit: so, pkg-config doesn't know where to find the library.
I solved it changing in the Makefile the line:
MK_LDFLAGS += $(shell pkg-config --libs openblas)
to:MK_LDFLAGS += -lopenblas -L/usr/local/lib
I guess that the original Makefile assumes that OpenBLAS has been installed as a package, whereas the instructions tell how to stuff manually the library and the headers in the respective directories of w64devkit: so, pkg-config doesn't know where to find the library.
how to change the path in win?
@dh12306 I just changed it that way in Windows: the translation to the corresponding Windows path is done by the w64devkit. In fact, I think that on UNIX-like platforms that change isn't necessary because OpenBLAS is installed as a package, and pkg-config correctly returns the library path.
This is not working for me on Windows 11, using w64devkit.
I ran 'make clean' directly before this.
It can't find a header. Have you copied the OpenBlas include headers to the folder in w64devkit as specified in Georgi's instructions at https://github.com/ggerganov/llama.cpp?tab=readme-ov-file#openblas ?
e. From the same OpenBLAS zip copy the content of the include folder inside w64devkit\x86_64-w64-mingw32\include.
I did, but I'll run through it one more time to be sure.
I did get it working, however there was no impact on processing speed for the multimodal model I am using. Thank you for your help!
I did get it working, however there was no impact on processing speed for the multimodal model I am using. Thank you for your help!
What did you do to get it to work? I'm having the exact same issue.
https://github.com/ggerganov/llama.cpp/issues/4409#issuecomment-1867161895 @dh12306 For example for win:“-L/usr/local/lib” change to "-LC:\your w64devkit path\x86_64-w64-mingw32\lib". I tried it on Windows 11.It can solve the problem.
I solved it changing in the Makefile the line:
MK_LDFLAGS += $(shell pkg-config --libs openblas)
to:MK_LDFLAGS += -lopenblas -L/usr/local/lib
I guess that the original Makefile assumes that OpenBLAS has been installed as a package, whereas the instructions tell how to stuff manually the library and the headers in the respective directories of w64devkit: so, pkg-config doesn't know where to find the library.
I'm writing to let u know I just followed your advise and it finally SUCCESSED on my win10 platform. Sinserely Appreciation!
I solved it changing in the Makefile the line:
MK_LDFLAGS += $(shell pkg-config --libs openblas)
to:MK_LDFLAGS += -lopenblas -L/usr/local/lib
I guess that the original Makefile assumes that OpenBLAS has been installed as a package, whereas the instructions tell how to stuff manually the library and the headers in the respective directories of w64devkit: so, pkg-config doesn't know where to find the library.I'm writing to let u know I just followed your advise and it finally SUCCESSED on my win10 platform. Sinserely Appreciation!
Thank you!
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
still an issue. (not stale)