Change default location of protobuf and opencv

959 views
Skip to first unread message

M@y

unread,
Oct 17, 2016, 3:34:08 AM10/17/16
to Caffe Users
I had this problem (https://groups.google.com/forum/#!topic/caffe-users/OgpbyHvmqwM) so I compiled manually protobuf and opencv into 2 specific folders and I've added the paths to those directories into Makefile.config so caffe can find them while compiling it:

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/OpenCV/include /usr/local/protobuf-Test/include /usr/local/include  /usr/include/hdf5/serial/
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/OpenCV/lib/ /usr/local/protobuf-Test/lib /usr/local/lib /usr/lib  /usr/lib/x86_64-linux-gnu/hdf5/serial/ 

 but I'm still getting the same problem:
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0-rc3
CXX tools/upgrade_solver_proto_text.cpp
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 to « caffe::BlockingQueue<caffe::Batch<double>*>::pop(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > 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::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 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::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 to « google::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 to « google::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 to « google::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 to « leveldb::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 to « google::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 to « caffe::BlockingQueue<caffe::Batch<float>*>::pop(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) »
.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*) »

So I double checked the linking to libcaffe.so by running this command: ldd -d .build_release/lib/libcaffe.so and here is the result:
linux-vdso.so.1 =>  (0x00007ffff0bf9000)
libcudart.so.8.0 => not found
libcublas.so.8.0 => not found
libcurand.so.8.0 => not found
libglog.so.0 => /usr/lib/x86_64-linux-gnu/libglog.so.0 (0x00007f696b829000)
libprotobuf.so.9 => /usr/lib/x86_64-linux-gnu/libprotobuf.so.9 (0x00007f696b50b000)
libboost_system.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0 (0x00007f696b306000)
libhdf5_serial_hl.so.10 => /usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so.10 (0x00007f696b0e6000)
libhdf5_serial.so.10 => /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.10 (0x00007f696ac49000)
libleveldb.so.1 => /usr/lib/x86_64-linux-gnu/libleveldb.so.1 (0x00007f696a9ee000)
liblmdb.so => /usr/local/lib/liblmdb.so (0x00007f696a7d9000)
libopencv_core.so.2.4 => not found
libopencv_highgui.so.2.4 => not found
libopencv_imgproc.so.2.4 => not found
libboost_thread.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.58.0 (0x00007f696a5b2000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f696a22f000)
libcblas.so.3 => /usr/lib/libcblas.so.3 (0x00007f696a00d000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6969d04000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6969aed000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f69698d0000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6969507000)
libgflags.so.2 => /usr/lib/x86_64-linux-gnu/libgflags.so.2 (0x00007f69692e5000)
libunwind.so.8 => /usr/lib/x86_64-linux-gnu/libunwind.so.8 (0x00007f69690ca000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f6968eb0000)
libsz.so.2 => /usr/lib/x86_64-linux-gnu/libsz.so.2 (0x00007f6968cac000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6968aa8000)
libsnappy.so.1 => /usr/lib/x86_64-linux-gnu/libsnappy.so.1 (0x00007f69688a0000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f6968697000)
/lib64/ld-linux-x86-64.so.2 (0x0000561cfc53e000)
libatlas.so.3 => /usr/lib/libatlas.so.3 (0x00007f69680f9000)
libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007f6967dcd000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f6967bab000)
libaec.so.0 => /usr/lib/x86_64-linux-gnu/libaec.so.0 (0x00007f69679a2000)
libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007f6967763000)
undefined symbol: _ZNK6google8protobuf7Message11GetTypeNameEv (.build_release/lib/libcaffe.so)
undefined symbol: _ZNK6google8protobuf7Message25InitializationErrorStringEv (.build_release/lib/libcaffe.so)
undefined symbol: _ZN6google8protobuf8internal13empty_string_E (.build_release/lib/libcaffe.so)
undefined symbol: _ZTVN2cv11_InputArrayE (.build_release/lib/libcaffe.so)


It's clear that it didn't find opencv libraries and it's linked to the wrong version of libprotobuf. It seems to me that I didn't properly tell the library how to use the new paths of both libraries. Is there anyone that have any clue on how this can be done?

Thanks.

Reply all
Reply to author
Forward
0 new messages