So, you’ve upgraded OSX to the latest version and also upgraded XCode to 5.X. You’ll find that the Matlab mex command now fails to build your Matlab executables files as compiler related stuff has moved and version numbers have changed. Thankfully, the fix is relatively simple. I have tried this using 2011b (which is quite out of date now), but I’m guessing that this fix will work for most Matlab versions.
Just locate mexopts.sh, which can be found in
~/.your_old_matlab_version/mexopts.sh, and open it with your favorite editor. Search for
maci64) and then comment out everything related to the C compiler in this shell script block. This is probably everything from the line,
CC=... to the line,
CXXDEBUGFLAGS=... Now just prefix the commented block with this substitute.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
You can also use apple frameworks in your mex files, but there is no flag available for the mex tool that lets you do this from the command line. If you want to use useful stuff like the Accelerate Framework, a little more
mexopts.sh tinkering needs to be done. Edit the following flags so they look like the ones shown …