Ubuntu 15.10. Caffe building errors

2,451 views
Skip to first unread message

Mladen Fernežir

unread,
Nov 25, 2015, 10:05:38 AM11/25/15
to Caffe Users
Hello,

I'm having problems building Caffe on Ubuntu 15.10. I've installed CUDA 7.5 and device query says that all tests pass. I'm using NVIDIA's 0.14 branch, but I'm also having problems with the BVLC Caffe version. Here's the error with cuDNN set to zero in the Makefile.config. Makefile.config attached.

Could somebody help in clarifying  this?

/home/datascience/caffe/.build_release/tools/caffe.o: In function `std::string* google::MakeCheckOpString<cudaError, cudaError>(cudaError const&, cudaError const&, char const*)':
caffe.cpp:(.text._ZN6google17MakeCheckOpStringI9cudaErrorS1_EEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringI9cudaErrorS1_EEPSsRKT_RKT0_PKc]+0x43): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'

/home/datascience/caffe/.build_release/tools/caffe.o: In function `std::string* ls
google::MakeCheckOpString<unsigned long, int>(unsigned long const&, int const&, char const*)':
caffe.cpp:(.text._ZN6google17MakeCheckOpStringImiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringImiEEPSsRKT_RKT0_PKc]+0x43): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'

