-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Issues with compiling caffe with python, undefined reference to `std::__cxx11::…' #4949
Comments
Try to use CMake build instead of Makefile.config. |
If the cmake build still has issues, try adding this: It looks like you may have some libraries compiled against an older version of gcc, which means you need to throw this compatibility flag. |
@abuccts Thanks. Problem solved. |
@JakeRenn please close this issue, since it has been solved. |
I am running against
|
Issue summary
I used to compile successfully caffe with WITH_PYTHON_LAYER:=1 on Ubuntu 14.04. Then I switched to Ubuntu 16.04, using the same settings but different built-in software such as g++ 5.4 for 16.04 instead of g++ 4.8 for 14.04, I failed to compile caffe with python. Would you please give me some advice on this issue?
Steps to reproduce
Makefile.config.txt
)
make -j8
System configuration
Operating system: Unbuntu 16.04
Compiler: g++ 5.4.0
CUDA version (if applicable): cuda-8.0
CUDNN version (if applicable): none
BLAS: openBlas
Python or MATLAB version (for pycaffe and matcaffe respectively): Python
Error Message
The following is part of the error message I got
.build_release/lib/libcaffe.so: undefined reference to
google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::string const&))' //usr/lib/x86_64-linux-gnu/libIlmImf-2_2.so.22: undefined reference to
std::__cxx11::basic_stringstream<char, std::char_traits, std::allocator >::basic_stringstream(std::_Ios_Openmode)@GLIBCXX_3.4.21'.build_release/lib/libcaffe.so: undefined reference to
leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)' /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libgflags.so: undefined reference to
std::__cxx11::basic_string<char, std::char_traits, std::allocator >::append(char const*)@GLIBCXX_3.4.21'/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libglog.so: undefined reference to
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const@GLIBCXX_3.4.21' //usr/lib/x86_64-linux-gnu/libtbb.so.2: undefined reference to
std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)@GLIBCXX_3.4.21'.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&)' /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libglog.so: undefined reference to
vtable for std::__cxx11::basic_ostringstream<char, std::char_traits, std::allocator >@GLIBCXX_3.4.21'/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libgflags.so: undefined reference to
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct(unsigned long, char)@GLIBCXX_3.4.21' /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libleveldb.so: undefined reference to
__cxa_throw_bad_array_new_length@CXXABI_1.3.8'.build_release/lib/libcaffe.so: undefined reference to
google::protobuf::internal::StringTypeHandlerBase::New()' /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to
std::invalid_argument::invalid_argument(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)@GLIBCXX_3.4.21'/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_thread.so: undefined reference to
std::__cxx11::numpunct<char> const& std::use_facet<std::__cxx11::numpunct<char> >(std::locale const&)@GLIBCXX_3.4.21' .build_release/lib/libcaffe.so: undefined reference to
google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_thread.so: undefined reference to
std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21' /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libglog.so: undefined reference to
VTT for std::__cxx11::basic_ostringstream<char, std::char_traits, std::allocator >@GLIBCXX_3.4.21'/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to
std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_M_construct(unsigned long, wchar_t)@GLIBCXX_3.4.21' //usr/lib/x86_64-linux-gnu/libtbb.so.2: undefined reference to
std::out_of_range::out_of_range(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)@GLIBCXX_3.4.21'.build_release/lib/libcaffe.so: undefined reference to
leveldb::Status::ToString() const' /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libgflags.so: undefined reference to
std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) const@GLIBCXX_3.4.21'/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libglog.so: undefined reference to
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21' .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:619: recipe for target '.build_release/tools/convert_imageset.bin' failed
make: *** [.build_release/tools/convert_imageset.bin] Error 1
The text was updated successfully, but these errors were encountered: