Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Mac build failed using make #9157

Closed
marcuslaw0074 opened this issue Aug 24, 2024 · 3 comments
Closed

Bug: Mac build failed using make #9157

marcuslaw0074 opened this issue Aug 24, 2024 · 3 comments
Labels
bug-unconfirmed critical severity Used to report critical severity bugs in llama.cpp (e.g. Crashing, Corrupted, Dataloss) stale

Comments

@marcuslaw0074
Copy link

What happened?

my command:

(python39) marcus@Marcuss-MacBook-Air llama.cpp % make

Name and Version

  1. Mac M2 24GB
  2. llama.cpp commit hash 8f824ff

What operating system are you seeing the problem on?

Mac

Relevant log output

I ccache not found. Consider installing it for faster compilation.
I llama.cpp build info: 
I UNAME_S:   Darwin
I UNAME_P:   arm
I UNAME_M:   arm64
I CFLAGS:    -Iggml/include -Iggml/src -Iinclude -Isrc -Icommon -D_XOPEN_SOURCE=600 -D_DARWIN_C_SOURCE -DNDEBUG -DGGML_USE_ACCELERATE -DGGML_USE_BLAS -DACCELERATE_NEW_LAPACK -DACCELERATE_LAPACK_ILP64 -DGGML_USE_LLAMAFILE -DGGML_USE_METAL -DGGML_METAL_EMBED_LIBRARY  -std=c11   -fPIC -O3 -g -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wshadow -Wstrict-prototypes -Wpointer-arith -Wmissing-prototypes -Werror=implicit-int -Werror=implicit-function-declaration -pthread -Wunreachable-code-break -Wunreachable-code-return -Wdouble-promotion 
I CXXFLAGS:  -std=c++11 -fPIC -O3 -g -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wmissing-declarations -Wmissing-noreturn -pthread   -Wunreachable-code-break -Wunreachable-code-return -Wmissing-prototypes -Wextra-semi -Iggml/include -Iggml/src -Iinclude -Isrc -Icommon -D_XOPEN_SOURCE=600 -D_DARWIN_C_SOURCE -DNDEBUG -DGGML_USE_ACCELERATE -DGGML_USE_BLAS -DACCELERATE_NEW_LAPACK -DACCELERATE_LAPACK_ILP64 -DGGML_USE_LLAMAFILE -DGGML_USE_METAL -DGGML_METAL_EMBED_LIBRARY 
I NVCCFLAGS: -std=c++11 -O3 -g 
I LDFLAGS:   -framework Accelerate -framework Foundation -framework Metal -framework MetalKit 
I CC:        Apple clang version 14.0.3 (clang-1403.0.22.14.1)
I CXX:       Apple clang version 14.0.3 (clang-1403.0.22.14.1)