/home/datascience/caffe/.build_release/tools/caffe.o: In function `std::string* google::MakeCheckOpString<int, float>(int const&, float const&, char const*)':
caffe.cpp:(.text._ZN6google17MakeCheckOpStringIifEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIifEEPSsRKT_RKT0_PKc]+0x48): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
/home/datascience/caffe/.build_release/tools/caffe.o: In function `std::string* google::MakeCheckOpString<float, int>(float const&, int const&, char const*)':
caffe.cpp:(.text._ZN6google17MakeCheckOpStringIfiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIfiEEPSsRKT_RKT0_PKc]+0x48): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
/home/datascience/caffe/.build_release/tools/caffe.o: In function `main':
caffe.cpp:(.text.startup+0x3f): undefined reference to `google::SetVersionString(std::string const&)'
caffe.cpp:(.text.startup+0x6f): undefined reference to `google::SetUsageMessage(std::string const&)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `cv::imread(std::string const&, int)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.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&)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `leveldb::Status::ToString() const'
collect2: error: ld returned 1 exit status
Makefile:623: recipe for target '/home/datascience/caffe/.build_release/tools/caffe.bin' failed
make: *** [/home/datascience/caffe/.build_release/tools/caffe.bin] Error 1
make: *** Waiting for unfinished jobs....
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `cv::imread(std::string const&, int)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.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&)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `leveldb::Status::ToString() const'
collect2: error: ld returned 1 exit status
Makefile:623: recipe for target '/home/datascience/caffe/.build_release/tools/upgrade_net_proto_text.bin' failed
make: *** [/home/datascience/caffe/.build_release/tools/upgrade_net_proto_text.bin] Error 1
/home/datascience/caffe/.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]+0x43): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
/home/datascience/caffe/.build_release/tools/extract_features.o: In function `std::string* google::MakeCheckOpString<unsigned int, int>(unsigned int const&, int const&, char const*)':
extract_features.cpp:(.text._ZN6google17MakeCheckOpStringIjiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIjiEEPSsRKT_RKT0_PKc]+0x43): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
/home/datascience/caffe/.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]+0x44): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `cv::imread(std::string const&, int)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.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&)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `leveldb::Status::ToString() const'
collect2: error: ld returned 1 exit status
Makefile:623: recipe for target '/home/datascience/caffe/.build_release/tools/extract_features.bin' failed
make: *** [/home/datascience/caffe/.build_release/tools/extract_features.bin] Error 1
/home/datascience/caffe/.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]+0x43): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
/home/datascience/caffe/.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]+0x43): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
/home/datascience/caffe/.build_release/tools/compute_image_mean.o: In function `main':
compute_image_mean.cpp:(.text.startup+0x105): undefined reference to `google::SetUsageMessage(std::string const&)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `cv::imread(std::string const&, int)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.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&)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `leveldb::Status::ToString() const'
collect2: error: ld returned 1 exit status
Makefile:623: recipe for target '/home/datascience/caffe/.build_release/tools/compute_image_mean.bin' failed
make: *** [/home/datascience/caffe/.build_release/tools/compute_image_mean.bin] Error 1
/home/datascience/caffe/.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]+0x43): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
/home/datascience/caffe/.build_release/tools/convert_imageset.o: In function `main':
convert_imageset.cpp:(.text.startup+0x308): undefined reference to `google::SetUsageMessage(std::string const&)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `cv::imread(std::string const&, int)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.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&)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `leveldb::Status::ToString() const'
collect2: error: ld returned 1 exit status
Makefile:623: recipe for target '/home/datascience/caffe/.build_release/tools/convert_imageset.bin' failed
make: *** [/home/datascience/caffe/.build_release/tools/convert_imageset.bin] Error 1
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `cv::imread(std::string const&, int)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.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&)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `leveldb::Status::ToString() const'
collect2: error: ld returned 1 exit status
Makefile:623: recipe for target '/home/datascience/caffe/.build_release/tools/upgrade_net_proto_binary.bin' failed
make: *** [/home/datascience/caffe/.build_release/tools/upgrade_net_proto_binary.bin] Error 1
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `cv::imread(std::string const&, int)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.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&)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `leveldb::Status::ToString() const'
collect2: error: ld returned 1 exit status
Makefile:628: recipe for target '/home/datascience/caffe/.build_release/examples/cifar10/convert_cifar_data.bin' failed
make: *** [/home/datascience/caffe/.build_release/examples/cifar10/convert_cifar_data.bin] Error 1
/home/datascience/caffe/.build_release/examples/siamese/convert_mnist_siamese_data.o: In function `convert_dataset(char const*, char const*, char const*)':
convert_mnist_siamese_data.cpp:(.text+0x476): undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
/home/datascience/caffe/.build_release/examples/siamese/convert_mnist_siamese_data.o: In function `std::string* google::MakeCheckOpString<unsigned int, int>(unsigned int const&, int const&, char const*)':
convert_mnist_siamese_data.cpp:(.text._ZN6google17MakeCheckOpStringIjiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIjiEEPSsRKT_RKT0_PKc]+0x43): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
/home/datascience/caffe/.build_release/examples/siamese/convert_mnist_siamese_data.o: In function `std::string* google::MakeCheckOpString<unsigned int, unsigned int>(unsigned int const&, unsigned int const&, char const*)':
convert_mnist_siamese_data.cpp:(.text._ZN6google17MakeCheckOpStringIjjEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIjjEEPSsRKT_RKT0_PKc]+0x43): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `cv::imread(std::string const&, int)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.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&)'
/home/datascience/caffe/.build_release/lib/libcaffe-nv.so: undefined reference to `leveldb::Status::ToString() const'
collect2: error: ld returned 1 exit status
Makefile:628: recipe for target '/home/datascience/caffe/.build_release/examples/siamese/convert_mnist_siamese_data.bin' failed
make: *** [/home/datascience/caffe/.build_release/examples/siamese/convert_mnist_siamese_data.bin] Error 1
Makefile.config

Loïc Dagnas

unread,
Dec 26, 2015, 6:13:40 PM12/26/15
to Caffe Users
Hello,
Do you find any solution?
I think I am facing the exact same problem with the same Ubuntu distribution.
It would help me a lot.


Thanks

Loïc

Mladen Fernežir

unread,
Dec 26, 2015, 7:20:02 PM12/26/15
to Caffe Users
Hi!

Yes, I have it working on Ubuntu 15.10. There is a bug in the current 0.14 branch that makes Caffe incompatible with cuDNN 3. I got around it by compiling a slightly earlier 0.14 version that I had downloaded just a day before they made those changes. I'm not sure what was my issue with the BVLC version.

Another tweak that I used specifically for Ubuntu 15.10 was the manual config.h hack to allow the usage of gcc 5 compiler for CUDA as suggested in one of the answers in this group.

For your situation, 0.14 version is meant to be used with CuDNN 4 which has been reacently released. You could try that option. I'm planning that switch in the next few days to see how it compares to my current setup.

Loïc Dagnas

unread,
Dec 27, 2015, 4:37:57 AM12/27/15
to Caffe Users
Hi,
Thanks a lot for you very quick and helpful answer.

I am using CuDNN4 and I compiled CUDA with gcc-5 as you suggested but I am now facing a new error,
would you have an idea on it:

[ 88%] Building CXX object tools/CMakeFiles/caffe.bin.dir/caffe.cpp.o
Linking CXX executable caffe
/usr/bin/ld: CMakeFiles/caffe.bin.dir/caffe.cpp.o: undefined reference to symbol '_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEPKc@@GLIBCXX_3.4.21'
/usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
collect2
: error: ld returned 1 exit status
tools
/CMakeFiles/caffe.bin.dir/build.make:120: recipe for target 'tools/caffe' failed
make
[2]: *** [tools/caffe] Error 1
CMakeFiles/Makefile2:406: recipe for target 'tools/CMakeFiles/caffe.bin.dir/all' failed
make
[1]: *** [tools/CMakeFiles/caffe.bin.dir/all] Error 2
Makefile:116: recipe for target 'all' failed
make
: *** [all] Error 2


Thanks again

Loïc

Mladen Fernežir

unread,
Dec 27, 2015, 6:40:14 AM12/27/15
to Caffe Users
Not sure what's that about since I haven't yet tried it with cuDNN 4.

Another option you could try is to use
git clone https://github.com/NVIDIA/caffe.git
cd caffe
git checkout v0.14.0-rc.1

That's the version that's working for me with cuDNN 3.

Jan C Peters

unread,
Jan 14, 2016, 9:28:48 AM1/14/16
to Caffe Users
That error is probably due to gcc-5's incompatibility to gcc-4 generated code. Ofiicially CUDA 7.5 only supports gcc up to 4.9. There is the hack Mladen mentioned to make it not complain about the version, but this probably only causes trouble later on. Such as the trouble Loic is having. This has nothing to do with cuDNN per se. The recommended solution would be to explicitly use gcc-4.9 until 5.x gets officially supported. Yes, I am also a bit impatient, but the trouble is just not worth it.

Jan

Soumak Mookherjee

unread,
Jan 26, 2016, 2:29:30 AM1/26/16
to Caffe Users
I am in the same boat. Can't install Caffe in ubuntu 15.10. Let me know  if you found a solution.
Message has been deleted

Shen Yun-Jun

unread,
Mar 19, 2016, 5:04:43 AM3/19/16
to Caffe Users
I faced a similar problem yesterday. I use CMake to compile caffe and the configuration is done by cmake-gui (a gui tool for cmake). After several attempts, I found compiling caffe with gcc-5.2 will not cause any google::base related linking problem. As CUDA-7.5 doesn't support any compilers higher than gcc-4.9, I set CUDA_HOST_COMPILER to /usr/bin/gcc-4.9. Under this setting, I completed the compiling with no error. 

Bart Römgens

unread,
Apr 6, 2016, 6:16:20 AM4/6/16
to Caffe Users
Here are the full installation instructions for Caffe on Ubuntu 15.10: https://gist.github.com/wangruohui/679b05fcd1466bb0937f#file-caffe-ubuntu-15-10-md

Worked for me without any issues.
Reply all
Reply to author
Forward
0 new messages