2016-10-31 5 views
1

나는 Matcaffe를 우분투 16.04에서 컴파일하려고 노력해 왔습니다. 성공적으로 caffe와 pycaffe를 컴파일 할 수있었습니다 (gcc 5 사용). 우분투 16.04는 GCC (5)와 함께 제공하고, MATLAB R2016b는 GCC 4.9와 호환 그러나 이후, 나는 컴파일하는 동안 경고를 다음있어 (메이크업의 matcafee를 사용하여) 다음 MEX 파일이 생성 되더라도Matcaffe on Ubuntu 16.04

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.9.x'. For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release . MEX completed successfully.

, 그럴 수 없어 그것들을 인식하지 못하기 때문에 MATLAB에서 사용하십시오.

이 문제를 해결하기 위해 gcc 4.9 및 g ++ 4.9를 설치하고이를 사용하기위한 심볼 링크를 업데이트했습니다. 내가 matcaffe를 컴파일 할 때, 나는 다음과 같은 오류 메시지가 :

MEX matlab/+caffe/private/caffe_.cpp Building with 'g++'. /tmp/mex_286607035953408_13265/caffe_.o: In function net_copy_from(int, mxArray_tag**, int, mxArray_tag const**)': caffe_.cpp:(.text+0x167d): undefined reference to caffe::Net::CopyTrainedLayersFrom(std::string)' /tmp/mex_286607035953408_13265/caffe_.o: In function get_net(int, mxArray_tag**, int, mxArray_tag const**)': caffe_.cpp:(.text+0x182b): undefined reference to caffe::Net::Net(std::string const&, caffe::Phase, int, std::vector > const*, caffe::Net const*)' /tmp/mex_286607035953408_13265/caffe_.o: In function get_solver(int, mxArray_tag**, int, mxArray_tag const**)': caffe_.cpp:(.text+0x343f): undefined reference to caffe::ReadSolverParamsFromTextFileOrDie(std::string const&, caffe::SolverParameter*)' /tmp/mex_286607035953408_13265/caffe_.o: In function std::string* google::MakeCheckOpString<int, int>(int const&, int const&, char const*)': caffe_.cpp:(.text._ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc[_ZN6google17MakeCheckOpStringIiiEEPSsRKT_RKT0_PKc]+0x42): undefined reference to google::base::CheckOpMessageBuilder::NewString()' /tmp/mex_286607035953408_13265/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]+0x42): undefined reference to google::base::CheckOpMessageBuilder::NewString()' collect2: error: ld returned 1 exit status

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

사람이 성공적으로 우분투 16.04에 Matcaffe 컴파일 했습니까? 또한 MATLAB R2014b 및 gcc 4.7과 동일한 절차를 시도했지만 성공하지 못했습니다.

답변

1

Caffe는 libstdC++ 및 opencv의 시스템 버전에 대해 컴파일되지만 matcaffe를 실행할 때 matlab 버전에 연결됩니다. 내가 OpenCV의 (Makefile.config에서 USE_OPENCV := 0 주석) CAFFE를 구축 ~/.bashrc

export LD_PRELOAD=${LD_PRELOAD}:/usr/local/x86_64-linux-gnu/libstdc++.so.6 

를 추가하고 사용하지 않도록 설정하여 적당하게이 문제를 해결했다.

+0

작동합니다. 문제가 해결되었습니다. – user1586259