Matlab R2013b C++ MEX on Ubuntu 14.04

You should upgrade Matlab to a current version instead of fiddling with the procedure below

Ubuntu 14.04 comes with GCC 4.8, but Matlab R2013b wants GCC 4.8.

Warning: You are using gcc version ‘4.8.2’. The version of gcc is not supported.

Note that Matlab R2014a uses a new system for MEX configuration. Do not use this process for R2014a and newer For Matlab R2014a I don’t have a solution for specifying gcc-4.7 besides taking the output of mex -v and editing the commands to use gcc-4.7 manually.

http://www.mathworks.com/matlabcentral/answers/67521-32bit-and-64bit-compilations\#comment\_216789

http://www.mathworks.com/help/matlab/release-notes.html

This example is for R2013b and OLDER

Resolution

apt install gcc-4.7 g++-4.7

cp /usr/local/MATLAB/R2013b/bin/mexopts.sh ~/.matlab/R2013b/mexopts.sh

chmod 644 ~/.matlab/R2013b/mexopts.sh

in ~/.matlab/R2013b/mexopts.sh change to one instance each of:

CC='gcc-4.7'

CCX='g++-4.7'

Tags:

Categories:

Updated:

Leave a Comment