I have been trying to compile matcaffe in Ubuntu 16.04. Caffe compiles successfully with gcc 5. However, MATLAB R2016b is compatible with gcc
4.9, I got following warning during compilation (using
make matcaffe):
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.
Even though the MEX file is created, I can not use it from MATLAB because it gives an error like
Invalid MEX-file 'blablabla/caffe/matlab/+caffe/private/caffe_.mexa64':
/blablabla/bin/glnxa64/../../sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found
I have tried many things, including
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
and
sudo rm /blablabla/sys/os/glnxa64/libstdc++.so.6
sudo ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /blablabla/sys/os/glnxa64/libstdc++.so.6
but no success.
Anybody faced with this problem and have an idea?