Build on macbook m3 faild : old protoc version
LocalAI version:
branch: master. tag:1.40.0
Environment, CPU architecture, OS, and Version:
MacBook Pro M3 96 GB mac0S sonoma 14.1
Describe the bug
Error: error: This file was generated by an older version of protoc Error as blow
/Users/kevin/DeepLearning/gpt/localAI/LocalAI/backend/cpp/llama/llama.cpp/build/examples/grpc-server/backend.pb.h:17:2: error: This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^
/Users/kevin/DeepLearning/gpt/localAI/LocalAI/backend/cpp/llama/llama.cpp/build/examples/grpc-server/backend.pb.h:18:2: error: incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^
/Users/kevin/DeepLearning/gpt/localAI/LocalAI/backend/cpp/llama/llama.cpp/build/examples/grpc-server/backend.pb.h:19:2: error: regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
Users/kevin/DeepLearning/gpt/localAI/LocalAI/backend/cpp/llama/llama.cpp/build/examples/grpc-server/backend.pb.h:41:1: error: unknown type name 'PROTOBUF_NAMESPACE_OPEN'
PROTOBUF_NAMESPACE_OPEN
^
/Users/kevin/DeepLearning/gpt/localAI/LocalAI/backend/cpp/llama/llama.cpp/build/examples/grpc-server/backend.pb.h:42:1: error: expected unqualified-id
namespace internal {
^
/Users/kevin/DeepLearning/gpt/localAI/LocalAI/backend/cpp/llama/llama.cpp/build/examples/grpc-server/backend.pb.h:45:1: error: unknown type name 'PROTOBUF_NAMESPACE_CLOSE'
PROTOBUF_NAMESPACE_CLOSE
^
/Users/kevin/DeepLearning/gpt/localAI/LocalAI/backend/cpp/llama/llama.cpp/build/examples/grpc-server/backend.pb.h:51:16: error: no member named 'PROTOBUF_NAMESPACE_ID' in the global namespace
To Reproduce
build faild use blow script
1 │ export C_INCLUDE_PATH=/usr/local/include
2 │ export CPLUS_INCLUDE_PATH=/usr/local/include
3 │
4 │ export BUILD_GRPC_FOR_BACKEND_LLAMA=on
5 │
6 │ # install build dependencies
7 │ # brew install abseil cmake go grpc protobuf wget
8 │
9 │ # clone the repo
10 │ git clone https://github.com/go-skynet/LocalAI.git
11 │
12 │ cd LocalAI
13 │
14 │
15 │ # make backend/cpp/llama/grpc-server
16 │
17 │ make clean
18 │ brew link protobuf
19 |
20 │ make BUILD_TYPE=metal build
Expected behavior
Logs
full log in the attrachment log.txt
Additional context
check your protoc version.
I found two versions installed in my m3.
The new version should be placed before the old one in PATH.
Use the following command to find versions installed.
which -a protoc
it turely have two version protoc in my pc
╰─ which -a protoc ─╯
/Users/kevin/anaconda3/bin/protoc
/opt/homebrew/bin/protoc
and i rename the first version
mv /Users/kevin/anaconda3/bin/protoc /Users/kevin/anaconda3/bin/protoc1
but not success
and the errror and log as below /:sad
google::protobuf::internal::KeyMapBase<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>::FindHelper(std::__1::basic_string_view<char, std::__1::char_traits<char>>, absl::lts_20230802::container_internal::btree_iterator<absl::lts_20230802::container_internal::btree_node<absl::lts_20230802::container_internal::map_params<google::protobuf::internal::VariantKey, google::protobuf::internal::NodeBase*, std::__1::less<google::protobuf::internal::VariantKey>, google::protobuf::internal::MapAllocator<std::__1::pair<google::protobuf::internal::VariantKey const, google::protobuf::internal::NodeBase*>>, 256, false>>, std::__1::pair<google::protobuf::internal::VariantKey const, google::protobuf::internal::NodeBase*>&, std::__1::pair<google::protobuf::internal::VariantKey const, google::protobuf::internal::NodeBase*>*>*) const in libhw_grpc_proto.a[3](backend.pb.cc.o)
google::protobuf::internal::ZeroFieldsBase::GetClassData() const, referenced from:
vtable for backend::HealthMessage in libhw_grpc_proto.a[3](backend.pb.cc.o)
google::protobuf::internal::TaggedStringPtr::ForceCopy(google::protobuf::Arena*) const, referenced from:
backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o)
backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o)
backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o)
backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o)
backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o)
backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o)
backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o)
backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o)
...
clang: error: linker command failed with exit code 1 (use -v to see invocation)
it turely have two version protoc in my pc
╰─ which -a protoc ─╯ /Users/kevin/anaconda3/bin/protoc /opt/homebrew/bin/protocand i rename the first version
mv /Users/kevin/anaconda3/bin/protoc /Users/kevin/anaconda3/bin/protoc1but not success
and the errror and log as below /:sad
google::protobuf::internal::KeyMapBase<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>::FindHelper(std::__1::basic_string_view<char, std::__1::char_traits<char>>, absl::lts_20230802::container_internal::btree_iterator<absl::lts_20230802::container_internal::btree_node<absl::lts_20230802::container_internal::map_params<google::protobuf::internal::VariantKey, google::protobuf::internal::NodeBase*, std::__1::less<google::protobuf::internal::VariantKey>, google::protobuf::internal::MapAllocator<std::__1::pair<google::protobuf::internal::VariantKey const, google::protobuf::internal::NodeBase*>>, 256, false>>, std::__1::pair<google::protobuf::internal::VariantKey const, google::protobuf::internal::NodeBase*>&, std::__1::pair<google::protobuf::internal::VariantKey const, google::protobuf::internal::NodeBase*>*>*) const in libhw_grpc_proto.a[3](backend.pb.cc.o) google::protobuf::internal::ZeroFieldsBase::GetClassData() const, referenced from: vtable for backend::HealthMessage in libhw_grpc_proto.a[3](backend.pb.cc.o) google::protobuf::internal::TaggedStringPtr::ForceCopy(google::protobuf::Arena*) const, referenced from: backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) ... clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is my version.
protoc --version libprotoc 25.1
Your version is : protobuf version 24.3.0
could you update your protoc to lastest version and retry ?
my protobuf version already 25.1
i dont know why the build version use 24.3.0....
it turely have two version protoc in my pc
╰─ which -a protoc ─╯ /Users/kevin/anaconda3/bin/protoc /opt/homebrew/bin/protocand i rename the first version
mv /Users/kevin/anaconda3/bin/protoc /Users/kevin/anaconda3/bin/protoc1but not success and the errror and log as below /:sadgoogle::protobuf::internal::KeyMapBase<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>::FindHelper(std::__1::basic_string_view<char, std::__1::char_traits<char>>, absl::lts_20230802::container_internal::btree_iterator<absl::lts_20230802::container_internal::btree_node<absl::lts_20230802::container_internal::map_params<google::protobuf::internal::VariantKey, google::protobuf::internal::NodeBase*, std::__1::less<google::protobuf::internal::VariantKey>, google::protobuf::internal::MapAllocator<std::__1::pair<google::protobuf::internal::VariantKey const, google::protobuf::internal::NodeBase*>>, 256, false>>, std::__1::pair<google::protobuf::internal::VariantKey const, google::protobuf::internal::NodeBase*>&, std::__1::pair<google::protobuf::internal::VariantKey const, google::protobuf::internal::NodeBase*>*>*) const in libhw_grpc_proto.a[3](backend.pb.cc.o) google::protobuf::internal::ZeroFieldsBase::GetClassData() const, referenced from: vtable for backend::HealthMessage in libhw_grpc_proto.a[3](backend.pb.cc.o) google::protobuf::internal::TaggedStringPtr::ForceCopy(google::protobuf::Arena*) const, referenced from: backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) ... clang: error: linker command failed with exit code 1 (use -v to see invocation)This is my version.
protoc --version libprotoc 25.1Your version is : protobuf version 24.3.0
could you update your protoc to lastest version and retry ?
hi i have try it again. faild again..... logs as below log5.txt
it turely have two version protoc in my pc
╰─ which -a protoc ─╯ /Users/kevin/anaconda3/bin/protoc /opt/homebrew/bin/protocand i rename the first version
mv /Users/kevin/anaconda3/bin/protoc /Users/kevin/anaconda3/bin/protoc1but not success and the errror and log as below /:sadgoogle::protobuf::internal::KeyMapBase<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>::FindHelper(std::__1::basic_string_view<char, std::__1::char_traits<char>>, absl::lts_20230802::container_internal::btree_iterator<absl::lts_20230802::container_internal::btree_node<absl::lts_20230802::container_internal::map_params<google::protobuf::internal::VariantKey, google::protobuf::internal::NodeBase*, std::__1::less<google::protobuf::internal::VariantKey>, google::protobuf::internal::MapAllocator<std::__1::pair<google::protobuf::internal::VariantKey const, google::protobuf::internal::NodeBase*>>, 256, false>>, std::__1::pair<google::protobuf::internal::VariantKey const, google::protobuf::internal::NodeBase*>&, std::__1::pair<google::protobuf::internal::VariantKey const, google::protobuf::internal::NodeBase*>*>*) const in libhw_grpc_proto.a[3](backend.pb.cc.o) google::protobuf::internal::ZeroFieldsBase::GetClassData() const, referenced from: vtable for backend::HealthMessage in libhw_grpc_proto.a[3](backend.pb.cc.o) google::protobuf::internal::TaggedStringPtr::ForceCopy(google::protobuf::Arena*) const, referenced from: backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) backend::PredictOptions::PredictOptions(google::protobuf::Arena*, backend::PredictOptions const&) in libhw_grpc_proto.a[3](backend.pb.cc.o) ... clang: error: linker command failed with exit code 1 (use -v to see invocation)This is my version.
protoc --version libprotoc 25.1Your version is : protobuf version 24.3.0 could you update your protoc to lastest version and retry ?hi i have try it again. faild again..... logs as below log5.txt
![]()
Check this link: https://github.com/protocolbuffers/protobuf/issues/11828#issue-1573588295
Maybe another library is not compatible.
I suggest to change your PATH in your ~/.zshrc like this:
export PATH=/opt/homebrew/bin:$PATH
finally , it works ~
thank you so much for your kindly help! @sweetcard
========================= build scripts as blow:
- install build dependencies
export C_INCLUDE_PATH=/usr/local/include
export CPLUS_INCLUDE_PATH=/usr/local/include
# install build dependencies
brew install abseil cmake go grpc protobuf wget
- check protoc path and version
add
export PATH=/opt/homebrew/bin:$PATHto the last line of~/.zshrcsource ~/.zshrc
check PATH. should as below
which -a protoc
whereis protoc
echo $PATH
/opt/homebrew/bin:/Users/kevin/.zplug/bin:/Users/kevin/bin:/usr/local/bin:/opt/homebrew/bin:/Users/kevin/anaconda3/bin:/Users/kevin/anaconda3/bin:/Users/kevin/anaconda3/condabin:
Note: anaconda also have protoc in the ~/anaconda3/bin . this why i faild before.
- build LocalAI on mac
# clone the repo
git clone https://github.com/go-skynet/LocalAI.git
cd LocalAI
make clean
brew link protobuf
make BUILD_TYPE=metal build
then you can enjoy this awsome project
finally , it works ~ thank you so much for your kindly help! @sweetcard
========================= build scripts as blow:
- install build dependencies
export C_INCLUDE_PATH=/usr/local/include export CPLUS_INCLUDE_PATH=/usr/local/include # install build dependencies brew install abseil cmake go grpc protobuf wget
- check protoc path and version add
export PATH=/opt/homebrew/bin:$PATHto the last line of~/.zshrcsource ~/.zshrccheck PATH. should as below
which -a protoc whereis protoc echo $PATH/opt/homebrew/bin:/Users/kevin/.zplug/bin:/Users/kevin/bin:/usr/local/bin:/opt/homebrew/bin:/Users/kevin/anaconda3/bin:/Users/kevin/anaconda3/bin:/Users/kevin/anaconda3/condabin:
Note: anaconda also have protoc in the ~/anaconda3/bin . this why i faild before.
- build LocalAI on mac
# clone the repo git clone https://github.com/go-skynet/LocalAI.git cd LocalAI make clean brew link protobuf make BUILD_TYPE=metal buildthen you can enjoy this awsome project
Glad to hear that. 😄👍
:warning::warning::warning::warning::warning:
Hi! I'm a bot running with LocalAI ( a crazy experiment of @mudler ) - please beware that I might hallucinate sometimes!
but.... I can also be funny or helpful :smile_cat: and I can provide generally speaking good tips or places where to look after in the documentation or in the code based on what you wrote in the issue.
Don't engage in conversation with me, I don't support (yet) replying!
:warning::warning::warning::warning::warning:
ERROR: The prompt size exceeds the context window size and cannot be processed.
Sources:
- https://github.com/go-skynet/LocalAI/tree/master/CONTRIBUTING.md
- https://localai.io/basics/news/index.html
- https://github.com/go-skynet/LocalAI/tree/master/.github/ISSUE_TEMPLATE/bug_report.md
During the build I have another issue: In my case protobuf version already 25.1
but then
go: too many arguments make: *** [replace] Error 1
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.