问题描述
我安装了Xcode 4.5和Matlab 2012a的Mountain Lion.我安装并运行了MathWorks网站上提供的补丁,但是仍然收到以下错误:
I have Mountain Lion installed with Xcode 4.5 and Matlab 2012a. I installed and ran the patch supplied on the MathWorks website however I still received the following error:
/Applications/MATLAB_R2012a.app/bin/mex: line 305: llvm-gcc-4.2: command not found
/Applications/MATLAB_R2012a.app/bin/mex: line 1326: llvm-gcc-4.2: command not found
mex: compile of ' "hello.c"' failed.
Error using mex (line 206)
有一个已知的解决方案吗?
Is there a known solution for that ?
仍然需要MathWorks补丁.为我解决了问题.
The MathWorks patch is still needed. Resolved issue for me.
推荐答案
您不需要安装XCode.我安装了命令行工具,然后编辑文件"/Applications/MATLAB_R2012a.app/bin/mexopts.sh"和
You don't need to install XCode. I installed Command Line Tools and then edit the file "/Applications/MATLAB_R2012a.app/bin/mexopts.sh" and
将抄送从gcc-4.2更改为llvm-gcc-4.2
changed CC from gcc-4.2 to llvm-gcc-4.2
将CXX从gcc-4.2更改为llvm-g ++-4.2
changed CXX from gcc-4.2 to llvm-g++-4.2
将SDKROOT设置为"/"
set SDKROOT to '/'
完成了.现在,您只需要在MATLAB中运行"mex -setup"
It's done. Now, you just need to run "mex -setup" in MATLAB
为我工作(Mac OSX 10.8.2,命令行工具-2012年10月,MATLAB 2012a)
Worked for me (Mac OSX 10.8.2, Command Line Tools - October 2012, MATLAB 2012a)
这篇关于Matlab 2012a Mex将在Mountain Lion上使用Xcode 4.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!