undefined reference to google protobuf error when compiling 3D-Caffe

2,394 views
Skip to first unread message

DarcyHu

unread,
Sep 28, 2017, 4:46:24 AM9/28/17
to Caffe Users
Hi, I'm trying to compile 3D-Caffe.
my Makefile.config(lines begin with # are removed):

OPENCV_VERSION := 3
CUSTOM_CXX := g++-4.9
CUDA_DIR := /opt/cuda
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
  -gencode arch=compute_20,code=sm_21 \
  -gencode arch=compute_30,code=sm_30 \
  -gencode arch=compute_35,code=sm_35 \
  -gencode arch=compute_50,code=sm_50 \
  -gencode arch=compute_50,code=compute_50
BLAS := open
MATLAB_DIR := /usr/local/MATLAB/R2017a
PYTHON_INCLUDE := /usr/include/python2.7 \
  /usr/lib/python2.7/dist-packages/numpy/core/include
PYTHON_LIB := /usr/lib
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
BUILD_DIR := build
DISTRIBUTE_DIR := distribute
TEST_GPUID := 0
Q ?= @



make -j 8 log:
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Message::InitializationErrorString() const'
.build_release/lib/libcaffe.so: undefined reference to `google::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 to `google::protobuf::Message::GetTypeName() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::AssignDescriptors(std::string const&, google::protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::MessageFactory*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::MessageLite::SerializeToString(std::string*) const'
.build_release/lib/libcaffe.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Message::DebugString() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::MessageLite::ParseFromString(std::string const&)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
.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 to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::string const&))'
.build_release/lib/libcaffe.so: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
.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 to `google::protobuf::internal::fixed_address_empty_string'
.build_release/lib/libcaffe.so: undefined reference to `leveldb::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
make: *** [Makefile:617: .build_release/tools/upgrade_net_proto_text.bin] Error 1
make: *** Waiting for unfinished jobs....
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Message::InitializationErrorString() const'
.build_release/lib/libcaffe.so: undefined reference to `google::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 to `google::protobuf::Message::GetTypeName() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::AssignDescriptors(std::string const&, google::protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::MessageFactory*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::MessageLite::SerializeToString(std::string*) const'
.build_release/lib/libcaffe.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Message::DebugString() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::MessageLite::ParseFromString(std::string const&)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
.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 to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::string const&))'
.build_release/lib/libcaffe.so: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
.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 to `google::protobuf::internal::fixed_address_empty_string'
.build_release/lib/libcaffe.so: undefined reference to `leveldb::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
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Message::InitializationErrorString() const'make: *** [Makefile:617: .build_release/tools/finetune_net.bin] Error 1

