Why does MATLAB not recognize my Xcode 9 installation when running "mex -setup"?
6 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2017 年 11 月 13 日
コメント済み: Walter Roberson
2017 年 12 月 16 日
Why does MATLAB report that I have "No supported compiler" when I execute "mex -setup", even though I have Xcode 9 installed on my machine and it is shown as a supported compiler on MathWorks.com?
>> mex -setup -v
Verbose mode is on.
... Looking for compiler 'Xcode with Clang' ...
... Looking for environment variable 'DEVELOPER_DIR' ...No.
... Executing command 'xcode-select -print-path' ...Yes ('/Library/Developer/CommandLineTools').
... Looking for folder '/Library/Developer/CommandLineTools' ...Yes.
... Executing command 'which xcrun' ...Yes ('/usr/bin/xcrun').
... Looking for folder '/usr/bin' ...Yes.
... Executing command 'defaults read com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense' ...No.
... Executing command 'defaults read /Library/Preferences/com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense' ...Yes ('9.0').
... Executing command '
agreed=9.0
if echo $agreed | grep -E '[\.\"]' >/dev/null; then
lhs=`expr "$agreed" : '\([0-9]*\)[\.].*'`
rhs=`expr "$agreed" : '[0-9]*[\.]\(.*\)$'`
if echo $rhs | grep -E '[\."]' >/dev/null; then
rhs=`expr "$rhs" : '\([0-9]*\)[\.].*'`
fi
if [ $lhs -gt 4 ] || ( [ $lhs -eq 4 ] && [ $rhs -ge 3 ] ); then
echo $agreed
else
exit 1
fi
fi' ...Yes ('9.0').
... Executing command 'xcrun -sdk macosx --show-sdk-path' ...No.
Did not find installed compiler 'Xcode with Clang'.
Error using mex
No supported compiler or SDK was found. For options, visit
<https://www.mathworks.com/support/compilers>.
採用された回答
MathWorks Support Team
2017 年 11 月 13 日
"xcode-select -print-path" is reporting that the active developer directory is currently "/Library/Developer/CommandLineTools":
... Executing command 'xcode-select -print-path' ...Yes ('/Library/Developer/CommandLineTools').
This should be changed to the location of the Xcode.app in Applications, by using the "xcode-select" command from macOS Terminal:
sudo xcode-select -s /Applications/Xcode.app
Where "/Applications/XCode.app" is the location of your XCode 9 application. This command will require an administrator password.
1 件のコメント
Walter Roberson
2017 年 12 月 16 日
See https://www.mathworks.com/matlabcentral/answers/243868-mex-can-t-find-compiler-after-xcode-7-update-r2015b#comment_454130 for the configuration file you need for XCode on Sierra; the location to install to is given in my comment two up from that one.
You will probably need to edit the files to copy the two lines with MacOSX10.12 and modify the copy to refer to MacOSX10.13
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Troubleshooting in MATLAB Compiler SDK についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!