3

I recently bought a new computer that came with Mountain Lion (OS 10.8). I'd like to start working with mex files on this machine, but I'm having a hard time getting 'mex -setup' to find any compilers.

Specs:

  • Mountain Lion 10.8
  • Matlab 2012a
  • XCode 4.4

I noticed that matlab has released a patch for XCode 4.2, and 4.3. I also realize that XCode 4.4 (and Mountain lion, for that matter) is not officially supported by Matlab. As far as I can tell, there is not a way to install 4.3 on Mountain Lion. So I know it is a long shot to ask the community, but has anyone found a way to get XCode 4.4 to work with Matlab's mex functionality?

Thanks, David

3 Answers 3

1

I have the same specs as you mentioned and I reproduced your situation. However, I found a working solution from the Mathworks. It was designed for XCode 4.2 and 4.3, yet it works for XCode 4.4. The fix is simple and involves only running a patch from the Matlab command line.

All information can be found this bug report in the MathWorks support forum.

1
  • Thanks! I had actually tried this once before and it didn't work. After a clean install of matlab the patch worked using the same instructions specified for Xcode 4.3. My best guess is that I had done too much uneducated mucking around before trying the patch.
    – dhover
    Aug 2, 2012 at 14:46
1

I had changed 10.7 to 10.8 in each *opt.sh offical patch file from MathWorks, and it works just fine with Mac OS X 10.8, Xcode 4.5, matlab 2012a.

0

This may not be the answer you want, but you could always use xcode to install a supported version of gcc, and then have Matlab use that...

(Blog post on compiling gcc for Mac)

1
  • Thanks for the feedback. I think the problem may be more complicated than compiling a supported version of gcc. I believe that I do have the correct version of gcc. The (or a) problem is that Matlab doesn't know how to find the compiler when setting up mex. For xcode 4.2 and 4.3 matlab officially patched a setup folder called mexopts.sh. It doesn't seem to work with xcode 4.4
    – dhover
    Aug 1, 2012 at 0:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.