There are some posts about this for the older releases of MATLAB, but they don't seem to work for R2016a.
I'm trying to install MatConvNet on Ubuntu 16.04. When I run the vl_compilenn command as described here, it gives me a warning as follows:
Building with 'gcc'.
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.
I have already installed gcc-4.7 and g++-4.7 using apt-get install gcc-4.7 g++-4.7. How can I force MATLAB to use these versions and not the default ones?
Few hints, not a complete tutorial how to do it. Probably the simplest would be to edit the MATLAB's Mex XML configuration file:
The mex setup usually creates a copy in your home folder (
~/.matlab/<version>/mex_C_glnca64.xml), so you should be able to edit it without root.There you probably need to change the section:
which I guess searches for the location of the
gcccommand to your gcc version and assigns it to the$GCCvariable. Plus you can change the version name in the header.Additionally you need to do the same for the C++ language.