BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
34.03k stars 18.7k forks source link

Failed make mattest for the Invalid MEX-file that is not the cause of libstdc++! #5576

Open zz-kuku opened 7 years ago

zz-kuku commented 7 years ago

Operating system: Ubuntu 16.04 Compiler: GCC-5 CUDA version (if applicable): 8.0 MATLAB version : R2014a

I succeed in make matcaffe,but failed in make mattest. The questions is:

Invalid MEX-file '/home/chenxiang/caffe/matlab/+caffe/private/caffe.mexa64': /home/chenxiang/caffe/matlab/+caffe/private/caffe.mexa64: undefined symbol: _ZNK6google8protobuf7Message11GetTypeNameB5cxx11Ev

Error in caffe.set_modecpu (line 5) caffe('set_mode_cpu');

Error in caffe.run_tests (line 6) caffe.set_mode_cpu();

And I have try the method like the following:

export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/:/usr/local/cuda-8.0/lib64  
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libopencv_highgui.so.2.4:/usr/lib/x86_64-linux-gnu/libopencv_imgproc.so.2.4:/usr/lib/x86_64-linux-gnu/libopencv_core.so.2.4:/usr/lib/x86_64-linux-gnu/libstdc++.so.6:/usr/lib/x86_64-linux-gnu/libfreetype.so.6  

But I get this result:

malloc: unknown:0: assertion botched free: called with unallocated block argument last command: (null) Aborting...find: ‘bash’ terminated by signal 6

malloc: unknown:0: assertion botched free: called with unallocated block argument last command: (null) Aborting...find: ‘bash’ terminated by signal 6

malloc: unknown:0: assertion botched free: called with unallocated block argument last command: (null) Aborting...find: ‘bash’ terminated by signal 6

malloc: unknown:0: assertion botched free: called with unallocated block argument last command: (null) Aborting...find: ‘bash’ terminated by signal 6

Maybe the reason is that there are other lib directions for libopencv_core and so on, which I installed for intergration. But either export the dir of the libs or replace the soft-link, it all failed. When I just replace the lib in the matlab, it still tell the errors:

Invalid MEX-file '/home/chenxiang/caffe/matlab/+caffe/private/caffe.mexa64': /home/chenxiang/caffe/matlab/+caffe/private/caffe.mexa64: undefined symbol: _ZNK6google8protobuf7Message11GetTypeNameB5cxx11Ev

Error in caffe.set_modecpu (line 5) caffe('set_mode_cpu');

Error in caffe.run_tests (line 6) caffe.set_mode_cpu();

I am sure that the question is not the cause of libstdc++.so And I can't use any functions about caffe in matlab. I am crazy! Because everyone talk this question for the reason of libstdc++, and no one have the same fault like me ?

Please help me, very thanks !!!

xianlopez commented 7 years ago

I'm having the same issue, with Matlab 2015a.

zz-kuku commented 7 years ago

@xianlopez Sorry, I still failed in this problem.

alfrednoble commented 6 years ago

I have also the exact same problem

pewpewpeww commented 6 years ago

Hi, you guys might want to try relinking straight instead of exporting. I had this same issue too and I tried exporting to not avail, but relinking works.

You might want to refer to this link http://www.cs.jhu.edu/~cxliu/2016/compiling-matcaffe-on-ubuntu-1604.html

gmt710 commented 5 years ago

@pewpewpeww ,hi. It can't solve the problem.But thanks.