How can I compile a C file in Matlab R2013a?
1 view (last 30 days)
Show older comments
Hello, I have a problem while trying to compile a C file with Matlab R2013a, the error I get is:
>> mex fsmem_mvgm.c
/Applications/MATLAB_R2013a.app/bin/mex: line 305: llvm-gcc-4.2: command not found
/Applications/MATLAB_R2013a.app/bin/mex: line 1343: llvm-gcc-4.2: command not found
mex: compile of ' "fsmem_mvgm.c"' failed.
Error using mex (line 206) Unable to complete successfully.
Thanks.
1 Comment
Walter Roberson
on 30 Jul 2013
If you were using R2011* or R2012* the appropriate resource would be:
Answers (3)
Walter Roberson
on 30 Jul 2013
Be sure to install one of the supported compilers: see http://www.mathworks.com/support/compilers/R2013a/index.html?sec=maci64
2 Comments
Ken Atwell
on 30 Jul 2013
R2013a should work without modification with modern versions of Xcode. There is no need for any patch -- do not install the patch intended for older releases of MATLAB.
But, it sounds like you may have already done this ("llvm-gcc" is a tip-off, 13a should use clang). If you have a backup in Time Machine, I would restore MATLAB to the state it was in before the patch was applied. Otherwise, I'm afraid you'll need to reinstall MATLAB, sorry.
If problems persist, post again to MATLAB Answers with updated error messages.
Housen
on 20 Jan 2014
I have encountered the same trouble. I use Mac OS 10.9.1 and Xcode 5.0.2. Since the command line tools are preinstalled, your solution does not help much. Instead of reinstalling Matlab, I found the following commands fix my problem:
cd /usr/bin
sudo ln -fs clang llvm-gcc-4.2
sudo ln -fs clang++ llvm-g++-4.2
6 Comments
Marc
on 5 Feb 2014
It doesn't appear to have compiled nor did it give "command not found." I remember seeing nlplant a couple days ago but I do not recall what I did to get the nlplant to show.
See Also
Categories
Find more on C Shared Library Integration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!