c++ -std=c++11 -fPIC -O3 -g -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wmissing-declarations -Wmissing-noreturn -pthread   -Wunreachable-code-break -Wunreachable-code-return -Wmissing-prototypes -Wextra-semi -Iggml/include -Iggml/src -Iinclude -Isrc -Icommon -D_XOPEN_SOURCE=600 -D_DARWIN_C_SOURCE -DNDEBUG -DGGML_USE_ACCELERATE -DGGML_USE_BLAS -DACCELERATE_NEW_LAPACK -DACCELERATE_LAPACK_ILP64 -DGGML_USE_LLAMAFILE -DGGML_USE_METAL -DGGML_METAL_EMBED_LIBRARY  -c examples/baby-llama/baby-llama.cpp -o examples/baby-llama/baby-llama.o
c++ -std=c++11 -fPIC -O3 -g -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wmissing-declarations -Wmissing-noreturn -pthread   -Wunreachable-code-break -Wunreachable-code-return -Wmissing-prototypes -Wextra-semi -Iggml/include -Iggml/src -Iinclude -Isrc -Icommon -D_XOPEN_SOURCE=600 -D_DARWIN_C_SOURCE -DNDEBUG -DGGML_USE_ACCELERATE -DGGML_USE_BLAS -DACCELERATE_NEW_LAPACK -DACCELERATE_LAPACK_ILP64 -DGGML_USE_LLAMAFILE -DGGML_USE_METAL -DGGML_METAL_EMBED_LIBRARY  ggml/src/ggml-blas.o ggml/src/llamafile/sgemm.o ggml/src/ggml-metal.o ggml/src/ggml-metal-embed.o ggml/src/ggml.o ggml/src/ggml-alloc.o ggml/src/ggml-backend.o ggml/src/ggml-quants.o ggml/src/ggml-aarch64.o src/llama.o src/llama-vocab.o src/llama-grammar.o src/llama-sampling.o src/unicode.o src/unicode-data.o common/common.o common/console.o common/ngram-cache.o common/sampling.o common/train.o common/grammar-parser.o common/build-info.o common/json-schema-to-grammar.o examples/baby-llama/baby-llama.o -o llama-baby-llama -framework Accelerate -framework Foundation -framework Metal -framework MetalKit 
Undefined symbols for architecture arm64:
  "_ggml_print_backtrace", referenced from:
      llama_ngram_cache_save(std::__1::unordered_map<llama_ngram, std::__1::unordered_map<int, int, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int const, int>>>, llama_ngram_hash_function, std::__1::equal_to<llama_ngram>, std::__1::allocator<std::__1::pair<llama_ngram const, std::__1::unordered_map<int, int, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int const, int>>>>>>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&) in ngram-cache.o
      llama_ngram_cache_load(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&) in ngram-cache.o
      llama_ngram_cache_merge(std::__1::unordered_map<llama_ngram, std::__1::unordered_map<int, int, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int const, int>>>, llama_ngram_hash_function, std::__1::equal_to<llama_ngram>, std::__1::allocator<std::__1::pair<llama_ngram const, std::__1::unordered_map<int, int, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int const, int>>>>>>&, std::__1::unordered_map<llama_ngram, std::__1::unordered_map<int, int, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int const, int>>>, llama_ngram_hash_function, std::__1::equal_to<llama_ngram>, std::__1::allocator<std::__1::pair<llama_ngram const, std::__1::unordered_map<int, int, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int const, int>>>>>>&) in ngram-cache.o
      llama_ngram_cache_draft(std::__1::vector<int, std::__1::allocator<int>>&, std::__1::vector<int, std::__1::allocator<int>>&, int, int, int, std::__1::unordered_map<llama_ngram, std::__1::unordered_map<int, int, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int const, int>>>, llama_ngram_hash_function, std::__1::equal_to<llama_ngram>, std::__1::allocator<std::__1::pair<llama_ngram const, std::__1::unordered_map<int, int, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int const, int>>>>>>&, std::__1::unordered_map<llama_ngram, std::__1::unordered_map<int, int, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int const, int>>>, llama_ngram_hash_function, std::__1::equal_to<llama_ngram>, std::__1::allocator<std::__1::pair<llama_ngram const, std::__1::unordered_map<int, int, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int const, int>>>>>>&, std::__1::unordered_map<llama_ngram, std::__1::unordered_map<int, int, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int const, int>>>, llama_ngram_hash_function, std::__1::equal_to<llama_ngram>, std::__1::allocator<std::__1::pair<llama_ngram const, std::__1::unordered_map<int, int, std::__1::hash<int>, std::__1::equal_to<int>, std::__1::allocator<std::__1::pair<int const, int>>>>>>&) (.cold.1) in ngram-cache.o
      tokenize_file(llama_context*, char const*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, bool, bool, unsigned int, std::__1::vector<int, std::__1::allocator<int>>&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long>>&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long>>&) in train.o
      assert_shape_1d(ggml_tensor*, long long) (.cold.1) in train.o
      assert_shape_1d(ggml_tensor*, long long) (.cold.2) in train.o
      ...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [llama-baby-llama] Error 1
@marcuslaw0074 marcuslaw0074 added bug-unconfirmed critical severity Used to report critical severity bugs in llama.cpp (e.g. Crashing, Corrupted, Dataloss) labels Aug 24, 2024
@HanClinto
Copy link
Collaborator

Possibly related to #8211

@time-less-ness
Copy link

This happened to me. Following instructions from #8211:

make clean && make -j

Fixes the problem for me, and now it builds without error.

@github-actions github-actions bot added the stale label Oct 22, 2024
Copy link
Contributor

github-actions bot commented Nov 6, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as completed Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-unconfirmed critical severity Used to report critical severity bugs in llama.cpp (e.g. Crashing, Corrupted, Dataloss) stale
Projects
None yet
Development

No branches or pull requests

3 participants