How can I use Xcode 5.0.1 with Matlab 2011a_Student?
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Hi all, I recently upgraded my macbook to OS X 10.9 (Mavericks) and Xcode 5.0.1 and I cannot use mex anymore. I have done the following checks:
1. Xcode is updated and the command line support is installed EDU>> !xcodebuild -version Xcode 5.0.1 Build version 5A2053
2. My machine can find the gcc compiler gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) Target: x86_64-apple-darwin13.0.0 Thread model: posix
3. I downloaded and ran the Mathworks patch to use older Xcode versions with earlier Matlab versions (<http://www.mathworks.com/support/solutions/en/data/1-FR6LXJ/>) (I also tried replacing 10.8 with 10.9 in all shell scripts that point towards the path containing the SDKs (but xcode 5 comes with both so it shouldn't matter)
I get the following options when I try to setup mex: ..The options files available for mex are: 1: /Applications/MATLAB_R2011a_Student.app/bin/gccopts.sh : Template Options file for building gcc MEX-files 2: /Applications/MATLAB_R2011a_Student.app/bin/mexopts.sh : Template Options file for building gcc MEX-files 0: Exit with no changes Enter the number of the compiler (0-2):
I tried both options (and answered yes to overwrite the existing file) BUT when I try to use mex, I get the following error (depending on which options I chose in setup of mex): /Applications/MATLAB_R2011a_Student.app/bin/mex: line 305: gcc-4.2: command not found /Applications/MATLAB_R2011a_Student.app/bin/mex: line 305: llvm-gcc-4.2: command not found
What am I doing wrong? Any help is appreciated, thank you for your time!
Answers (1)
Ken Atwell
on 31 Oct 2013
0 votes
The R2011a version of MATLAB predates both Mavericks and Xcode 5 by a few years, and MATLAB is looking for Xcode compilers that no longer ship with Xcode.
You many be able to get by by editing the file ~/.matlab/R2011a/mexopts.sh. Scroll down to the "maci64" section (toward the bottom) and replace instances "llvm-gcc-4.2" "gcc-4.2" with just "gcc". This may be enough to "trick" MATLAB into using the Clang compiler that now ships with Xcode.
This is completely untested by MathWorks, but it might be sufficient for light-weight MEX usage. http://www.mathworks.com/support/compilers/R2011a/maci64.html covers what R2011a was designed and tested for.
This question is closed.
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!