Why does MATLAB not recognize my Xcode 9 installation when running "mex -setup"?
29 views (last 30 days)
Show older comments
MathWorks Support Team
on 13 Nov 2017
Commented: Walter Roberson
on 16 Dec 2017
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>.
Accepted Answer
MathWorks Support Team
on 13 Nov 2017
"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 Comment
Walter Roberson
on 16 Dec 2017
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
More Answers (0)
See Also
Categories
Find more on Introduction to Installation and Licensing 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!