Cannot build caffe on Kubuntu 16.04

3,737 views
Skip to first unread message

蔡昌逸

unread,
Oct 5, 2016, 10:16:29 PM10/5/16
to Caffe Users
I tried to build caffe on Kubuntu 16.04 following the guide from the wiki of caffe.
In the beginning, I followed the guide and installed everything step by step, but it didn't work.
Latter on, I read someone saying that apt-get cannot get the proper version of packages, so 
I built up `glog, gflags, protobuf` from source on my own. Still, it did not work.    

My system is Kubuntu 16.04. BLAS is MKL. Built with CPU_ONLY=1. Python library is from Anaconda2.

Can someone help me to resolve this problem?

CXX/LD -o .build_release/tools/upgrade_net_proto_binary.bin
.build_release/tools/upgrade_net_proto_binary.o: In function `main':
upgrade_net_proto_binary.cpp:(.text.startup+0x214): undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned lo
ng
&, unsigned long)'
.build_release/tools/upgrade_net_proto_binary.o: In function `boost::system::system_error::what() const'
:
upgrade_net_proto_binary
.cpp:(.text._ZNK5boost6system12system_error4whatEv[_ZNK5boost6system12system_error4whatEv]+0x74): undefined reference to `std::__cxx11::basic_string<char,
 std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, char const*, unsigned long)'
upgrade_net_proto_binary.cpp:(.text._ZNK5boost6system12system_error4whatEv[_ZNK5boost6system12system_error4whatEv]+0xa1): undefined reference to `
std::__cxx11::basic_string<char,
 std
::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned long)'
upgrade_net_proto_binary.cpp:(.text._ZNK5boost6system12system_error4whatEv[_ZNK5boost6system12system_error4whatEv]+0xe3): undefined reference to `std::__cxx11::basic_string<char,
 std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned long)'

.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_aux(unsigned long, unsigned lo
ng, unsigned long, char)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `
TIFFReadRGBAStrip@LIBTIFF_4.0'
.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned long)'

/usr/local/lib/libprotobuf.so: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/usr/local/lib/libgflags.so: undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char const*, unsigned long, unsigned lo
ng
) const@GLIBCXX_3.4.21'
.build_release/lib/libcaffe.so: undefined reference to `std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()'
.build_release/lib/libcaffe.so: undefined reference to `
VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'
/usr/local/lib/libgflags.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*)@GLIBCXX_3.4.21'

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_core.so: undefined reference to `std::__cxx11::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator
<wchar_t> >::_M_create(unsigned long&, unsigned long)@GLIBCXX_3.4.21'
.build_release/lib/libcaffe.so: undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(unsigned long, char)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_python.so: undefined reference to `std::range_error::range_error(std::__cxx11::basic_string<char, std::char_tra
its<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_system.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char
> >::~basic_string()@GLIBCXX_3.4.21'
/usr/local/lib/libgflags.so: undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_erase(unsigned long, unsigned long)@GLIBC
XX_3
.4.21'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFIsTiled@LIBTIFF_4.0'

.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() const'
/usr/local/lib/libgflags.so: undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace_aux(unsigned long, unsigned long,
 
unsigned long, char)@GLIBCXX_3.4.21'
.build_release/lib/libcaffe.so: undefined reference to `vtable for std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >'

.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, unsigned long,
std::allocator<char> const&)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_core.so: undefined reference to `
std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator
<char> >::~basic_stringstream()@GLIBCXX_3.4.21'
.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(char const*)'

.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::str() const'
/usr/local/lib/libgflags.so: undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::rfind(char, unsigned long) const@GLIBCXX_3.4
.21'
/usr/local/lib/libgflags.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_append(char const*, unsigned long)@GLIBCX
X_3.4.21'

.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(char const*)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `
TIFFWriteScanline@LIBTIFF_4.0'
//usr/lib/x86_64-linux-gnu/libsoxr.so.0: undefined reference to `GOMP_parallel@GOMP_4.0'

.build_release/lib/libcaffe.so: undefined reference to `std::__throw_out_of_range_fmt(char const*, ...)'
.build_release/lib/libcaffe.so: undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::__cxx11::basic_string<char
, std::char_traits<char>, std::allocator<char> > const&)'
/usr/local/lib/libgflags.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned long)@GLIBCXX_3.4.21'

.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned long)'
/usr/local/lib/libprotobuf.so: undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::resize(unsigned long, char)@GLIBCXX_3.4.21
'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_core.so: undefined reference to `vtable for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std
::allocator<char> >@GLIBCXX_3.4.21'

.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&) const'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `
TIFFGetField@LIBTIFF_4.0'
/usr/local/lib/libgflags.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char, unsigned long) const@GLIBCXX_3.4.
21'

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFScanlineSize@LIBTIFF_4.0'
/usr/local/lib/libprotobuf.so: undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_mutate(unsigned long, unsigned long, ch
ar
const*, unsigned long)@GLIBCXX_3.4.21'
/usr/local/lib/libprotobuf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_last_of(char const*, unsigned long, u
nsigned long) const@GLIBCXX_3.4.21'

