first, after installing Caffe, compile
sudo make all-j8
sudo make test-j8
sudo make runtest-j8 next compile matlab excuse
sudo make matcaffe-j8
Test matlab interface: sudo make mattest-j8 if it's okay.
However, if the MATLAB version and the GCC (Linux) version do not match, it will cause errors
If you call caffe in MATLAB, you may also encounter the following error message and the above error statement
Invalid mex-file '/home/matconvnet-1.0-beta20/matlab/mex/vl_nnconv.mexa64 ':
/usr/local/matlab/r2016a/bin/ glnxa64/.. /.. /sys/os/glnxa64/libstdc++.so.6:version
' glibcxx_3.4.21 ' not found (required by/home/matconvnet-1.0-beta20/ MATLAB/MEX/VL_NNCONV.MEXA64)
MATLAB refers to the version of GCC and the version of the system does not match, the general situation is the version of the MATLAB reference is too low
Some caffe installation tutorials will lower the GCC version just in the first
If not, you can change the soft connection of GCC referenced in matlab
The path of GCC in my Ubuntu is the libstdc++.so.6 soft connection mismatch under the/usr/lib/x86_-linux_gnu/path (guaranteed and l/usr/lib/x86_64-linux-gnu/libstdc++.so.6 Connection version)
You can view the details of a connection through ls-al/usr/lib/x86_64-linux-gnu/libstdc++.so.6
sudo ln-s/usr/local/matlab/r2014a/sys/os/glnxa64/libstdc++.so.6.21/usr/local/matlab/r2014a/sys/os/glnxa64/ Libstdc++.so.6
Update Soft connection sudo ldconfig
In this way, after the soft connection is updated, there are sometimes errors, it is possible that the OPENCV version referenced in MATLAB does not match
such as: Invalid mex-file '/home/matconvnet-1.0-beta20/matlab/mex/vl_nnconv.mexa64 ':/usr/local/matlab/r2016a/bin/ glnxa64/.. /.. /sys/os/glnxa64/libstdc++.so.6:version ' glibcxx_3.4.21 ' not found (required by/home/matconvnet-1.0-beta20/matlab/ MEX/VL_NNCONV.MEXA64) at this time also need to update some soft connections, OPENCV related
View the relevant files
ls-al/usr/local/matlab/r2014a/bin/glnxa64/libopen* ls-al/usr/local/opencv-2.4.13/build/lib/libopencv_* (I am installing the opencv2.4 because the installation 3.0 is always compiled and not passed)
Delete the original connection
sudo rm-rf libopencv_core.so.2.4 libopencv_highgui.so.2.4 libopencv_imgproc.so.2.4
Create a new connection
sudo ln-s/usr/local/opencv-2.4.13/build/lib/libopencv_core.so.2.4.13 libopencv_core.so.2.4
sudo ln-s/usr/local/opencv-2.4.13/build/lib/libopencv_imgproc.so.2.4.13 libopencv_imgproc.so.2.4
sudo ln-s/usr/local/opencv-2.4.13/build/lib/libopencv_highgui.so.2.4.13 libopencv_highgui.so.2.4
Update connection sudo ldconfig
Re-test the interface sudo make mattest OK