[GH-ISSUE #2628] libext_server.a(llava.cpp.o) { in archive is not an object | not an ELF file } #48064

Closed
opened 2026-04-28 06:36:39 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @pavelsr on GitHub (Feb 21, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2628

Originally assigned to: @dhiltgen on GitHub.

I'm trying to build ollama with AMD GPU support via command

ROCM_PATH=/opt/rocm CLBlast_DIR=/usr/lib/x86_64-linux-gnu/cmake/CLBlast go generate -tags rocm ./...

and in final stage of build I got an error mentioned in issue header:

Screenshot from 2024-02-21 12-55-49

I tried to replace g++ with clang++ at llm/generate/gen_common.sh as it was mentioned in this comment but error in the end of build is still same.

Adding -fcf-protection=none also wasn't helped, just changed error message a little bit

ld.lld: error: ../llama.cpp/build/linux/x86_64/cpu/examples/server/libext_server.a(llava.cpp.o): not an ELF file
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

What do I need to fix for proper compiling of ext_server static library ?

Seems like issue related to this part of ollama sources

Originally created by @pavelsr on GitHub (Feb 21, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2628 Originally assigned to: @dhiltgen on GitHub. I'm trying to build ollama with AMD GPU support via command ``` ROCM_PATH=/opt/rocm CLBlast_DIR=/usr/lib/x86_64-linux-gnu/cmake/CLBlast go generate -tags rocm ./... ``` and in final stage of build I got an error mentioned in issue header: ![Screenshot from 2024-02-21 12-55-49](https://github.com/ollama/ollama/assets/1158473/93468605-6b88-4029-a890-793d135e6e48) I tried to replace `g++` with `clang++` at llm/generate/gen_common.sh as it was mentioned in [this comment](https://github.com/ollama/ollama/issues/2473#issuecomment-1942090475) but error in the end of build is still same. [Adding](https://github.com/ollama/ollama/issues/2473#issuecomment-1941640723) `-fcf-protection=none` also wasn't helped, just changed error message a little bit ``` ld.lld: error: ../llama.cpp/build/linux/x86_64/cpu/examples/server/libext_server.a(llava.cpp.o): not an ELF file clang++: error: linker command failed with exit code 1 (use -v to see invocation) ``` What do I need to fix for proper compiling of ext_server static library ? Seems like issue related to [this part of ollama sources](https://github.com/ollama/ollama/blob/e1f50377f499b1784a866a6463af364987443238/llm/generate/gen_common.sh#L89)
GiteaMirror added the question label 2026-04-28 06:36:39 -05:00
Author
Owner

@dhiltgen commented on GitHub (Feb 26, 2024):

If you run the go generate ./... with CGO_CFLAGS="-g" that will increase verbosity of the build logs which might help shed some light on what's going wrong.

<!-- gh-comment-id:1964928353 --> @dhiltgen commented on GitHub (Feb 26, 2024): If you run the `go generate ./...` with `CGO_CFLAGS="-g"` that will increase verbosity of the build logs which might help shed some light on what's going wrong.
Author
Owner

@dhiltgen commented on GitHub (Mar 27, 2024):

If you're still having trouble building from source, please let us know.

<!-- gh-comment-id:2023969236 --> @dhiltgen commented on GitHub (Mar 27, 2024): If you're still having trouble building from source, please let us know.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#48064