.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char
, std::char_traits<char>, std::allocator<char> > const&)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `
TIFFReadEncodedTile@LIBTIFF_4.0'
/usr/local/lib/libgflags.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_replace(unsigned long, unsigned long, cha
r const*, unsigned long)@GLIBCXX_3.4.21'

.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(std::_Ios_Open
mode)'
.build_release/lib/libcaffe.so: undefined reference to `
std::domain_error::domain_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFReadRGBATile@LIBTIFF_4.0'

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFClose@LIBTIFF_4.0'
/usr/local/lib/libprotobuf.so: undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_first_of(char const*, unsigned long,
unsigned long) const@GLIBCXX_3.4.21'
/usr/local/lib/libprotobuf.so: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream()@GLIBCXX_3.4.
21'

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_core.so: undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<ch
ar> >::_M_sync(char*, unsigned long, unsigned long)@GLIBCXX_3.4.21'
.build_release/lib/libcaffe.so: undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size() const'
.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(std::__cxx11::basic_string<cha
r, std::char_traits<char>, std::allocator<char> > const&)'

.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*, unsigned long)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `
TIFFRGBAImageOK@LIBTIFF_4.0'
.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(unsigned long, unsigned long, cha
r const*) const'

.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::c_str() const'
.build_release/lib/libcaffe.so: undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::resize(unsigned long, char)'
/usr/local/lib/libprotobuf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::swap(std::__cxx11::basic_string<char, std:
:char_traits<char>, std::allocator<char> >&)@GLIBCXX_3.4.21'

.build_release/lib/libcaffe.so: undefined reference to `std::basic_istream<char, std::char_traits<char> >& std::operator>><char, std::char_traits<char>, std::allocator<char> >(st
d::basic_istream<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_thread.so: undefined reference to `
std::basic_istream<char, std::char_traits<char> >& std::getline<char, std::c
har_traits
<char>, std::allocator<char> >(std::basic_istream<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, cha
r
)@GLIBCXX_3.4.21'
//usr/lib/x86_64-linux-gnu/libtbb.so.2: undefined reference to `std::length_error::length_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > co
nst&)@GLIBCXX_3.4.21'

/usr/local/lib/libprotobuf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(unsigned long, unsigned long, std:
:__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const@GLIBCXX_3.4.21'
.build_release/lib/libcaffe.so: undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::rfind(char, unsigned long) const'
/usr/local/lib/libprotobuf.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find_first_not_of(char const*, unsigned lo
ng, unsigned long) const@GLIBCXX_3.4.21'

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_core.so: undefined reference to `VTT for std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::a
llocator<char> >@GLIBCXX_3.4.21'
/usr/local/lib/libgflags.so: undefined reference to `
std::__throw_out_of_range_fmt(char const*, ...)@GLIBCXX_3.4.20'
.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::empty() const'

.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*)'
.build_release/lib/libcaffe.so: undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*)'
/usr/local/lib/libgflags.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, s
td::char_traits<char>, std::allocator<char> > const&)@GLIBCXX_3.4.21'

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFOpen@LIBTIFF_4.0'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_thread.so: undefined reference to `
std::runtime_error::runtime_error(std::runtime_error const&)@GLIBCXX_3.4.21'
//usr/lib/x86_64-linux-gnu/libIlmImf-2_2.so.22: undefined reference to `std::__cxx11::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >::basic_stringstream(
std::_Ios_Openmode)@GLIBCXX_3.4.21'

