Compile bug: Fails on GNU/Hurd due to unconditional `PATH_MAX` usage
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cmake, cpp
- Domain
- build-system
Research direction
The failing PATH_MAX uses are at src/llama-mmap.cpp line 1145 and tools/gguf-split/gguf-split.cpp lines 320, 431 and 433. Start by reading how llama_path_max() is defined and why the file does not include a header that provides PATH_MAX on Hurd. Done means the project builds on GNU/Hurd without changing behaviour on Linux, which you can check by building with the compile command in the issue.
Written by the indexing model from the issue text.
Description
Git commit
b1b770d90d94cad9e9ea5b993bdbc383a522fb28
Operating systems
Other? (Please let us know in description)
GGML backends
CPU
Problem description & steps to reproduce
When compiling llama.cpp on GNU/Hurd, several compile errors happen due to PATH_MAX not being defined on Hurd (it is not required according to POSIX). Read https://hurd.ion.nu/faq/foo_max for info about why PATH_MAX is dangerous and why it shouldn't be used often.
Uses of PATH_MAX that lead to compile errors:
https://github.com/ggml-org/llama.cpp/blob/b1b770d90d94cad9e9ea5b993bdbc383a522fb28/src/llama-mmap.cpp#L1145
https://github.com/ggml-org/llama.cpp/blob/b1b770d90d94cad9e9ea5b993bdbc383a522fb28/tools/gguf-split/gguf-split.cpp#L320
https://github.com/ggml-org/llama.cpp/blob/b1b770d90d94cad9e9ea5b993bdbc383a522fb28/tools/gguf-split/gguf-split.cpp#L431
https://github.com/ggml-org/llama.cpp/blob/b1b770d90d94cad9e9ea5b993bdbc383a522fb28/tools/gguf-split/gguf-split.cpp#L433
First Bad Commit
No response
Compile command
cmake -B build -DGGML_CCACHE=OFF -DGGML_CPU=ON -DGGML_OPENMP=ON
cmake --build build --config Release
Relevant log output
/home/nexussfan/Source_Code/llama.cpp-1.0.0/src/llama-mmap.cpp: In function 'size_t llama_path_max()':
/home/nexussfan/Source_Code/llama.cpp-1.0.0/src/llama-mmap.cpp:1145:12: error: 'PATH_MAX' was not declared in this scope
1145 | return PATH_MAX;
| ^~~~~~~~
gmake[2]: *** [src/CMakeFiles/llama.dir/build.make:569: src/CMakeFiles/llama.dir/llama-mmap.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:2587: src/CMakeFiles/llama.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
- Dominant language
- C++
- Stars
- 134k
- Forks
- 25.4k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 509
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
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ggml-org/llama.cpp#32276 · 3 comments ·
Maintainers usually reply within 1 day
-
Feature Request: cancel model loading from the web UIPossibly taken @wenyuchen96 claimed this 1 day ago. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ggml-org/llama.cpp#32019 · 1 comment ·
Maintainers usually reply within 1 day
-
scripts/moe-cache-tune.py: device_room() under-reports free VRAM when a draft model is loadedPossibly taken @marlonferreira1800-hue claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
ggml-org/llama.cpp#31911 · 1 comment ·
Maintainers usually reply within 1 day
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
ggml-org/llama.cpp#31601 · 2 comments ·
Maintainers usually reply within 1 day
-
Compile bug: tools/server/server-context.cpp fails to compile with Intel icx/icpx: std::setw missing <iomanip> includePossibly taken @afnan-mojumder claimed this 13 days ago. Openbug-unconfirmed
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ggml-org/llama.cpp#31458 · 1 comment ·
Maintainers usually reply within 1 day
All issues in ggml-org/llama.cpp
Similar issues
-
comp-formats
Difficulty 2/5 Half a day Newbie friendliness 64/100
ClickHouse/ClickHouse#131694 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
ETSInitiative/PETSIRD#243 ·
Maintainers usually reply within 1 day
-
bug engine::whispercpp runtime::rocm wg::platform-core
Difficulty 1/5 Under an hour Newbie friendliness 78/100
lemonade-sdk/lemonade#4168 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ROCm/rocm-libraries#15866 ·
Maintainers usually reply within 2 days
-
[Bug] export_build_environment admits its output directory only after the export ran in the build computerPossibly taken @viniciusdsandrade claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day