Caffe: make all error in ubuntu 16.04

Created on 27 Dec 2016  路  5Comments  路  Source: BVLC/caffe

I have successfully installed caffe in ubuntu 16.04 with cuda 8.0 about 4 month ago. But I use latest master code to build, it failed.
I follow all the instructions in https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-or-15.10-Installation-Guide
gcc version 4.9.3

$make all
CXX/LD -o .build_release/tools/upgrade_solver_proto_text.bin
.build_release/lib/libcaffe.so: undefined reference to google::protobuf::Message::InitializationErrorString() const' .build_release/lib/libcaffe.so: undefined reference togoogle::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream)'
.build_release/lib/libcaffe.so: undefined reference to google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)' .build_release/lib/libcaffe.so: undefined reference togoogle::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream
, std::string)'
.build_release/lib/libcaffe.so: undefined reference to google::protobuf::Message::GetTypeName() const' .build_release/lib/libcaffe.so: undefined reference togoogle::base::CheckOpMessageBuilder::NewString()'
.build_release/lib/libcaffe.so: undefined reference to google::protobuf::Message::DebugString() const' .build_release/lib/libcaffe.so: undefined reference togoogle::protobuf::internal::empty_string_'
.build_release/lib/libcaffe.so: undefined reference to google::protobuf::MessageLite::ParseFromString(std::string const&)' .build_release/lib/libcaffe.so: undefined reference togoogle::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const
, int)'
.build_release/lib/libcaffe.so: undefined reference to cv::imread(std::string const&, int)' .build_release/lib/libcaffe.so: undefined reference togoogle::protobuf::DescriptorPool::FindFileByName(std::string const&) const'
.build_release/lib/libcaffe.so: undefined reference to google::protobuf::internal::WireFormatLite::ReadBytes(google::protobuf::io::CodedInputStream*, std::string*)' .build_release/lib/libcaffe.so: undefined reference togoogle::protobuf::internal::StringTypeHandlerBase::Delete(std::string)'
.build_release/lib/libcaffe.so: undefined reference to google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::string const&))' .build_release/lib/libcaffe.so: undefined reference toleveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB)'
.build_release/lib/libcaffe.so: undefined reference to cv::imencode(std::string const&, cv::_InputArray const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)' .build_release/lib/libcaffe.so: undefined reference togoogle::protobuf::internal::StringTypeHandlerBase::New()'
.build_release/lib/libcaffe.so: undefined reference to google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)' .build_release/lib/libcaffe.so: undefined reference toleveldb::Status::ToString() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::WireFormatLite::WriteString(int, std::string const&, google::protobuf::io::CodedOutputStream
)'
collect2: error: ld returned 1 exit status
Makefile:620: recipe for target '.build_release/tools/upgrade_solver_proto_text.bin' failed
make: *
[.build_release/tools/upgrade_solver_proto_text.bin] Error 1

Most helpful comment

This definltely has something to with gcc verison, for instance, we have to build local protobuf and caffe with a same gcc.
I tried to build protobuf with g++4.7 then caffe with g++5.4, and then caffe cannot find protobuf as a result.
And I tried to build protobuf with g++4.7 then caffe with g++4.7, and then caffe can at leat find protobuf...

All 5 comments

solved by using gcc 5. in https://github.com/intel/caffe/wiki/Ubuntu-16.04-or-15.10-Installation-Guide, it use gcc 4.9 because cuda 7.5 don't support gcc 5. But I am using cuda 8.0.

Hi, ubuntu16.04 was gcc5.4 by default, how did u have this problem, I occured this problem too, becourse I build protobuf 3.1 from source code using gcc5.4 so I got completely wrong message says protobuf errors. I also tried make protobuf 2.5, but caffe make says version too old, It's wired. If anyone also have occured this problem please give me some tips.

anyone know how to solve the problem? I have gcc 6.3 on ubuntu 16.04. It seems that caffe cannot find the file contained google protobuf. But why? I reinstall the protobuf again and again, while, I met this bug again and again.

This definltely has something to with gcc verison, for instance, we have to build local protobuf and caffe with a same gcc.
I tried to build protobuf with g++4.7 then caffe with g++5.4, and then caffe cannot find protobuf as a result.
And I tried to build protobuf with g++4.7 then caffe with g++4.7, and then caffe can at leat find protobuf...

I am trying to build on Caffe
I am using the following version
"gcc": "4.8.5",
"libgcc": "5.2.0",
"lmdb": "0.9.21",
"leveldb": "1.20"

../lib/libcaffe.so.1.0.0: undefined reference to leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)' ../lib/libcaffe.so.1.0.0: undefined reference toleveldb::Status::ToString() const'

Can some one help me to fix this ?

Was this page helpful?
0 / 5 - 0 ratings