After successfully building caffe with cmake.Problems about making matcaffe in root dir.

218 views
Skip to first unread message

Alan Teng

unread,
Aug 16, 2017, 12:38:43 AM8/16/17
to Caffe Users
config:

ubuntu 16.04
gcc g++ 5.4.0
protobuf 2.6.0 
cmake 3.5.1

Caffe has been built with cmake, but when I try to make matcaffe in the root dir (I'm not sure it's right ). Some probelms arise, I guess it is the path of protobuf causing those error. Does some one can help me out? 




I've upload some details.

AR -o .build_release/lib/libcaffe.a
MEX matlab/+caffe/private/caffe_.cpp
Building with 'g++'.
Warning: You are using gcc version '5.4.0'. The version of gcc is not supported. The version currently supported with MEX is '4.7.x'. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release.
Warning: You are using gcc version '5.4.0-6ubuntu1~16.04.4)'. The version of gcc is not supported. The version currently supported with MEX is '4.7.x'. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release.
.build_release/lib/libcaffe.a(sgd_solver.o): In function `std::string* google::MakeCheckOpString<cudaError, cudaError>(cudaError const&, cudaError const&, char const*)':
tmpxft_00002e29_00000000-4_sgd_solver.compute_61.cudafe1.cpp:(.text._ZN6google17MakeCheckOpStringI9cudaErrorS1_EEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringI9cudaErrorS1_EEPSsRKT_RKT0_PKc]+0x50): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/lib/libcaffe.a(math_functions.o): In function `std::string* google::MakeCheckOpString<cublasStatus_t, cublasStatus_t>(cublasStatus_t const&, cublasStatus_t const&, char const*)':
tmpxft_00002f12_00000000-4_math_functions.compute_61.cudafe1.cpp:(.text._ZN6google17MakeCheckOpStringI14cublasStatus_tS1_EEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringI14cublasStatus_tS1_EEPSsRKT_RKT0_PKc]+0x50): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/lib/libcaffe.a(math_functions.o): In function `std::string* google::MakeCheckOpString<curandStatus, curandStatus>(curandStatus const&, curandStatus const&, char const*)':
tmpxft_00002f12_00000000-4_math_functions.compute_61.cudafe1.cpp:(.text._ZN6google17MakeCheckOpStringI12curandStatusS1_EEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringI12curandStatusS1_EEPSsRKT_RKT0_PKc]+0x50): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/lib/libcaffe.a(euclidean_loss_layer.o): In function `std::string* google::MakeCheckOpString<int, int>(int const&, int const&, char const*)':
tmpxft_00003337_00000000-4_euclidean_loss_layer.compute_61.cudafe1.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc]+0x50): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/lib/libcaffe.a(cudnn_tanh_layer.o): In function `std::string* google::MakeCheckOpString<cudnnStatus_t, cudnnStatus_t>(cudnnStatus_t const&, cudnnStatus_t const&, char const*)':
tmpxft_0000377f_00000000-4_cudnn_tanh_layer.compute_61.cudafe1.cpp:(.text._ZN6google17MakeCheckOpStringI13cudnnStatus_tS1_EEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringI13cudnnStatus_tS1_EEPSsRKT_RKT0_PKc]+0x50): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/lib/libcaffe.a(base_data_layer.o): In function `caffe::BasePrefetchingDataLayer<float>::Forward_gpu(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&)':
tmpxft_00003d0b_00000000-4_base_data_layer.compute_61.cudafe1.cpp:(.text._ZN5caffe24BasePrefetchingDataLayerIfE11Forward_gpuERKSt6vectorIPNS_4BlobIfEESaIS5_EES9_[_ZN5caffe24BasePrefetchingDataLayerIfE11Forward_gpuERKSt6vectorIPNS_4BlobIfEESaIS5_EES9_]+0x5f): undefined reference to `caffe::BlockingQueue<caffe::Batch<float>*>::pop(std::string const&)'
.build_release/lib/libcaffe.a(base_data_layer.o): In function `caffe::BasePrefetchingDataLayer<double>::Forward_gpu(std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&, std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&)':
tmpxft_00003d0b_00000000-4_base_data_layer.compute_61.cudafe1.cpp:(.text._ZN5caffe24BasePrefetchingDataLayerIdE11Forward_gpuERKSt6vectorIPNS_4BlobIdEESaIS5_EES9_[_ZN5caffe24BasePrefetchingDataLayerIdE11Forward_gpuERKSt6vectorIPNS_4BlobIdEESaIS5_EES9_]+0x5f): undefined reference to `caffe::BlockingQueue<caffe::Batch<double>*>::pop(std::string const&)'
.build_release/lib/libcaffe.a(hdf5_output_layer.o): In function `std::string* google::MakeCheckOpString<unsigned long, int>(unsigned long const&, int const&, char const*)':
tmpxft_00004165_00000000-4_hdf5_output_layer.compute_61.cudafe1.cpp:(.text._ZN6google17MakeCheckOpStringImiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringImiEEPSsRKT_RKT0_PKc]+0x50): undefined reference to `google::base::CheckOpMessageBuilder::NewString()'
.build_release/lib/libcaffe.a(reduction_layer.o): In function `caffe::ReductionLayer<float>::Forward_gpu(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&)':
tmpxft_00004ba3_00000000-4_reduction_layer.compute_61.cudafe1.cpp:(.text._ZN5caffe14ReductionLayerIfE11Forward_gpuERKSt6vectorIPNS_4BlobIfEESaIS5_EES9_[_ZN5caffe14ReductionLayerIfE11Forward_gpuERKSt6vectorIPNS_4BlobIfEESaIS5_EES9_]+0xa4): undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
.build_release/lib/libcaffe.a(reduction_layer.o): In function `caffe::ReductionLayer<double>::Forward_gpu(std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&, std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&)':
tmpxft_00004ba3_00000000-4_reduction_layer.compute_61.cudafe1.cpp:(.text._ZN5caffe14ReductionLayerIdE11Forward_gpuERKSt6vectorIPNS_4BlobIdEESaIS5_EES9_[_ZN5caffe14ReductionLayerIdE11Forward_gpuERKSt6vectorIPNS_4BlobIdEESaIS5_EES9_]+0xa4): undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
.build_release/lib/libcaffe.a(reduction_layer.o): In function `caffe::ReductionLayer<float>::Backward_gpu(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<bool, std::allocator<bool> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&)':
tmpxft_00004ba3_00000000-4_reduction_layer.compute_61.cudafe1.cpp:(.text._ZN5caffe14ReductionLayerIfE12Backward_gpuERKSt6vectorIPNS_4BlobIfEESaIS5_EERKS2_IbSaIbEES9_[_ZN5caffe14ReductionLayerIfE12Backward_gpuERKSt6vectorIPNS_4BlobIfEESaIS5_EERKS2_IbSaIbEES9_]+0xbe): undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
tmpxft_00004ba3_00000000-4_reduction_layer.compute_61.cudafe1.cpp:(.text._ZN5caffe14ReductionLayerIfE12Backward_gpuERKSt6vectorIPNS_4BlobIfEESaIS5_EERKS2_IbSaIbEES9_[_ZN5caffe14ReductionLayerIfE12Backward_gpuERKSt6vectorIPNS_4BlobIfEESaIS5_EERKS2_IbSaIbEES9_]+0x191): undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
.build_release/lib/libcaffe.a(reduction_layer.o): In function `caffe::ReductionLayer<double>::Backward_gpu(std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&, std::vector<bool, std::allocator<bool> > const&, std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&)':
tmpxft_00004ba3_00000000-4_reduction_layer.compute_61.cudafe1.cpp:(.text._ZN5caffe14ReductionLayerIdE12Backward_gpuERKSt6vectorIPNS_4BlobIdEESaIS5_EERKS2_IbSaIbEES9_[_ZN5caffe14ReductionLayerIdE12Backward_gpuERKSt6vectorIPNS_4BlobIdEESaIS5_EERKS2_IbSaIbEES9_]+0xbe): undefined reference to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)'
.build_release/lib/libcaffe.a(reduction_layer.o):tmpxft_00004ba3_00000000-4_reduction_layer.compute_61.cudafe1.cpp:(.text._ZN5caffe14ReductionLayerIdE12Backward_gpuERKSt6vectorIPNS_4BlobIdEESaIS5_EERKS2_IbSaIbEES9_[_ZN5caffe14ReductionLayerIdE12Backward_gpuERKSt6vectorIPNS_4BlobIdEESaIS5_EERKS2_IbSaIbEES9_]+0x191): more undefined references to `google::protobuf::internal::NameOfEnum(google::protobuf::EnumDescriptor const*, int)' follow
collect2: error: ld returned 1 exit status

Makefile:517: recipe for target 'matlab/+caffe/private/caffe_.mexa64' failed
make: *** [matlab/+caffe/private/caffe_.mexa64] Error 255

detail.bash

Xie

unread,
Aug 16, 2017, 10:53:55 PM8/16/17
to Caffe Users
Insert a row

CXXFLAGS += -std=c++11

to your Makefile.config and retry. It works for me. Hope it helps.

I saw this solution at https://github.com/ShaoqingRen/faster_rcnn/issues/151


在 2017年8月16日星期三 UTC+8下午12:38:43,Alan Teng写道:

DarcyHu

unread,
Sep 28, 2017, 5:00:14 AM9/28/17
to Caffe Users
I don't think MATLAB mex compiler support gcc > 4. See Supported and Compatible Compilers.
Reply all
Reply to author
Forward
0 new messages