Compile bug: Errors on glibc < 2.34
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cmake, cpp, linux
- Domain
- build-system, testing
Research direction
Read tests/CMakeLists.txt near the llama_build(test-backend-ops.cpp LINK ggml) entry and check how other tests link Threads::Threads. The report identifies std::thread and std::async as the cause and gives the proposed one line link change. Build test-backend-ops on Linux with glibc older than 2.34 to confirm it links without the workaround.
Written by the indexing model from the issue text.
Description
Git commit
https://github.com/ggml-org/llama.cpp/pull/30299
Operating systems
Linux
GGML backends
CUDA
Problem description & steps to reproduce
Per suggestion logging this as a bug:
During build i get following error:
[llama.cpp 45%] Linking CXX executable ../bin/test-backend-ops /usr/bin/ld: CMakeFiles/test-backend-ops.dir/test-backend-ops.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.17' /usr/bin/ld: /lib/aarch64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make[2]: *** [tests/CMakeFiles/test-backend-ops.dir/build.make:106: bin/test-backend-ops] Error 1 make[1]: *** [CMakeFiles/Makefile2:4076: tests/CMakeFiles/test-backend-ops.dir/all] Error 2
My work around: add 2 flags -DCMAKE_EXE_LINKER_FLAGS="-pthread" and -DCMAKE_SHARED_LINKER_FLAGS="-pthread"
Notes from the discussion i added to clarify the issue for actual fix instead of a work around:
test-backend-ops uses std::thread and std::async. Since #30299 (commit ccdbe29, Oct 12, "tests : link each test against only the libraries it uses"), tests/CMakeLists.txt builds it with
llama_build(test-backend-ops.cpp LINK ggml)
The proper fix in the repo is one line after that llama_build:
target_link_libraries(test-backend-ops PRIVATE Threads::Threads)
First Bad Commit
No response
Compile command
~/Bin/cmake-4.2.3-linux-aarch64//bin/cmake -B build -DGGML_CUDA=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DLLAMA_CURL=OFF -DCMAKE_CUDA_ARCHITECTURES=72 -DGGML_RPC=ON
( note the hardcoded cmake, had to manually download due to older OS version )
Relevant log output
Posted error above.
- Dominant language
- C++
- Stars
- 133k
- Forks
- 24.9k
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 500
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ggml-org/llama.cpp
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ggml-org/llama.cpp#31163 · 1 comment ·
Maintainers usually reply within 1 day
-
Misc. bug: docs mention --spec-draft-conf-min, but that flag doesn't existPossibly taken @jajamabhijith claimed this 2 days ago. Openbug-unconfirmed
Difficulty 1/5 Under an hour Newbie friendliness 91/100
Maintainers usually reply within 1 day
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
Misc. bug: Metal aborts on MUL_MAT with BF16 src1 at K >= 64, batch > 8 (no BF16 mul_mm kernel)Possibly taken @rashid5925 claimed this 4 days ago. Openbug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ggml-org/llama.cpp#30973 · 4 comments ·
Maintainers usually reply within 1 day
-
Windows bundled llama-server.exe is missing `longPathAware`: GGUF paths > 260 chars fail with "No such file or directory" even when the file exists and LongPathsEnabled=1Possibly taken @origin-labs-ai claimed this 4 days ago. Openbug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
All issues in ggml-org/llama.cpp
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
scp-fs2open/fs2open.github.com#7953 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
HansKristian-Work/dxil-spirv#341 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 6 days