MEX cannot find a supported compiler in MATLAB R2015b after I upgraded to Xcode 8.0

조회 수: 6 (최근 30일)
I installed Xcode 8.0 on my Mac and tried to use MEX. But I received the following error at the MATLAB command prompt. Please help, thanks.
>> mex -setup
Error using mex
No supported compiler or SDK was found. For options, visit

채택된 답변

Walter Roberson
Walter Roberson 2016년 9월 18일
Go to the folder /Applications/MATLAB_R2015b.app/bin/maci64/mexopts and edit the files clang++_maci64.xml and clang_maci64.xml . In both of those files, search for lines containing the string MacOSX10.10.sdk or MacOSX10.11.sdk . Duplicate the line and change it to MacOSX10.12.sdk . You will need to change 4 lines total in each of the two files, a line that mentions dirExists then a line that mentions cmdReturns and then the same two again.
Now, go into either Applications or LaunchPad and find your XCode icon, and launch it. You will need to agree to the license terms. If XCode launches without presenting the license terms dialog then you have already agreed for that version and do not need to repeat it.
The edits and the license agreement having been done, you should now be able to go into MATLAB and use
mex -setup C
mex -setup C++
  댓글 수: 14
Pierre
Pierre 2022년 12월 1일
Works also for later versions of XCode (10) and MacOSX (Mojave).
Thanks a million.
Gregory
Gregory 2023년 6월 26일
The solution from Walter worked for me too. Thanks!
I changed "10.12" references to my current SDK version "13.3" (4 instances in each clang++_maci64.xml and clang_maci64.xml) and "No supported compiler or SDK was found" issue was resolved
Ventura 13.4, Xcode 14.3.1

댓글을 달려면 로그인하십시오.

추가 답변 (4개)

Karthikeyan Chandrasekaran
Karthikeyan Chandrasekaran 2016년 11월 7일
I followed the above steps.I could see MacOSX10.12.sdk already there. but still i am not able to figure out the problem
OS:MACOS i am using Xcode_beta,MATLAB2016b..
>> mex -setup C Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement.
Error using mex No supported compiler or SDK was found.
Can anyone please help me regarding this where i am going wrong ?
  댓글 수: 1
Walter Roberson
Walter Roberson 2016년 11월 7일
Go into Launcher, click on XCode. Or find it in Applications and double-click it. When it starts up it will ask you to confirm that you accept the license. Once you accept it, mex will work.

댓글을 달려면 로그인하십시오.


changxun fan
changxun fan 2017년 2월 26일
it's work! thank so much.

xu tiantian
xu tiantian 2018년 8월 19일
Walter Roberson's answers have solved my problems perfectly. Thanks so much.

Melanie Renn
Melanie Renn 2020년 7월 23일
편집: Melanie Renn 2020년 7월 23일
I installed Xcode 11.3.1 on my Mac (OS Catalina 10.15.5) and tried to use MEX. I followed Walter's steps above, but I am still getting the following error:
Error using mex
No supported compiler was found. For options, visit
https://www.mathworks.com/support/compilers.
Please help. Thanks in advance.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by