Compile bug: tools/server/server-context.cpp fails to compile with Intel icx/icpx: std::setw missing <iomanip> include
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 90/100
Research direction
The fix is in tools/server/server-context.cpp where std::setw is used at lines 4234 and 4241. Add #include <iomanip> near the top with other STL includes. Done means the file compiles with icx/icpx without the setw error.
Written by the indexing model from the issue text.
Description
Git commit
$ git rev-parse HEAD
8956c769e8ababd9fbd89c81764f241d5f515d68
Operating systems
Linux
GGML backends
CPU
Problem description & steps to reproduce
When building current main with the Intel oneAPI DPC++/C++ Compiler (icx/icpx), compilation of tools/server/server-context.cpp fails because std::setw is used without including .
GCC/libstdc++ accidentally transitively includes through other headers, so this compiles there, but icx/libc++-style strict include checking correctly rejects it. This is a "missing explicit include" regression.
Environment
Branch: main (latest)
Compiler: Intel oneAPI icx / icpx (latest)
CMake flags: -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=Intel10_64lp (also reproduces with a minimal build)
OS: Rocky 8.9
Reproduction
cmake -B build -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx
cmake --build build -j
Error
tools/server/server-context.cpp:4234:57: error: no member named 'setw' in namespace 'std'
st0 << std::setw(8) << token;
^~~~
tools/server/server-context.cpp:4241:57: error: no member named 'setw' in namespace 'std'
st1 << std::setw(8) << token;
^~~~
Root cause
std::setw is declared in (C++ standard). tools/server/server-context.cpp uses it but does not include that header, relying on transitive inclusion from other STL headers, which is not guaranteed.
Suggested fix
Add the missing include near the other STL includes in tools/server/server-context.cpp:
#include
First Bad Commit
No response
Compile command
cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER="$ICX" -DCMAKE_CXX_COMPILER="$ICPX" -DGGML_NATIVE=ON -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_LIBRARIES="${FS}" -DCMAKE_MODULE_LINKER_FLAGS="${RPATH} ${FS}" -DCMAKE_SHARED_LINKER_FLAGS="${RPATH} ${FS}" -DCMAKE_EXE_LINKER_FLAGS="${RPATH} ${FS} -Wl,--no-as-needed" -DGGML_AVX=ON -DGGML_AVX2=ON -DGGML_FMA=ON -DGGML_F16C=ON -DGGML_AVX512=ON -DGGML_AVX512_VBMI=ON -DGGML_AVX512_VNNI=ON -DGGML_AVX512_BF16=ON -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=Intel10_64lp -DGGML_LLAMAFILE=OFF -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_EXAMPLES=ON -DLLAMA_BUILD_CLI=OFF -DLLAMA_BUILD_BENCH=OFF -DLLAMA_BUILD_SERVER=ON
Relevant log output
Error
tools/server/server-context.cpp:4234:57: error: no member named 'setw' in namespace 'std'
st0 << std::setw(8) << token;
^~~~
tools/server/server-context.cpp:4241:57: error: no member named 'setw' in namespace 'std'
st1 << std::setw(8) << token;
^~~~
- Dominant language
- C++
- Stars
- 133k
- Forks
- 25.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 504
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 66/100
ggml-org/llama.cpp#31601 · 2 comments ·
Maintainers usually reply within 1 day
-
Compile bug: FreeBSD ggml vulkan compilation issuePossibly taken @angt claimed this 2 days ago. Openbug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ggml-org/llama.cpp#31541 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
ggml-org/llama.cpp#31456 · 2 comments ·
Maintainers usually reply within 1 day
-
Misc. bug: Sub-heading levels are incorrect for the CUDA, MUSA, and SYCL sections in the Docker documentationPossibly taken A pull request linked to this issue is open or already merged. Openbug-unconfirmed
Difficulty 1/5 Under an hour Newbie friendliness 85/100
ggml-org/llama.cpp#31404 · 1 comment ·
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 13 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
All issues in ggml-org/llama.cpp
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
xiaoyifang/goldendict-ng#3148 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 91/100
triton-inference-server/server#9069 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 4 days
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 78/100