/usr/local/lib/libgflags.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*)@GLIBCXX_3.4.21'
.build_release/lib/libcaffe.so: undefined reference to `
std::runtime_error::runtime_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
.build_release/lib/libcaffe.so: undefined reference to `vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >'

/usr/local/lib/libgflags.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<char>, std::allocator<char> >
const&)@GLIBCXX_3.4.21'
.build_release/lib/libcaffe.so: undefined reference to `std::runtime_error::runtime_error(std::runtime_error const&)'

.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()'
/usr/local/lib/libprotobuf.so: undefined reference to `
vtable for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFReadEncodedStrip@LIBTIFF_4.0'

/usr/local/lib/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'
.build_release/lib/libcaffe.so: undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(std::__cxx11::basic_string<char, s
td
::char_traits<char>, std::allocator<char> > const&)'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFSetField@LIBTIFF_4.0'

/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 `
std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::~basic_ostringstream()'
.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::swap(std::__cxx11::basic_string<char, std
::char_traits<char>, std::allocator<char> >&)'

/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<char>, std::allocator<char> > 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<ch
ar
> >(std::locale const&)@GLIBCXX_3.4.21'
.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*, unsigned long)'

.build_release/lib/libcaffe.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <char, std::char_traits<char>, std::allocator<char> >(s
td::basic_ostream<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
.build_release/lib/libcaffe.so: undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(char const*) const'
.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<c
har, std::char_traits<char>, std::allocator<char> > const&)'

/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'
.build_release/lib/libcaffe.so: undefined reference to `
std::basic_istream<char, std::char_traits<char> >& std::getline<char, std::char_traits<char>, std::allocator<char> >(std::
basic_istream
<char, std::char_traits<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, char)'
.build_release/lib/libcaffe.so: undefined reference to `std::logic_error::logic_error(std::logic_error const&)'

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFSetWarningHandler@LIBTIFF_4.0'
/usr/local/lib/libprotobuf.so: undefined reference to `
VTT for std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >@GLIBCXX_3.4.21'
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_highgui.so: undefined reference to `TIFFSetErrorHandler@LIBTIFF_4.0'

.build_release/lib/libcaffe.so: undefined reference to `std::overflow_error::overflow_error(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&
)'
.build_release/lib/libcaffe.so: undefined reference to `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char, unsigned long) const'
.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream(std::__cxx11::
basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::_Ios_Openmode)'

.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct(unsigned long, char)'
/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::allocato
r
<wchar_t> >::_M_construct(unsigned long, wchar_t)@GLIBCXX_3.4.21'
.build_release/lib/libcaffe.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<
char> const&)'

//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<char>, std::allocator<char> > co
nst
&)@GLIBCXX_3.4.21'
/usr/local/lib/libgflags.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::__cxx11::basic_string<char, std
::char_traits<char>, std::allocator<char> > const&) const@GLIBCXX_3.4.21'

/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libboost_system.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 `
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::data() const'
.build_release/lib/libcaffe.so: undefined reference to `std::out_of_range::out_of_range(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

collect2
: error: ld returned 1 exit status
Makefile:619: recipe for target '.build_release/tools/upgrade_net_proto_binary.bin' failed
make
: *** [.build_release/tools/upgrade_net_proto_binary.bin] Error 1


蔡昌逸

unread,
Oct 6, 2016, 12:56:33 AM10/6/16
to Caffe Users
I finally passed the `make all` step.

The problem arose from I stupidly set environment variable `LD_LIBRARY_PATH={home}\anaconda2\lib\` 
which cannot provide proper header file to build up everything. It's really a unforgettable lesson. 

蔡昌逸於 2016年10月6日星期四 UTC+8上午10時16分29秒寫道:

Yong Peng

unread,
Oct 8, 2016, 5:14:37 AM10/8/16
to Caffe Users
Hi ,Mr Cai! I happened to meet the same problem  today,Can you tell me how you set she 'LD_LIBPARY _PATH'
to fix this problem? I am looking forwarded to have your reply.Your kind heart will be appreciated.在 2016年10月6日星期四 UTC+8下午12:56:33,蔡昌逸写道:

蔡昌逸

unread,
Oct 8, 2016, 9:31:12 AM10/8/16
to Caffe Users
I didn't set the `LD_LIBRARY_PATH` by myself but the default after that.

and `do not` compile from sources because it's not helpful at all. The libs from apt-get are enough. 

Yong Peng於 2016年10月8日星期六 UTC+8下午5時14分37秒寫道:

zora...@163.com

unread,
Oct 29, 2016, 10:32:35 PM10/29/16
to Caffe Users
I have the same question ubuntu16.04, cuda8.0, gcc5.4 , have you solved this problem?

在 2016年10月8日星期六 UTC+8下午5:14:37,Yong Peng写道:

Norbert Nyakó

unread,
Nov 30, 2016, 2:50:00 PM11/30/16
to Caffe Users
Hi,

I have the same problem, but my LD_LIBRARY_PATH looks fine.
Could you have any other idea?

Br,
Norbert

ma...@markable.us

unread,
Nov 30, 2016, 3:18:04 PM11/30/16
to Caffe Users
You shouldn't have to mess with LD_LIBRARY_PATH. If you're using Anaconda, make sure you edit your Makefile.config and follow the instructions in the comments for using Anaconda instead of the standard Python interpreter.

Here's the template from Makefile.config.example.

# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
PYTHON_INCLUDE := /usr/include/python2.7 \
                /usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# Verify anaconda location, sometimes it's in root.
# ANACONDA_HOME := $(HOME)/anaconda
# PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
                # $(ANACONDA_HOME)/include/python2.7 \
                # $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \

# Uncomment to use Python 3 (default is Python 2)
# PYTHON_LIBRARIES := boost_python3 python3.5m
# PYTHON_INCLUDE := /usr/include/python3.5m \
#                 /usr/lib/python3.5/dist-packages/numpy/core/include

# We need to be able to find libpythonX.X.so or .dylib.
PYTHON_LIB := /usr/lib
# PYTHON_LIB := $(ANACONDA_HOME)/lib

To use Anaconda, comment out the top line and uncomment the bottom two. Pay attention to make sure ANACONDA_HOME actually points to the correct path. By default Anaconda 2 will install to $(HOME)/anaconda2 not $(HOME)/anaconda as written in the example. See the changes below.

# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
# PYTHON_INCLUDE := /usr/include/python2.7 \
                /usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# Verify anaconda location, sometimes it's in root.
ANACONDA_HOME := $(HOME)/anaconda2
PYTHON_INCLUDE := $(ANACONDA_HOME)/include \
                  $(ANACONDA_HOME)/include/python2.7 \
                  $(ANACONDA_HOME)/lib/python2.7/site-packages/numpy/core/include \

# Uncomment to use Python 3 (default is Python 2)
# PYTHON_LIBRARIES := boost_python3 python3.5m
# PYTHON_INCLUDE := /usr/include/python3.5m \
#                 /usr/lib/python3.5/dist-packages/numpy/core/include

# We need to be able to find libpythonX.X.so or .dylib.
# PYTHON_LIB := /usr/lib
PYTHON_LIB := $(ANACONDA_HOME)/lib

ohad volvo

unread,
Jun 14, 2017, 6:34:56 AM6/14/17
to Caffe Users
Hi Norbert,
Did you find any solution to your problem (I just got the same problem while trying to install Caffe

Thanks,
Ohad

בתאריך יום רביעי, 30 בנובמבר 2016 בשעה 21:50:00 UTC+2, מאת Norbert Nyakó:
Reply all
Reply to author
Forward
0 new messages