"Error using mex. No supported compiler was found." MacOSX10.14, R2019a with Xcode 10.3
6 views (last 30 days)
Show older comments
I have an issue similar to this post: Mex can't find compiler after Xcode 7 update (R2015b). However, the referenced '/bin/maci64/mexopts/clang_maci64.xml' appears to have changed. Mex only searches for MacOSX10.12.sdk to MacOSX10.9.sdk, but I have MacOSX10.14.sdk in my Xcode.app. How can I get mex to look for the 10.14 version? I am using Matlab R2019a and Xcode 10.3.
... Looking for compiler 'Xcode with Clang' ...
... Looking for environment variable 'DEVELOPER_DIR' ...No.
... Executing command 'xcode-select -print-path' ...Yes ('/Applications/Xcode.app/Contents/Developer').
... Looking for folder '/Applications/Xcode.app/Contents/Developer' ...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.3.1').
... Executing command '
agreed=9.3.1
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.3.1').
... Executing command 'xcode-select -print-path' ...Yes ('/Applications/Xcode.app/Contents/Developer').
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk' ...No.
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk' ...No.
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk' ...No.
... Looking for folder '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk' ...No.
... Executing command 'find /Applications/Xcode.app/Contents/Developer -name MacOSX10.12.sdk | egrep 'MacOSX10.12.sdk'' ...No.
... Executing command 'find $$ -name MacOSX10.11.sdk | egrep 'MacOSX10.11.sdk'' ...find: 10433: No such file or directory
No.
... Executing command 'find $$ -name MacOSX10.10.sdk | egrep 'MacOSX10.10.sdk'' ...find: 10436: No such file or directory
No.
... Executing command 'find $$ -name MacOSX10.9.sdk | egrep 'MacOSX10.9.sdk'' ...find: 10439: No such file or directory
No.
Did not find installed compiler 'Xcode with Clang'.
Error using mex
No supported compiler was found.
1 Comment
Answers (2)
Shubham Kashyap
on 8 Apr 2020
There are a few things that could possibly be going wrong here:
- You previously had XCode 9.0 installed which was working with a previous version of MATLAB to use mex. You would have updated Matlab and installed the newest version of Xcode, but had not agreed to the Xcode license for this version. The solution below goes through the steps to do this.
Check the following line:
... Executing command 'xcode-select -print-path' ...Yes ('/Applications/Xcode.app/Contents/Developer').
This should point to the directory containing Xcode.app, or the above.
- Environment variables may be incorrectly set. This can be checked with getenv('DEVELOPER_DIR') and setenv.
It is possible that if you previously had a different version of Xcode version 9.0 installed on this system, you will only have accepted the license for that version.
For example, the line:
... Executing command 'defaults read /Library/Preferences/com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense' ...Yes ('9.0')
suggests that the license for Xcode has only been agreed for an older version 9.0, but not for your currently installed 10.3 version.
Can you try entering the following commands into the terminal:
sudo xcodebuild -license
sudo xcodebuild -license accept
Please try opening Xcode 10.3 as well before retrying the mex command in MATLAB.
0 Comments
See Also
Categories
Find more on Troubleshooting in MATLAB Compiler SDK 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!