Why does MATLAB not recognize my Xcode 9 installation when running "mex -setup"?

조회 수: 6 (최근 30일)
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
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
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 CenterFile Exchange에서 Troubleshooting in MATLAB Compiler SDK에 대해 자세히 알아보기

제품


릴리스

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by