.build_release/lib/libcaffe.so: undefined reference to `google::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 to `google::protobuf::Message::GetTypeName() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::AssignDescriptors(std::string const&, google::protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::MessageFactory*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::MessageLite::SerializeToString(std::string*) const'
.build_release/lib/libcaffe.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Message::DebugString() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::MessageLite::ParseFromString(std::string const&)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
.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 to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::string const&))'
.build_release/lib/libcaffe.so: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
.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 to `google::protobuf::internal::fixed_address_empty_string'
.build_release/lib/libcaffe.so: undefined reference to `leveldb::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
make: *** [Makefile:617: .build_release/tools/train_net.bin] Error 1
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Message::InitializationErrorString() const'
.build_release/lib/libcaffe.so: undefined reference to `google::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 to `google::protobuf::Message::GetTypeName() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::AssignDescriptors(std::string const&, google::protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::MessageFactory*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::MessageLite::SerializeToString(std::string*) const'
.build_release/lib/libcaffe.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Message::DebugString() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::MessageLite::ParseFromString(std::string const&)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
.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 to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::string const&))'
.build_release/lib/libcaffe.so: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
.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 to `google::protobuf::internal::fixed_address_empty_string'
.build_release/lib/libcaffe.so: undefined reference to `leveldb::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
make: *** [Makefile:617: .build_release/tools/upgrade_net_proto_binary.bin] Error 1
.build_release/tools/convert_imageset.o: In function `std::string* google::MakeCheckOpString<unsigned long, int>(unsigned long const&, int const&, char const*)':
convert_imageset.cpp:(.text._ZN6google17MakeCheckOpStringImiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringImiEEPSsRKT_RKT0_PKc]+0x40): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/tools/convert_imageset.o: In function `_GLOBAL__sub_I_convert_imageset.cpp':
convert_imageset.cpp:(.text.startup+0x113): undefined reference to `google::FlagRegisterer::FlagRegisterer<std::string>(char const*, char const*, char const*, std::string*, std::string*)'
convert_imageset.cpp:(.text.startup+0x274): undefined reference to `google::FlagRegisterer::FlagRegisterer<std::string>(char const*, char const*, char const*, std::string*, std::string*)'
.build_release/tools/convert_imageset.o: In function `main':
convert_imageset.cpp:(.text.startup+0x328): undefined reference to `google::SetUsageMessage(std::string const&)'
convert_imageset.cpp:(.text.startup+0xbdb): undefined reference to `google::protobuf::MessageLite::SerializeToString(std::string*) const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Message::InitializationErrorString() const'
.build_release/lib/libcaffe.so: undefined reference to `google::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 to `google::protobuf::Message::GetTypeName() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::AssignDescriptors(std::string const&, google::protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::MessageFactory*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Message::DebugString() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::MessageLite::ParseFromString(std::string const&)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
.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 to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::string const&))'
.build_release/lib/libcaffe.so: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
.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 to `google::protobuf::internal::fixed_address_empty_string'
.build_release/lib/libcaffe.so: undefined reference to `leveldb::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
make: *** [Makefile:617: .build_release/tools/convert_imageset.bin] Error 1
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Message::InitializationErrorString() const'
.build_release/lib/libcaffe.so: undefined reference to `google::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 to `google::protobuf::Message::GetTypeName() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::AssignDescriptors(std::string const&, google::protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::MessageFactory*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::MessageLite::SerializeToString(std::string*) const'
.build_release/lib/libcaffe.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Message::DebugString() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::MessageLite::ParseFromString(std::string const&)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
.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 to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::string const&))'
.build_release/lib/libcaffe.so: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
.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 to `google::protobuf::internal::fixed_address_empty_string'
.build_release/lib/libcaffe.so: undefined reference to `leveldb::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
make: *** [Makefile:617: .build_release/tools/net_speed_benchmark.bin] Error 1
.build_release/tools/compute_image_mean.o: In function `std::string* google::MakeCheckOpString<int, int>(int const&, int const&, char const*)':
compute_image_mean.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc]+0x40): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/tools/compute_image_mean.o: In function `std::string* google::MakeCheckOpString<unsigned long, int>(unsigned long const&, int const&, char const*)':
compute_image_mean.cpp:(.text._ZN6google17MakeCheckOpStringImiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringImiEEPSsRKT_RKT0_PKc]+0x40): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/tools/compute_image_mean.o: In function `_GLOBAL__sub_I_compute_image_mean.cpp':
compute_image_mean.cpp:(.text.startup+0xaf): undefined reference to `google::FlagRegisterer::FlagRegisterer<std::string>(char const*, char const*, char const*, std::string*, std::string*)'
.build_release/tools/compute_image_mean.o: In function `main':
compute_image_mean.cpp:(.text.startup+0x155): undefined reference to `google::SetUsageMessage(std::string const&)'
compute_image_mean.cpp:(.text.startup+0x259): undefined reference to `google::protobuf::MessageLite::ParseFromString(std::string const&)'
compute_image_mean.cpp:(.text.startup+0x3ee): undefined reference to `google::protobuf::MessageLite::ParseFromString(std::string const&)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Message::InitializationErrorString() const'
.build_release/lib/libcaffe.so: undefined reference to `google::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 to `google::protobuf::Message::GetTypeName() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::AssignDescriptors(std::string const&, google::protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::MessageFactory*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::MessageLite::SerializeToString(std::string*) const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Message::DebugString() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
.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 to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::string const&))'
.build_release/lib/libcaffe.so: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
.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 to `google::protobuf::internal::fixed_address_empty_string'
.build_release/lib/libcaffe.so: undefined reference to `leveldb::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
make: *** [Makefile:617: .build_release/tools/compute_image_mean.bin] Error 1
.build_release/tools/extract_features.o: In function `std::string* google::MakeCheckOpString<int, int>(int const&, int const&, char const*)':
extract_features.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc]+0x40): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/tools/extract_features.o: In function `std::string* google::MakeCheckOpString<unsigned long, unsigned long>(unsigned long const&, unsigned long const&, char const*)':
extract_features.cpp:(.text._ZN6google17MakeCheckOpStringImmEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringImmEEPSsRKT_RKT0_PKc]+0x41): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/tools/extract_features.o: In function `int feature_extraction_pipeline<float>(int, char**)':
extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0xc6a): undefined reference to `google::protobuf::internal::fixed_address_empty_string'
extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0x127d): undefined reference to `google::protobuf::MessageLite::SerializeToString(std::string*) const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Message::InitializationErrorString() const'
.build_release/lib/libcaffe.so: undefined reference to `google::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 to `google::protobuf::Message::GetTypeName() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::AssignDescriptors(std::string const&, google::protobuf::internal::MigrationSchema const*, google::protobuf::Message const* const*, unsigned int const*, google::protobuf::MessageFactory*, google::protobuf::Metadata*, google::protobuf::EnumDescriptor const**, google::protobuf::ServiceDescriptor const**)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::Message::DebugString() const'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::MessageLite::ParseFromString(std::string const&)'
.build_release/lib/libcaffe.so: undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
.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 to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::string const&))'
.build_release/lib/libcaffe.so: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
.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 to `leveldb::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
make: *** [Makefile:617: .build_release/tools/extract_features.bin] Error 1

ldd .build_release/lib/libcaffe.so gives me:

linux-vdso.so.1 (0x00007ffd14bd3000)
libcudart.so.8.0 => /opt/cuda/lib64/libcudart.so.8.0 (0x00007f5236d0c000)
libcublas.so.8.0 => /opt/cuda/lib64/libcublas.so.8.0 (0x00007f5234274000)
libcurand.so.8.0 => /opt/cuda/lib64/libcurand.so.8.0 (0x00007f52302fe000)
libglog.so.0 => /usr/lib/libglog.so.0 (0x00007f52300cd000)
libgflags.so.2.2 => /usr/lib/libgflags.so.2.2 (0x00007f522fea8000)
libprotobuf.so.13 => /usr/lib/libprotobuf.so.13 (0x00007f522fa13000)
libboost_system.so.1.65.1 => /usr/lib/libboost_system.so.1.65.1 (0x00007f522f80e000)
libboost_filesystem.so.1.65.1 => /usr/lib/libboost_filesystem.so.1.65.1 (0x00007f522f5f3000)
libhdf5_hl.so.100 => /usr/lib/libhdf5_hl.so.100 (0x00007f522f3d0000)
libhdf5.so.101 => /usr/lib/libhdf5.so.101 (0x00007f522ee4d000)
libleveldb.so.1 => /usr/lib/libleveldb.so.1 (0x00007f522ebee000)
libsnappy.so.1 => /usr/lib/libsnappy.so.1 (0x00007f522e9e6000)
liblmdb.so => /usr/lib/liblmdb.so (0x00007f522e7d1000)
libopencv_core.so.3.3 => /usr/lib/libopencv_core.so.3.3 (0x00007f522d48b000)
libopencv_highgui.so.3.3 => /usr/lib/libopencv_highgui.so.3.3 (0x00007f522d278000)
libopencv_imgproc.so.3.3 => /usr/lib/libopencv_imgproc.so.3.3 (0x00007f522957b000)
libopencv_imgcodecs.so.3.3 => /usr/lib/libopencv_imgcodecs.so.3.3 (0x00007f5228fd5000)
libboost_thread.so.1.65.1 => /usr/lib/libboost_thread.so.1.65.1 (0x00007f5228daf000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f5228a28000)
libopenblas.so.3 => /usr/lib/libopenblas.so.3 (0x00007f52264a6000)
libm.so.6 => /usr/lib/libm.so.6 (0x00007f522615a000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f5225f43000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f5225d25000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f522596e000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f522576a000)
librt.so.1 => /usr/lib/librt.so.1 (0x00007f5225562000)
libz.so.1 => /usr/lib/libz.so.1 (0x00007f522534b000)
/usr/lib64/ld-linux-x86-64.so.2 (0x00007f5237a64000)
libtcmalloc.so.4 => /usr/lib/libtcmalloc.so.4 (0x00007f52250d7000)
libGL.so.1 => /usr/lib/libGL.so.1 (0x00007f5224e33000)
libtbb.so.2 => /usr/lib/libtbb.so.2 (0x00007f5224bf7000)
libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0 (0x00007f52245b7000)
libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0x00007f5224302000)
libcairo.so.2 => /usr/lib/libcairo.so.2 (0x00007f5223fe4000)
libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x00007f5223dc0000)
libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x00007f5223b6d000)
libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007f522385a000)
libgtkglext-x11-1.0.so.0 => /usr/lib/libgtkglext-x11-1.0.so.0 (0x00007f5223656000)
libgdkglext-x11-1.0.so.0 => /usr/lib/libgdkglext-x11-1.0.so.0 (0x00007f52233f2000)
libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007f5223189000)
libwebp.so.7 => /usr/lib/libwebp.so.7 (0x00007f5222f20000)
libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007f5222ce9000)
libtiff.so.5 => /usr/lib/libtiff.so.5 (0x00007f5222a62000)
libjasper.so.4 => /usr/lib/libjasper.so.4 (0x00007f52227ed000)
libIlmImf-2_2.so.22 => /usr/lib/libIlmImf-2_2.so.22 (0x00007f5222314000)
libHalf.so.12 => /usr/lib/libHalf.so.12 (0x00007f52220d1000)
libgfortran.so.4 => /usr/lib/libgfortran.so.4 (0x00007f5221cf5000)
libgomp.so.1 => /usr/lib/libgomp.so.1 (0x00007f5221ac7000)
libGLX.so.0 => /usr/lib/libGLX.so.0 (0x00007f5221897000)
libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 (0x00007f52215c9000)
libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x00007f52213c5000)
libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0x00007f52211b8000)
libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f5220e79000)
libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x00007f5220c73000)
libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x00007f5220a4d000)
libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0x00007f52206b2000)
libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x00007f522049c000)
libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x00007f522024d000)
libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x00007f5220008000)
libXrender.so.1 => /usr/lib/libXrender.so.1 (0x00007f521fdfd000)
libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x00007f521fbfa000)
libXi.so.6 => /usr/lib/libXi.so.6 (0x00007f521f9e9000)
libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x00007f521f7de000)
libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x00007f521f5d3000)
libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x00007f521f3d0000)
libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x00007f521f1cd000)
libXext.so.6 => /usr/lib/libXext.so.6 (0x00007f521efbb000)
libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0x00007f521ed13000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007f521ea4d000)
libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0x00007f521e849000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f521e620000)
libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0x00007f521e412000)
libffi.so.6 => /usr/lib/libffi.so.6 (0x00007f521e209000)
libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007f521df96000)
libGLU.so.1 => /usr/lib/libGLU.so.1 (0x00007f521dd16000)
libXmu.so.6 => /usr/lib/libXmu.so.6 (0x00007f521dafb000)
libXt.so.6 => /usr/lib/libXt.so.6 (0x00007f521d892000)
libpangox-1.0.so.0 => /usr/lib/libpangox-1.0.so.0 (0x00007f521d672000)
liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f521d44c000)
libImath-2_2.so.12 => /usr/lib/libImath-2_2.so.12 (0x00007f521d23a000)
libIex-2_2.so.12 => /usr/lib/libIex-2_2.so.12 (0x00007f521d01a000)
libIlmThread-2_2.so.12 => /usr/lib/libIlmThread-2_2.so.12 (0x00007f521ce13000)
libquadmath.so.0 => /usr/lib/../lib/libquadmath.so.0 (0x00007f521cbd3000)
libresolv.so.2 => /usr/lib/libresolv.so.2 (0x00007f521c9bc000)
libmount.so.1 => /usr/lib/libmount.so.1 (0x00007f521c768000)
libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007f521c4cf000)
libthai.so.0 => /usr/lib/libthai.so.0 (0x00007f521c2c5000)
libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007f521c093000)
libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007f521be83000)
libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f521bc7f000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f521ba79000)
libSM.so.6 => /usr/lib/libSM.so.6 (0x00007f521b871000)
libICE.so.6 => /usr/lib/libICE.so.6 (0x00007f521b654000)
libblkid.so.1 => /usr/lib/libblkid.so.1 (0x00007f521b409000)
libuuid.so.1 => /usr/lib/libuuid.so.1 (0x00007f521b204000)
libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007f521afd8000)
libdatrie.so.1 => /usr/lib/libdatrie.so.1 (0x00007f521add0000)


It shows that libprotobuf is founded. 

I have to use gcc 4.9.4, because I will need to make matcaffe, which MATLAB mex compiler only support gcc 4.9.x.

OS: Arch Linux
Compiler: gcc-4.9.4
CUDA: 8.0.61
protobuf: 3.3.2
MATLAB: 2017b

DarcyHu

unread,
Sep 29, 2017, 4:19:02 AM9/29/17
to Caffe Users
Actually, MATLAB did not support gcc > 4.9.x as mex compiler officially, one could still use gcc > 4.9.x. And caffe suggests gcc > 4.9.x to compile caffe. So, I changed the Makefile.config, set CUSTOM_CXX := g++-5, finally I succeed to compile and build 3D-Caffe. make all & make matcaffe with no error.

However, when I use matcaffe, I got this error:
Invalid MEX-file '~/3D-FCNN-code/Automatic
3D Cardiovascular MR Segmentation with Densely-Connected Volumetric
ConvNets/HeartSeg/3D-Caffe/matlab/+caffe/private/caffe_.mexa64':
'~/3D-FCNN-code/Automatic 3D
Cardiovascular MR Segmentation with Densely-Connected Volumetric
ConvNets/HeartSeg/3D-Caffe/matlab/+caffe/private/caffe_.mexa64' is not a valid
shared library..

Error in caffe.reset_all (line 5)
caffe_('reset');

Error in test_model (line 36)
caffe.reset_all

 Test code is available here.

!ldd ../3D-Caffe/matlab/+caffe/private/caffe_.mexa64 gives me:
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ../3D-Caffe/matlab/+caffe/private/caffe_.mexa64)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/libglog.so.0)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libglog.so.0)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/libgflags.so.2.2)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libgflags.so.2.2)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libprotobuf.so.13)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/libboost_system.so.1.65.1)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libboost_system.so.1.65.1)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/libboost_filesystem.so.1.65.1)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libboost_filesystem.so.1.65.1)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libleveldb.so.1)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libsnappy.so.1)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/libsnappy.so.1)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/libopencv_core.so.3.3)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libopencv_core.so.3.3)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/libopencv_imgproc.so.3.3)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libopencv_imgcodecs.so.3.3)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/libopencv_imgcodecs.so.3.3)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/libboost_thread.so.1.65.1)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libboost_thread.so.1.65.1)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libtcmalloc.so.4)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libIlmImf-2_2.so.22)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libIex-2_2.so.12)
../3D-Caffe/matlab/+caffe/private/caffe_.mexa64: /usr/local/MATLAB/R2017a/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/libIlmThread-2_2.so.12)

It seems that the libstdc++ version ship with MATLAB 2017a is not compatible with the system lib, which is linked with while building matcaffe. So I create a soft link to the system's libstdc++, and try again, MATLAB still complained that caffe_.mexa64 is invalid.

Any suggestion?

DarcyHu

unread,
Oct 6, 2017, 12:03:19 PM10/6/17
to Caffe Users
Ok, just to mentioned that it's solved. The libfreetype shipped with MATLAB is too old, use the system one instead.

env LD_PRELOAD=/usr/lib/libstdc++.so.6:/usr/lib/libfreetype.so.6 MATLAB_SHELL=bash optirun matlab -desktop




Reply all
Reply to author
Forward
0 new messages