Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Compile bug: llama-vocab.cpp Error #14176

Closed
@wr131

Description

@wr131

Git commit

40643ed

Operating systems

Linux

GGML backends

BLAS

Problem description & steps to reproduce

Bug

When It happend

When I used make -j2 to compile llama.cpp

It threw a error:

/run/media/dust/879c925c-44bf-4fe7-8234-27eb11ca228e/home/dust/llama/llama.cpp/src/unicode.cpp: In function ‘std::wstring unicode_wstring_from_utf8(const std::string&)’:
/run/media/dust/879c925c-44bf-4fe7-8234-27eb11ca228e/home/dust/llama/llama.cpp/src/unicode.cpp:209:10: warning: ‘template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc> class std::__cxx11::wstring_convert’ is deprecated [-Wdeprecated-declarations]
  209 |     std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
      |          ^~~~~~~~~~~~~~~
In file included from /usr/include/c++/15.1.1/locale:47,
                 from /run/media/dust/879c925c-44bf-4fe7-8234-27eb11ca228e/home/dust/llama/llama.cpp/src/unicode.cpp:13:
/usr/include/c++/15.1.1/bits/locale_conv.h:262:33: note: declared here
  262 |     class _GLIBCXX17_DEPRECATED wstring_convert
      |                                 ^~~~~~~~~~~~~~~
/run/media/dust/879c925c-44bf-4fe7-8234-27eb11ca228e/home/dust/llama/llama.cpp/src/llama-vocab.cpp: In lambda function:
/run/media/dust/879c925c-44bf-4fe7-8234-27eb11ca228e/home/dust/llama/llama.cpp/src/llama-vocab.cpp:2576:46: error: ‘numeric_limits’ is not a member of ‘std’
 2576 |         if (size >= static_cast<size_t>(std::numeric_limits<int32_t>::max())) {
      |                                              ^~~~~~~~~~~~~~
/run/media/dust/879c925c-44bf-4fe7-8234-27eb11ca228e/home/dust/llama/llama.cpp/src/llama-vocab.cpp:2576:68: error: expected primary-expression before ‘>’ token
 2576 |         if (size >= static_cast<size_t>(std::numeric_limits<int32_t>::max())) {
      |                                                                    ^
/run/media/dust/879c925c-44bf-4fe7-8234-27eb11ca228e/home/dust/llama/llama.cpp/src/llama-vocab.cpp:2576:71: error: ‘::max’ has not been declared; did you mean ‘std::max’?
 2576 |         if (size >= static_cast<size_t>(std::numeric_limits<int32_t>::max())) {
      |                                                                       ^~~
      |                                                                       std::max
In file included from /usr/include/c++/15.1.1/algorithm:63,
                 from /run/media/dust/879c925c-44bf-4fe7-8234-27eb11ca228e/home/dust/llama/llama.cpp/src/llama-vocab.cpp:10:
/usr/include/c++/15.1.1/bits/stl_algo.h:5794:5: note: ‘std::max’ declared here
 5794 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
make[2]: *** [src/CMakeFiles/llama.dir/build.make:387: src/CMakeFiles/llama.dir/llama-vocab.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:1233: src/CMakeFiles/llama.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

My Cmake compilation opinion

GGML_BLAS=ON
GGML_BLAS_VENDOR=OpenBLAS
GGML_CPU=ON
GGML_SSE42=ON
GGML_NATIVE=ON

Every other opinions are all default.

First Bad Commit

No response

Compile command

cmake -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DGGML_CPU=ON -DGGML_SSE42=ON -DGGML_NATIVE=ON

make -j2

Relevant log output

[  5%] Built target ggml-base
[  5%] Built target build_info
[  6%] Built target sha256
[  7%] Built target xxhash
[  7%] Built target sha1
[  8%] Built target llama-llava-cli
[  9%] Built target llama-gemma3-cli
[ 10%] Built target llama-minicpmv-cli
[ 12%] Built target llama-qwen2vl-cli
[ 13%] Built target ggml-blas
[ 23%] Built target ggml-cpu
[ 24%] Built target ggml
[ 25%] Built target llama-gguf-hash
[ 25%] Building CXX object src/CMakeFiles/llama.dir/llama-vocab.cpp.o
[ 27%] Built target llama-gguf
[ 27%] Building CXX object src/CMakeFiles/llama.dir/unicode.cpp.o
/run/media/dust/879c925c-44bf-4fe7-8234-27eb11ca228e/home/dust/llama/llama.cpp/src/unicode.cpp: In function ‘std::wstring unicode_wstring_from_utf8(const std::string&)’:
/run/media/dust/879c925c-44bf-4fe7-8234-27eb11ca228e/home/dust/llama/llama.cpp/src/unicode.cpp:209:10: warning: ‘template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc> class std::__cxx11::wstring_convert’ is deprecated [-Wdeprecated-declarations]
  209 |     std::wstring_convert<std::codecvt_utf8<wchar_t>> conv;
      |          ^~~~~~~~~~~~~~~
In file included from /usr/include/c++/15.1.1/locale:47,
                 from /run/media/dust/879c925c-44bf-4fe7-8234-27eb11ca228e/home/dust/llama/llama.cpp/src/unicode.cpp:13:
/usr/include/c++/15.1.1/bits/locale_conv.h:262:33: note: declared here
  262 |     class _GLIBCXX17_DEPRECATED wstring_convert
      |                                 ^~~~~~~~~~~~~~~
/run/media/dust/879c925c-44bf-4fe7-8234-27eb11ca228e/home/dust/llama/llama.cpp/src/llama-vocab.cpp: In lambda function:
/run/media/dust/879c925c-44bf-4fe7-8234-27eb11ca228e/home/dust/llama/llama.cpp/src/llama-vocab.cpp:2576:46: error: ‘numeric_limits’ is not a member of ‘std’
 2576 |         if (size >= static_cast<size_t>(std::numeric_limits<int32_t>::max())) {
      |                                              ^~~~~~~~~~~~~~
/run/media/dust/879c925c-44bf-4fe7-8234-27eb11ca228e/home/dust/llama/llama.cpp/src/llama-vocab.cpp:2576:68: error: expected primary-expression before ‘>’ token
 2576 |         if (size >= static_cast<size_t>(std::numeric_limits<int32_t>::max())) {
      |                                                                    ^
/run/media/dust/879c925c-44bf-4fe7-8234-27eb11ca228e/home/dust/llama/llama.cpp/src/llama-vocab.cpp:2576:71: error: ‘::max’ has not been declared; did you mean ‘std::max’?
 2576 |         if (size >= static_cast<size_t>(std::numeric_limits<int32_t>::max())) {
      |                                                                       ^~~
      |                                                                       std::max
In file included from /usr/include/c++/15.1.1/algorithm:63,
                 from /run/media/dust/879c925c-44bf-4fe7-8234-27eb11ca228e/home/dust/llama/llama.cpp/src/llama-vocab.cpp:10:
/usr/include/c++/15.1.1/bits/stl_algo.h:5794:5: note: ‘std::max’ declared here
 5794 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
make[2]: *** [src/CMakeFiles/llama.dir/build.make:387: src/CMakeFiles/llama.dir/llama-vocab.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:1233: src/CMakeFiles/llama.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions