caffe build on ubuntu 15.10

13,197 views
Skip to first unread message

Алексей Филимонов

unread,
Oct 27, 2015, 9:57:03 AM10/27/15
to Caffe Users
CXX/LD -o .build_release/tools/extract_features.bin
CXX/LD -o .build_release/tools/compute_image_mean.bin
CXX/LD -o .build_release/tools/test_net.bin
CXX/LD -o .build_release/tools/caffe.bin
CXX/LD -o .build_release/tools/device_query.bin
CXX/LD -o .build_release/tools/convert_imageset.bin
.build_release/tools/extract_features.o: In function `caffe::db::LevelDBTransaction::Commit()':
extract_features.cpp:(.text._ZN5caffe2db18LevelDBTransaction6CommitEv[_ZN5caffe2db18LevelDBTransaction6CommitEv]+0x71): undefined reference to `leveldb::Status::ToString() const'
.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]+0x50): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.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]+0x50): 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]+0x51): 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]+0xca4): undefined reference to `google::protobuf::internal::empty_string_'
extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0x105e): undefined reference to `google::protobuf::MessageLite::SerializeToString(std::string*) const'
extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0x2081): undefined reference to `leveldb::Status::ToString() 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::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::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 `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 `google::protobuf::internal::WireFormatLite::WriteString(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
collect2: error: ld returned 1 exit status
Makefile:596: recipe for target '.build_release/tools/extract_features.bin' failed
make: *** [.build_release/tools/extract_features.bin] Error 1
.build_release/tools/compute_image_mean.o: Inmake: *** Waiting for unfinished jobs....
 function `std::string* google::MakeCheckOpString<int, int>(int const&, int const&, char const*)':
compute_image_mean.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc]+0x50): 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]+0x50): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/tools/compute_image_mean.o: In function `main':
compute_image_mean.cpp:(.text.startup+0x148): undefined reference to `google::SetUsageMessage(std::string const&)'
compute_image_mean.cpp:(.text.startup+0x281): undefined reference to `google::protobuf::MessageLite::ParseFromString(std::string const&)'
compute_image_mean.cpp:(.text.startup+0x471): 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::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::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::empty_string_'
.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 `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
Makefile:596: recipe for target '.build_release/tools/compute_image_mean.bin' failed
make: *** [.build_release/tools/compute_image_mean.bin] Error 1
.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]+0x50): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/tools/caffe.o: In function `std::string* google::MakeCheckOpString<unsigned long, int>(unsigned long const&, int const&, char const*)':
caffe.cpp:(.text._ZN6google17MakeCheckOpStringImiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringImiEEPSsRKT_RKT0_PKc]+0x50): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/tools/caffe.o: In function `main':
caffe.cpp:(.text.startup+0x50): undefined reference to `google::SetUsageMessage(std::string const&)'
.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]+0x56): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.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::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::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::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 `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 `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
Makefile:596: recipe for target '.build_release/tools/caffe.bin' failed
make: *** [.build_release/tools/caffe.bin] Error 1
.build_release/tools/convert_imageset.o: In function `caffe::db::LevelDBTransaction::Commit()':
convert_imageset.cpp:(.text._ZN5caffe2db18LevelDBTransaction6CommitEv[_ZN5caffe2db18LevelDBTransaction6CommitEv]+0x71): undefined reference to `leveldb::Status::ToString() const'
.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]+0x50): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/tools/convert_imageset.o: In function `main':
convert_imageset.cpp:(.text.startup+0x31d): undefined reference to `google::SetUsageMessage(std::string const&)'
convert_imageset.cpp:(.text.startup+0x959): undefined reference to `google::protobuf::MessageLite::SerializeToString(std::string*) const'
convert_imageset.cpp:(.text.startup+0x107e): undefined reference to `leveldb::Status::ToString() 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::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::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 `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 `google::protobuf::internal::WireFormatLite::WriteString(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
collect2: error: ld returned 1 exit status
Makefile:596: recipe for target '.build_release/tools/convert_imageset.bin' failed
make: *** [.build_release/tools/convert_imageset.bin] Error 1

I install all dependencies and make pycaffe ok, but make all have some errors. I used gcc-4.9 because gcc-5.1 dont supported nvcc.

Jan C Peters

unread,
Oct 27, 2015, 10:16:33 AM10/27/15
to Caffe Users
The error messages indicate that the problem is related to the protobuf lib dependency, i. e. it seems libprotobuf.so is not pulled in for some reason. You sure you installed libprotobuf-dev ?

However, you also cannot expect everything to work out-of-the-box on a new distro release that is only a few days old.

Алексей Филимонов

unread,
Oct 27, 2015, 10:32:56 AM10/27/15
to Caffe Users
Yes, i am sure that install libprotobuf-dev, i try install another version, but it doesn`t work.

Алексей Филимонов

unread,
Oct 27, 2015, 10:34:44 AM10/27/15
to Caffe Users
Yeah, you are right, but i will hope, that it will work, but i was wrong.

Jan C Peters

unread,
Oct 27, 2015, 10:50:54 AM10/27/15
to Caffe Users
Well if you want to go deeper, the first step for me would be to run ldd on the caffe lib, e. g. ldd .build_release/lib/libcaffe.so, which gies you the libraries caffe depends on. libprotobuf.so should be listed there (quick check with ldd .build_release/lib/libcaffe.so | grep protobuf; if it doesn't output anything, libprotobuf is not in the list).

Алексей Филимонов

unread,
Oct 27, 2015, 11:07:06 AM10/27/15
to Caffe Users
alexey@alexey-des:~/caffe$ sudo ldd .build_release/lib/libcaffe.so | grep protobuf
    libprotobuf.so.9 => /usr/lib/x86_64-linux-gnu/libprotobuf.so.9 (0x00007f060397d000)
 
libcaffe.so has reference for libprotobuf.

Алексей Филимонов

unread,
Oct 27, 2015, 11:18:49 AM10/27/15
to Caffe Users
but, references of next libs didn`t found.
    libcudart.so.7.0 => not found
    libcublas.so.7.0 => not found
    libcurand.so.7.0 => not found
    libcudnn.so.7.0 => not found

Jan C Peters

unread,
Oct 27, 2015, 11:44:29 AM10/27/15
to Caffe Users
The CUDA libs are not found because ld does not know about them, but they should exist in /usr/local/cuda-7.0/lib64. There are essentially two ways to inform ld about these libs, either setting LD_LIBRARY_PATH or adding a very short config file to /etc/ld.so.conf.d, both of which are explained here: http://askubuntu.com/questions/210884/setting-ld-library-path-for-cuda.

But that libprotobuf is actually in the list and the linker can't find these references puzzles me.

After having a closer look at the outputs, it is not only protobuf that is having problems, but also leveldb and opencv. Maybe it has something to do with the compiler you are using. You can try to use the standard gcc (5.1) and see if those errors still arise. To shut CUDA up about the compiler version you can edit /usr/local/cuda-7.0/include/host_config.h. Somewhere around line 104 there should be the GNUC version check. Just remove that #if ... #endif block altogether or change the checked version numbers so that 5.1 gets accepted. This is kind of a dirty hack, but it shouldn't be a problem (have done it myself).

Алексей Филимонов

unread,
Oct 28, 2015, 5:44:50 AM10/28/15
to Caffe Users
I tried this method(change for gcc 5.1), but it didn't help for this problem, i had some errors for build .cu files.
For example errors.

/usr/include/c++/5/bits/locale_classes.tcc:271:23: error: template argument required for ‘class collate_byname’
/usr/include/c++/5/bits/locale_classes.tcc:273:23: error: ‘collate’ is not a template function
/usr/include/c++/5/bits/locale_classes.tcc:273:30: error: expected ‘;’ before ‘<’ token
/usr/include/c++/5/bits/locale_classes.tcc:277:22: error: parse error in template argument list
/usr/include/c++/5/bits/locale_classes.tcc:277:22: error: template-id ‘has_facet<<expression error> >’ for ‘bool std::has_facet(const std::locale&)’ does not match any template declaration
/usr/include/c++/5/bits/locale_classes.tcc:282:23: error: ‘collate’ is not a class template
   extern template class collate<wchar_t>;
                       ^
/usr/include/c++/5/bits/locale_classes.tcc:282:23: error: template argument required for ‘class collate’
/usr/include/c++/5/bits/locale_classes.tcc:283:23: error: ‘collate_byname’ is not a class template
   extern template class collate_byname<wchar_t>;
                       ^
/usr/include/c++/5/bits/locale_classes.tcc:283:23: error: template argument required for ‘class collate_byname’
/usr/include/c++/5/bits/locale_classes.tcc:285:23: error: ‘collate’ is not a template function
/usr/include/c++/5/bits/locale_classes.tcc:285:30: error: expected ‘;’ before ‘<’ token
/usr/include/c++/5/bits/locale_classes.tcc:289:22: error: parse error in template argument list
/usr/include/c++/5/bits/locale_classes.tcc:289:22: error: template-id ‘has_facet<<expression error> >’ for ‘bool std::has_facet(const std::locale&)’ does not match any template declaration
Makefile:565: recipe for target '.build_release/cuda/src/caffe/util/math_functions.o' failed
make: *** [.build_release/cuda/src/caffe/util/math_functions.o] Error 1


Do you have any advises for solution of this problem?

Jan C Peters

unread,
Oct 28, 2015, 6:05:16 AM10/28/15
to Caffe Users
That may have something to do with the c++ standard that is used for compilation but I am entirely unsure about that. And sadly I don't have time to try and reproduce these errors. You will probably have to wait for the devs to fix that. But my guess is that they will probably only add support for the next LTS version of ubuntu (which would be 16.04), at least the only ubuntu versions they mention on the installation page (http://caffe.berkeleyvision.org/installation.html) as "tested on" are LTS versions.


Anyway, I just found this GitHub issue (https://github.com/BVLC/caffe/issues/2347) which may by chance be related to your problem, at least these guys seem to have gotten it to compile on ubuntu 15.04. Maybe that works for you too?

Алексей Филимонов

unread,
Oct 28, 2015, 6:07:05 AM10/28/15
to Caffe Users
If i disable support CUDA(only CPU), caffe will build "make all" fine, 0 errors. May be this comment help you for understand my problem.

Алексей Филимонов

unread,
Oct 28, 2015, 6:12:25 AM10/28/15
to Caffe Users
Ok, thank you for advices, i will try it, may be it help me.

Darren Garvey

unread,
Oct 28, 2015, 6:13:10 AM10/28/15
to Алексей Филимонов, Caffe Users

Are you setting CUDA_HOST_COMPILER? I hacked around this issue last night and got caffe linking on Ubuntu 15.10.

The issue with linking to protobuf is down to c++ ABI changes between GCC 4.9 and GCC 5.x. The ABI for std::string has changed so you need to be sure to link with compatible libraries.

Since CUDA doesn't officially support GCC >= 4.9, I had initially set CUDA_HOST_COMPILER to get CUDA stuff compiled. The issue with doing just that is that caffe will build with the default GCC which is 5.2.

If you go ahead and build caffe with GCC 4.9 as well then you'll have link problems against the libprotobuf-dev package which is built with GCC 5.x as with all other Ubuntu packages in 15.10.

What I ended up doing is just hacking the header in CUDA that claims CUDA can't be built with GCC 5.x. I think it was host_config.h or something similar (don't have it here, sorry). Hacking that to make the version check accept GCC 5.2 made the problem go away and I've not had any issues with CUDA. I'm guessing it's just a defensive check, but YMMV!

The alternative meant too much building IMO so I went with a hack. You may want to build everything with GCC 4.9 but you'll also have to build protobuf and possibly also all other system packages that export c++ functions containing std::string, std::vector, etc.with GCC 4.9 (eg. glog, gflags, boost?).

It would be better if nvidia just updated CUDA to support GCC 5.x (I was using the latest 7.5 version btw). I've not checked yet if there's a ticket for that open.

I have one more outstanding issue with liblzma linking but that's related to using anaconda. I only mention it for posterity.

Hope that helps.

Cheers,
Darren

--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/42d8dbb9-109f-4bf3-90b6-d041a6947e18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jan C Peters

unread,
Oct 28, 2015, 6:20:04 AM10/28/15
to Caffe Users, aleksey....@singularis-lab.com
Well, I got caffe to compile with gcc 5.x (on Fedora) and CUDA 7.5, so maybe just try to use CUDA 7.5 instead of 7.0, at least there is a chance that this solves your problem (without reverting to a gcc 4.x version)

Алексей Филимонов

unread,
Oct 28, 2015, 10:41:15 AM10/28/15
to Caffe Users
I install  cuda 7.5 and caffe build with gcc 5, but need to comments strings about errors in cuda config.h

thanks for that advice, but i don't work with caffe after that, may be it is solution doesn't work.

Jonathan Chappelow

unread,
Oct 29, 2015, 8:02:51 PM10/29/15
to Caffe Users, aleksey....@singularis-lab.com
That hack is what the Arch Linux package has done.  The comment still says to support 4.9, but that is a relic from when the SDK didn't support 4.9.  :)

Darren Garvey

unread,
Oct 29, 2015, 9:22:46 PM10/29/15
to Jonathan Chappelow, Caffe Users, Алексей Филимонов
On 30 October 2015 at 00:02, Jonathan Chappelow <jonathan....@gmail.com> wrote:
That hack is what the Arch Linux package has done.  The comment still says to support 4.9, but that is a relic from when the SDK didn't support 4.9.  :)

Hehe, I see they've just blotted out the error entirely. Nothing to see here... *whistles* I just changed line 113 in /usr/local/cuda/include/host_config.h to this:

#if __GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 2)

.. perhaps *slighly* more good-citizeny? ;)

Perhaps NVIDIA should just make this check issue a warning rather than a hard error and make their lives a bit easier.

I hope you got it working at least Aleksey as I've not had any further issues (so far).

Cheers,
Darren

Julie Bernauer

unread,
Nov 21, 2015, 2:14:31 AM11/21/15
to Caffe Users, jonathan....@gmail.com, aleksey....@singularis-lab.com
With no other change there will be issues with protobuf and other libs because of the C++ ABI change. One way to overcome this is to force GCC to use the old ABI version by using the flag -D_GLIBCXX_USE_CXX11_ABI=0 in the Makefile. While maybe not the best ideal way to do it, a change at line 245 in the Makefile works.

Locke Lee

unread,
Dec 15, 2015, 4:24:36 AM12/15/15
to Caffe Users, jonathan....@gmail.com, aleksey....@singularis-lab.com
Hi, may i keep asking you a question? i can use cuda, but i can't compile caffe, i have try a lot of ways to reduce error, and now i got this error that i have nothing to do with:

CXX src/caffe/net.cpp
PROTOC src/caffe/proto/caffe.proto
...fine...
CXX tools/net_speed_benchmark.cpp
CXX examples/mnist/convert_mnist_data.cpp
CXX examples/cifar10/convert_cifar_data.cpp
CXX examples/cpp_classification/classification.cpp
CXX examples/siamese/convert_mnist_siamese_data.cpp
CXX .build_release/src/caffe/proto/caffe.pb.cc
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so
CXX/LD -o .build_release/tools/test_net.bin
CXX/LD -o .build_release/tools/upgrade_solver_proto_text.bin
CXX/LD -o .build_release/tools/extract_features.bin
.build_release/tools/extract_features.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >* google::MakeCheckOpString<int, int>(int const&, int const&, char const*)':
extract_features.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x50): undefined reference to `google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()'
.build_release/tools/extract_features.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >* google::MakeCheckOpString<unsigned long, unsigned long>(unsigned long const&, unsigned long const&, char const*)':
extract_features.cpp:(.text._ZN6google17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN6google17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x51): undefined reference to `google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()'

collect2: error: ld returned 1 exit status
Makefile:598: recipe for target '.build_release/tools/extract_features.bin' failed

make: *** [.build_release/tools/extract_features.bin] Error 1
make: *** Waiting for unfinished jobs....
.build_release/lib/libcaffe.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()'

collect2: error: ld returned 1 exit status
Makefile:598: recipe for target '.build_release/tools/upgrade_solver_proto_text.bin' failed
make: *** [.build_release/tools/upgrade_solver_proto_text.bin] Error 1
---when--
CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=1
*****************************************************************************************
CXX examples/siamese/convert_mnist_siamese_data.cpp
CXX .build_release/src/caffe/proto/caffe.pb.cc
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so
CXX/LD -o .build_release/tools/test_net.bin
CXX/LD -o .build_release/tools/upgrade_solver_proto_text.bin
CXX/LD -o .build_release/tools/extract_features.bin

.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::protobuf::internal::StringTypeHandlerBase::Delete(std::string*)'
.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::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::Message::DebugString() const'
.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::StringTypeHandlerBase::New()'
.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::empty_string_'
.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::WriteString(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::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::Message::InitializationErrorString() const'

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

make: *** Waiting for unfinished jobs....
.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]+0xc80): undefined reference to `google::protobuf::internal::empty_string_'
extract_features.cpp:(.text._Z27feature_extraction_pipelineIfEiiPPc[_Z27feature_extraction_pipelineIfEiiPPc]+0x1313): undefined reference to `google::protobuf::MessageLite::SerializeToString(std::string*) 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
---when--
CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0
************************************************************************************

------------------------------------------------
My environment is:
  `Ubuntu 15.10 64bit mate
  `intel MKL
  `Cuda 7.5
  `g++/gcc 5.2.1
i had changed the host_config.h in cuda-7.5/include
you said the problem is about c++ ABI, i tried both methods but still failed. could you help? Thanks!



------------------------------------------------


在 2015年11月21日星期六 UTC+8下午3:14:31,Julie Bernauer写道:

rswt...@gmail.com

unread,
Jan 9, 2016, 2:27:44 AM1/9/16
to Caffe Users
Have you solved this problem ? I have been solving this problem for a long time, but failed!

在 2015年10月27日星期二 UTC+8下午9:57:03,Алексей Филимонов写道:

Khoi Tran

unread,
Feb 13, 2016, 11:24:26 AM2/13/16
to Caffe Users
Hi all,

Thanks for the thread.  I just install 15.10 and this saved me from a lot of troubles.
With the latest version 15.10.1, only hacking CUDA is not enough. The error is because google-glog got built with -D_GLIBCXX_USE_CXX11_ABI=0 while everything else use the default option!
This is also the cause of the error that Locke Lee have shown.

I have made a full guide, (feel free to correct my English :D)

///////////////////////////////////////////////////////
1. HACK CUDA
+As all other packages in ubuntu 15.10 is built with GCC 5(.2) but CUDA (7.5) not allow >4.9 gcc version!
+We would like to "hack" CUDA to compile cuda files with gcc-5 as follows:

a) sudo gedit /usr/local/cuda/include/host_config.h

b) change line 113 to #if __GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 2)

///////////////////////////////////////////////////////
2. FIX google-glog
+Some bad guys build google-glog with wrong gcc abi config! And the wrong build is in
the official repository. Fack!
+i.e when all other package is built with -D_GLIBCXX_USE_CXX11_ABI=1 (default). They built it with
-D_GLIBCXX_USE_CXX11_ABI=0! We need to built it ourself!

a)
sudo apt-get remove libgoogle-glog-dev libgoogle-glog0v5
cd ~ //other folder is ok
apt-get source libgoogle-glog-dev
cd google-glog-0.3.4
./configure

b) The generated makefile have some mistakes (?)
- change line 613 to ACLOCAL=aclocal-1.15
- change line 619 to AUTOMAKE=automake-1.15

c)
make // this will have some errors, dont worry
automake --add-missing
make -j 16 //or 100,whatever
sudo make install

//////////////////////////////////////////////////////////
Now we can build caffe! Profit!

Attilio Porchia

unread,
Jun 30, 2016, 7:44:17 AM6/30/16
to Caffe Users
Thanks for waste time for a useless answer...

djeb mtwo

unread,
Aug 26, 2016, 8:52:04 PM8/26/16
to Caffe Users
Anyone managed to solve this ?

Thank you.

Jurgen Meijer

unread,
Sep 17, 2016, 11:27:22 PM9/17/16
to Caffe Users
Got passed this by building glog manually as described by Giorno Sabato. I've fixed many compiler errors such as this today, currently working on a 16.04 system where I had to link allot of packages manually and build some from source, downgrade etc (GCC 5.4 to 4.9 for example to build CUDA 8)..

Charles Shang

unread,
Sep 20, 2016, 10:21:06 AM9/20/16
to Caffe Users
Using "apt remove lib[glog | gflags | protobuf]-dev" to remove any error-related libs, then building them from source solved my problems! 
p.s. dont forget to run "rm -rf * " to  remove the old builds. 
I think the 16.04 version default libs is not compatible with caffe, so you need to re-install them. 

在 2015年10月27日星期二 UTC+8下午9:57:03,Алексей Филимонов写道:
CXX/LD -o .build_release/tools/extract_features.bin

Bassel Safwat

unread,
Mar 19, 2017, 4:43:04 PM3/19/17
to Caffe Users
I am following these steps but now I gets an error in "automake --add-missing". 
configure.ac:13: error: version mismatch.  This is Automake 1.15,
configure.ac:13: but the definition used by this AM_INIT_AUTOMAKE
configure.ac:13: comes from Automake 1.14.1.  You should recreate
configure.ac:13: aclocal.m4 with aclocal and run automake again.

I tried to continue to the next step "make -j8" and I get error:
src/logging_unittest-logging_unittest.o: In function `__static_initialization_and_destruction_0(int, int)':
logging_unittest.cc:(.text+0xf082): undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
logging_unittest.cc:(.text+0xf145): undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
logging_unittest.cc:(.text+0xf1c2): undefined reference to `google::FlagRegisterer::FlagRegisterer<bool>(char const*, char const*, char const*, bool*, bool*)'
logging_unittest.cc:(.text+0xf1f7): undefined reference to `google::FlagRegisterer::FlagRegisterer<int>(char mv -f src/.deps/stacktrace_unittest-stacktrace_unittest.Tpo src/.deps/stacktrace_unittest-stacktrace_unittest.Po
const*, char const*, char const*, int*, int*)'
collect2: error: ld returned 1 exit status
Makefile:1079: recipe for target 'logging_unittest' failed
make: *** [logging_unittest] Error 1

Dennis Mungai

unread,
Mar 20, 2017, 7:06:56 PM3/20/17
to Bassel Safwat, Caffe Users
Do you have protobuf and its' developer packages installed?

--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users+unsubscribe@googlegroups.com.

To post to this group, send email to caffe...@googlegroups.com.

Dennis Mungai

unread,
Mar 20, 2017, 7:07:46 PM3/20/17
to Bassel Safwat, Caffe Users
And at the automake part, simply run:

autoreconf -ivf

To fix the error you encounter at that stage.

Dennis Mungai

unread,
Mar 20, 2017, 7:08:57 PM3/20/17
to Bassel Safwat, Caffe Users
And after installing (or compiling) protobuf packages, remember to run:

ldconfig

As sudo to reload your libraries into the environment, then proceed to compile caffe.

Bassel Safwat

unread,
Mar 22, 2017, 12:26:05 PM3/22/17
to Caffe Users, kaspa...@gmail.com
I have the protobuf installed, I didn't run ldconfig by that time. I tried to run it now and re-make the caffe but it still fails with the same error (underfine)
I also  the autoreconf -ivf didnt fix the issue, it gives me the following output: 

autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: running: /usr/bin/autoconf --force
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:19: installing './compile'
configure.ac:13: installing './missing'
Makefile.am: installing './depcomp'
autoreconf: Leaving directory `.'

but when i check the specified lines (613) in the makefile, this is moved into 623 and 629 
ACLOCAL = ${SHELL} /home/bassel/basselTMP/glog-0.3.4/missing aclocal-1.15
AUTOMAKE = ${SHELL} /home/bassel/basselTMP/glog-0.3.4/missing automake-1.15

and when runnig the make command, I get the following error: 

/bin/bash ./config.status --recheck
running CONFIG_SHELL=/bin/bash /bin/bash ./configure --no-create --no-recursion
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... no
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for ANSI C header files... (cached) no
checking for stdint.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for unistd.h... (cached) yes
checking syscall.h usability... yes
checking syscall.h presence... yes
checking for syscall.h... yes
checking sys/syscall.h usability... yes
checking sys/syscall.h presence... yes
checking for sys/syscall.h... yes
checking execinfo.h usability... yes
checking execinfo.h presence... yes
checking for execinfo.h... yes
checking libunwind.h usability... no
checking libunwind.h presence... no
checking for libunwind.h... no
checking ucontext.h usability... yes
checking ucontext.h presence... yes
checking for ucontext.h... yes
checking sys/utsname.h usability... yes
checking sys/utsname.h presence... yes
checking for sys/utsname.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking glob.h usability... yes
checking glob.h presence... yes
checking for glob.h... yes
checking unwind.h usability... yes
checking unwind.h presence... yes
checking for unwind.h... yes
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
checking size of void *... 8
checking for uint16_t... yes
checking for u_int16_t... yes
checking for __uint16... no
checking for sigaltstack... yes
checking for sigaction... yes
checking for dladdr... no
checking for fcntl... yes
checking for pread... yes
checking for pwrite... yes
checking for __attribute__... yes
checking for __builtin_expect... yes
checking for __sync_val_compare_and_swap... yes
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking whether to check for GCC pthread/shared inconsistencies... yes
checking whether -pthread is sufficient with -shared... yes
checking for pthread_self in -lpthread... yes
checking for main in -lgflags... yes
checking for gtest-config... no
checking for main in -lgtest... no
checking support for pthread_rwlock_* functions... yes
checking whether the compiler implements namespaces... yes
checking what namespace STL code is in... std
checking whether compiler supports using ::operator<<... 1
checking for ucontext.h... (cached) yes
checking sys/ucontext.h usability... yes
checking sys/ucontext.h presence... yes
checking for sys/ucontext.h... yes
checking how to access the program counter from a struct ucontext... uc_mcontext.gregs[REG_RIP]
checking that generated files are newer than configure... done
configure: creating ./config.status
 /bin/bash ./config.status
config.status: creating Makefile
config.status: creating src/glog/logging.h
config.status: creating src/glog/raw_logging.h
config.status: creating src/glog/vlog_is_on.h
config.status: creating src/glog/stl_logging.h
config.status: creating libglog.pc
config.status: creating src/config.h
config.status: src/config.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I./src  -I./src     -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare  -DNO_FRAME_POINTER  -DNDEBUG -g -O2 -MT src/libglog_la-logging.lo -MD -MP -MF src/.deps/libglog_la-logging.Tpo -c -o src/libglog_la-logging.lo `test -f 'src/logging.cc' || echo './'`src/logging.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./src -I./src -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 -MT src/libglog_la-logging.lo -MD -MP -MF src/.deps/libglog_la-logging.Tpo -c src/logging.cc  -fPIC -DPIC -o src/.libs/libglog_la-logging.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./src -I./src -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 -MT src/libglog_la-logging.lo -MD -MP -MF src/.deps/libglog_la-logging.Tpo -c src/logging.cc -o src/libglog_la-logging.o >/dev/null 2>&1
mv -f src/.deps/libglog_la-logging.Tpo src/.deps/libglog_la-logging.Plo
/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I./src  -I./src     -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare  -DNO_FRAME_POINTER  -DNDEBUG -g -O2 -MT src/libglog_la-raw_logging.lo -MD -MP -MF src/.deps/libglog_la-raw_logging.Tpo -c -o src/libglog_la-raw_logging.lo `test -f 'src/raw_logging.cc' || echo './'`src/raw_logging.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./src -I./src -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 -MT src/libglog_la-raw_logging.lo -MD -MP -MF src/.deps/libglog_la-raw_logging.Tpo -c src/raw_logging.cc  -fPIC -DPIC -o src/.libs/libglog_la-raw_logging.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./src -I./src -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 -MT src/libglog_la-raw_logging.lo -MD -MP -MF src/.deps/libglog_la-raw_logging.Tpo -c src/raw_logging.cc -o src/libglog_la-raw_logging.o >/dev/null 2>&1
mv -f src/.deps/libglog_la-raw_logging.Tpo src/.deps/libglog_la-raw_logging.Plo
/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I./src  -I./src     -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare  -DNO_FRAME_POINTER  -DNDEBUG -g -O2 -MT src/libglog_la-vlog_is_on.lo -MD -MP -MF src/.deps/libglog_la-vlog_is_on.Tpo -c -o src/libglog_la-vlog_is_on.lo `test -f 'src/vlog_is_on.cc' || echo './'`src/vlog_is_on.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./src -I./src -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 -MT src/libglog_la-vlog_is_on.lo -MD -MP -MF src/.deps/libglog_la-vlog_is_on.Tpo -c src/vlog_is_on.cc  -fPIC -DPIC -o src/.libs/libglog_la-vlog_is_on.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./src -I./src -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 -MT src/libglog_la-vlog_is_on.lo -MD -MP -MF src/.deps/libglog_la-vlog_is_on.Tpo -c src/vlog_is_on.cc -o src/libglog_la-vlog_is_on.o >/dev/null 2>&1
mv -f src/.deps/libglog_la-vlog_is_on.Tpo src/.deps/libglog_la-vlog_is_on.Plo
/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I./src  -I./src     -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare  -DNO_FRAME_POINTER  -DNDEBUG -g -O2 -MT src/libglog_la-utilities.lo -MD -MP -MF src/.deps/libglog_la-utilities.Tpo -c -o src/libglog_la-utilities.lo `test -f 'src/utilities.cc' || echo './'`src/utilities.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./src -I./src -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 -MT src/libglog_la-utilities.lo -MD -MP -MF src/.deps/libglog_la-utilities.Tpo -c src/utilities.cc  -fPIC -DPIC -o src/.libs/libglog_la-utilities.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./src -I./src -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 -MT src/libglog_la-utilities.lo -MD -MP -MF src/.deps/libglog_la-utilities.Tpo -c src/utilities.cc -o src/libglog_la-utilities.o >/dev/null 2>&1
mv -f src/.deps/libglog_la-utilities.Tpo src/.deps/libglog_la-utilities.Plo
/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I./src  -I./src     -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare  -DNO_FRAME_POINTER  -DNDEBUG -g -O2 -MT src/libglog_la-symbolize.lo -MD -MP -MF src/.deps/libglog_la-symbolize.Tpo -c -o src/libglog_la-symbolize.lo `test -f 'src/symbolize.cc' || echo './'`src/symbolize.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./src -I./src -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 -MT src/libglog_la-symbolize.lo -MD -MP -MF src/.deps/libglog_la-symbolize.Tpo -c src/symbolize.cc  -fPIC -DPIC -o src/.libs/libglog_la-symbolize.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./src -I./src -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 -MT src/libglog_la-symbolize.lo -MD -MP -MF src/.deps/libglog_la-symbolize.Tpo -c src/symbolize.cc -o src/libglog_la-symbolize.o >/dev/null 2>&1
mv -f src/.deps/libglog_la-symbolize.Tpo src/.deps/libglog_la-symbolize.Plo
/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I./src  -I./src     -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare  -DNO_FRAME_POINTER  -DNDEBUG -g -O2 -MT src/libglog_la-signalhandler.lo -MD -MP -MF src/.deps/libglog_la-signalhandler.Tpo -c -o src/libglog_la-signalhandler.lo `test -f 'src/signalhandler.cc' || echo './'`src/signalhandler.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./src -I./src -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 -MT src/libglog_la-signalhandler.lo -MD -MP -MF src/.deps/libglog_la-signalhandler.Tpo -c src/signalhandler.cc  -fPIC -DPIC -o src/.libs/libglog_la-signalhandler.o
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I./src -I./src -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -DNDEBUG -g -O2 -MT src/libglog_la-signalhandler.lo -MD -MP -MF src/.deps/libglog_la-signalhandler.Tpo -c src/signalhandler.cc -o src/libglog_la-signalhandler.o >/dev/null 2>&1
mv -f src/.deps/libglog_la-signalhandler.Tpo src/.deps/libglog_la-signalhandler.Plo
/bin/bash ./libtool  --tag=CXX   --mode=link g++    -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare  -DNO_FRAME_POINTER  -DNDEBUG -g -O2    -o libglog.la -rpath /usr/local/lib  src/libglog_la-logging.lo src/libglog_la-raw_logging.lo src/libglog_la-vlog_is_on.lo src/libglog_la-utilities.lo src/libglog_la-demangle.lo src/libglog_la-symbolize.lo src/libglog_la-signalhandler.lo   -lgflags  -lpthread 
libtool: link: rm -fr  .libs/libglog.a .libs/libglog.la .libs/libglog.lai .libs/libglog.so .libs/libglog.so.0 .libs/libglog.so.0.0.0
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbeginS.o  src/.libs/libglog_la-logging.o src/.libs/libglog_la-raw_logging.o src/.libs/libglog_la-vlog_is_on.o src/.libs/libglog_la-utilities.o src/.libs/libglog_la-demangle.o src/.libs/libglog_la-symbolize.o src/.libs/libglog_la-signalhandler.o   -lgflags -lpthread -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/5/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o  -g -O2   -Wl,-soname -Wl,libglog.so.0 -o .libs/libglog.so.0.0.0
libtool: link: (cd ".libs" && rm -f "libglog.so.0" && ln -s "libglog.so.0.0.0" "libglog.so.0")
libtool: link: (cd ".libs" && rm -f "libglog.so" && ln -s "libglog.so.0.0.0" "libglog.so")
libtool: link: ar cru .libs/libglog.a  src/libglog_la-logging.o src/libglog_la-raw_logging.o src/libglog_la-vlog_is_on.o src/libglog_la-utilities.o src/libglog_la-demangle.o src/libglog_la-symbolize.o src/libglog_la-signalhandler.o
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libglog.a
libtool: link: ( cd ".libs" && rm -f "libglog.la" && ln -s "../libglog.la" "libglog.la" )
g++ -DHAVE_CONFIG_H -I. -I./src  -I./src  -pthread     -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare  -DNO_FRAME_POINTER  -g -O2 -MT src/logging_unittest-logging_unittest.o -MD -MP -MF src/.deps/logging_unittest-logging_unittest.Tpo -c -o src/logging_unittest-logging_unittest.o `test -f 'src/logging_unittest.cc' || echo './'`src/logging_unittest.cc
In file included from src/utilities.h:82:0,
                 from src/logging_unittest.cc:33:
src/logging_unittest.cc: In function ‘void TestLogging(bool)’:
src/glog/logging.h:917:30: warning: typedef ‘INVALID_REQUESTED_LOG_SEVERITY’ locally defined but not used [-Wunused-local-typedefs]
                              INVALID_REQUESTED_LOG_SEVERITY);           \
                              ^
src/glog/logging.h:912:73: note: in definition of macro ‘GOOGLE_GLOG_COMPILE_ASSERT’
 pedef google::glog_internal_namespace_::CompileAssert<(bool(expr))> msg[bool(ex
                                                                     ^
src/logging_unittest.cc:254:5: note: in expansion of macro ‘LOG_EVERY_N’
     LOG_EVERY_N(ERROR, 4) << "Log every 4, iteration " << COUNTER << endl;
     ^
mv -f src/.deps/logging_unittest-logging_unittest.Tpo src/.deps/logging_unittest-logging_unittest.Po
/bin/bash ./libtool  --tag=CXX   --mode=link g++ -pthread     -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare  -DNO_FRAME_POINTER  -g -O2 -pthread  -o logging_unittest  src/logging_unittest-logging_unittest.o  libglog.la  -lgflags    -lgflags -lpthread 
libtool: link: g++ -pthread -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -g -O2 -pthread -o .libs/logging_unittest src/logging_unittest-logging_unittest.o  ./.libs/libglog.so -lgflags -lpthread -pthread
src/logging_unittest-logging_unittest.o: In function `__static_initialization_and_destruction_0':
/home/bassel/basselTMP/glog-0.3.4/src/googletest.h:93: undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
/home/bassel/basselTMP/glog-0.3.4/src/googletest.h:94: undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
/home/bassel/basselTMP/glog-0.3.4/src/googletest.h:96: undefined reference to `google::FlagRegisterer::FlagRegisterer<bool>(char const*, char const*, char const*, bool*, bool*)'
/home/bassel/basselTMP/glog-0.3.4/src/googletest.h:100: undefined reference to `google::FlagRegisterer::FlagRegisterer<int>(char const*, char const*, char const*, int*, int*)'
collect2: error: ld returned 1 exit status
Makefile:1090: recipe for target 'logging_unittest' failed
make: *** [logging_unittest] Error 1




On Tuesday, March 21, 
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users...@googlegroups.com.

To post to this group, send email to caffe...@googlegroups.com.

Dennis Mungai

unread,
Mar 23, 2017, 4:00:05 AM3/23/17
to Bassel Safwat, Caffe Users
Hello Bassel,

Clean up your sources, download caffe again and repeat the build, as above.

I want to see what point a fresh build on your host fails on.

To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users+unsubscribe@googlegroups.com.

To post to this group, send email to caffe...@googlegroups.com.

Bassel Safwat

unread,
Mar 25, 2017, 9:27:33 AM3/25/17
to Caffe Users, kaspa...@gmail.com
Doing this I could locate my issue! you made my day today :D

The issue I had is I was using anaconda for my environment, so in the makefile.config I used this one:

#PYTHON_LIB := /usr/lib
PYTHON_LIB := $(ANACONDA_HOME)/lib

so changing it back to

PYTHON_LIB := /usr/lib
#PYTHON_LIB := $(ANACONDA_HOME)/lib

solved the issue!

Note: I first ran into an issue:
/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5

but following this solution, adding the following lines fixed the issue and 'make all' succeeds now
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/aarch64-linux-gnu/hdf5/serial

anyway I am still wondering whynot using the python lib  as the anaconda lib path ?
<div class="m_-6945760320548374439sub
Reply all
Reply to author
Forward
0 new messages