Makefile:517:目标'matlab / + caffe / private / caffe_.mexa64'的配方失败make:***

时间:2017-03-27 05:38:20

标签: matlab caffe mex pycaffe matcaffe

我一直面临着这个问题。我使用的是ubuntu 16.04,cuda 8,cudnn 5.1,opencv 3.1,matlab 2014a。我用cuda安装了opencv3.1 我想配置matcaffe。提前谢谢。

这是我的错误报告。

    MEX matlab/+caffe/private/caffe_.cpp
Building with 'g++'.
Warning: You are using gcc version '5.4.1'. 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.1-2ubuntu1~16.04)'. 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.
/home/mustansar/Documents/caffe-master/matlab/+caffe/private/caffe_.cpp: In function ‘void delete_solver(int, mxArray**, int, const mxArray**)’:
/home/mustansar/Documents/caffe-master/matlab/+caffe/private/caffe_.cpp:208:3: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
   }), solvers_.end());
   ^
/home/mustansar/Documents/caffe-master/matlab/+caffe/private/caffe_.cpp:208:4: error: no matching function for call to ‘remove_if(std::vector<boost::shared_ptr<caffe::Solver<float> > >::iterator, std::vector<boost::shared_ptr<caffe::Solver<float> > >::iterator, delete_solver(int, mxArray**, int, const mxArray**)::<lambda(const boost::shared_ptr<caffe::Solver<float> >&)>)’
   }), solvers_.end());
    ^
In file included from /usr/include/c++/5/algorithm:62:0,
                 from ./include/caffe/blob.hpp:4,
                 from ./include/caffe/caffe.hpp:7,
                 from /home/mustansar/Documents/caffe-master/matlab/+caffe/private/caffe_.cpp:18:
/usr/include/c++/5/bits/stl_algo.h:926:5: note: candidate: template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)
     remove_if(_ForwardIterator __first, _ForwardIterator __last,
     ^
/usr/include/c++/5/bits/stl_algo.h:926:5: note:   template argument deduction/substitution failed:
/home/mustansar/Documents/caffe-master/matlab/+caffe/private/caffe_.cpp: In substitution of ‘template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate) [with _FIter = __gnu_cxx::__normal_iterator<boost::shared_ptr<caffe::Solver<float> >*, std::vector<boost::shared_ptr<caffe::Solver<float> > > >; _Predicate = delete_solver(int, mxArray**, int, const mxArray**)::<lambda(const boost::shared_ptr<caffe::Solver<float> >&)>]’:
/home/mustansar/Documents/caffe-master/matlab/+caffe/private/caffe_.cpp:208:4:   required from here
/home/mustansar/Documents/caffe-master/matlab/+caffe/private/caffe_.cpp:208:4: error: template argument for ‘template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)’ uses local type ‘delete_solver(int, mxArray**, int, const mxArray**)::<lambda(const boost::shared_ptr<caffe::Solver<float> >&)>’
   }), solvers_.end());
    ^
/home/mustansar/Documents/caffe-master/matlab/+caffe/private/caffe_.cpp:208:4: error:   trying to instantiate ‘template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)’
/home/mustansar/Documents/caffe-master/matlab/+caffe/private/caffe_.cpp: In function ‘void delete_net(int, mxArray**, int, const mxArray**)’:
/home/mustansar/Documents/caffe-master/matlab/+caffe/private/caffe_.cpp:293:3: warning: lambda expressions only available with -std=c++11 or -std=gnu++11
   }), nets_.end());
   ^
/home/mustansar/Documents/caffe-master/matlab/+caffe/private/caffe_.cpp:293:4: error: no matching function for call to ‘remove_if(std::vector<boost::shared_ptr<caffe::Net<float> > >::iterator, std::vector<boost::shared_ptr<caffe::Net<float> > >::iterator, delete_net(int, mxArray**, int, const mxArray**)::<lambda(const boost::shared_ptr<caffe::Net<float> >&)>)’
   }), nets_.end());
    ^
In file included from /usr/include/c++/5/algorithm:62:0,
                 from ./include/caffe/blob.hpp:4,
                 from ./include/caffe/caffe.hpp:7,
                 from /home/mustansar/Documents/caffe-master/matlab/+caffe/private/caffe_.cpp:18:
/usr/include/c++/5/bits/stl_algo.h:926:5: note: candidate: template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)
     remove_if(_ForwardIterator __first, _ForwardIterator __last,
     ^
/usr/include/c++/5/bits/stl_algo.h:926:5: note:   template argument deduction/substitution failed:
/home/mustansar/Documents/caffe-master/matlab/+caffe/private/caffe_.cpp: In substitution of ‘template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate) [with _FIter = __gnu_cxx::__normal_iterator<boost::shared_ptr<caffe::Net<float> >*, std::vector<boost::shared_ptr<caffe::Net<float> > > >; _Predicate = delete_net(int, mxArray**, int, const mxArray**)::<lambda(const boost::shared_ptr<caffe::Net<float> >&)>]’:
/home/mustansar/Documents/caffe-master/matlab/+caffe/private/caffe_.cpp:293:4:   required from here
/home/mustansar/Documents/caffe-master/matlab/+caffe/private/caffe_.cpp:293:4: error: template argument for ‘template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)’ uses local type ‘delete_net(int, mxArray**, int, const mxArray**)::<lambda(const boost::shared_ptr<caffe::Net<float> >&)>’
   }), nets_.end());
    ^
/home/mustansar/Documents/caffe-master/matlab/+caffe/private/caffe_.cpp:293:4: error:   trying to instantiate ‘template<class _FIter, class _Predicate> _FIter std::remove_if(_FIter, _FIter, _Predicate)’

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

1 个答案:

答案 0 :(得分:1)

尝试添加&#34; CXXFLAGS + = -std = c ++ 11&#34;进入Makefile并重新编译