MATLAB Answers

Why can't MEX find a supported compiler in MATLAB R2015b after I upgraded to Xcode 7.0?

181 ビュー (過去 30 日間)
I installed Xcode 7.0 on my Mac and tried to use MEX. I receive the following error at the MATLAB command prompt:
ERROR: >> mex -setupError using mexNo supported compiler or SDK was found. For options, visithttp://www.mathworks.com/support/compilers/R2015a/maci64.html
Why does MATLAB not recognize the Xcode 7.0 installation on my Mac?

採用された回答

MathWorks Support Team
MathWorks Support Team 2021 年 2 月 1 日
編集済み: MathWorks Support Team 2021 年 2 月 17 日
By default, MATLAB R2015b does not detect Xcode 7.x. To add support for Xcode 7.x in MATLAB R2015b, download the files attached to this article. Please follow these instructions to download and install the files (screenshots were taken in Mac OS X 10.10.5 Yosemite):
1) Download the file xcode7_mexopts.zip, which you will find attached to this article. Extract the contents of xcode7_mexopts.zip to your Downloads directory. Extracting the ZIP file will create a directory in Downloads called xcode7_mexopts.
2) Open MATLAB R2015b. Navigate to MATLAB's preference directory by typing the following command in the command window:
>> cd( prefdir );
3) Using MATLAB's "Current Folder" browser, ensure that there are no XML files that begin with "mex_" (e.g. mex_C_maci64.xml). If such files exist, remove them from the preference directory.
4) Navigate to the MATLAB directory. In MATLAB, you can do so by entering the following command at the MATLAB command prompt:
>> cd( fullfile( matlabroot, 'bin', 'maci64', 'mexopts' ) );
5) Back up the original files in the mexopts directory. You can run the following MATLAB commands to back up the files:
>> mkdir mexoptsContentsOLD
>> movefile *.xml mexoptsContentsOLD/
Keep the backup separate from the downloaded files such that you can revert to the backup files if necessary.
6) Replace any files in the mexopts directory with the corresponding files in the Downloads folder, xcode7_mexopts. You can replace the files in MATLAB by entering the following command at the MATLAB command prompt:
>> movefile( '~/Downloads/xcode7_mexopts/*.xml', '.' );
7) Restart MATLAB R2015b. Execute "mex -setup" at the MATLAB command prompt as shown below and verify that MEX detects Xcode 7.0.
>> mex -setup
Alternate Solution:
The SDK needed could be in the Xcode package with the path:
/Applications/XCODE/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
Please place this in:
/Library/Developer/CommandLineTools/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk 
This should resolve the issue.
If MEX continues to return an error, please contact
.
 
  23 件のコメント
Pietro Mascheroni
Pietro Mascheroni 2021 年 3 月 25 日
I have the same problem of @Zahra Ashouri, has someone found a solution?

サインインしてコメントする。

その他の回答 (12 件)

XIE STONE
XIE STONE 2016 年 9 月 21 日
I try and it did not work for me. :(
Any good idea?
  11 件のコメント

サインインしてコメントする。


Hamid Sarfraz
Hamid Sarfraz 2016 年 2 月 25 日
編集済み: MathWorks Support Team 2021 年 4 月 19 日 16:28
mex -setup
MEX configured to use 'Xcode with Clang' for C language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB variables with more than 2^32-1 elements. In the near future you will be required to update your code to utilize the new API. You can find more information about this at: https://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html .
To choose a different language, select one from the following:
mex -setup C++
mex -setup FORTRAN
MEX configured to use 'Xcode Clang++' for C++ language compilation.
Warning: The MATLAB C and Fortran API has changed to support MATLAB variables with more than 2^32-1 elements. In the near future you will be required to update your code to utilize the new API. You can find more information about this at: https://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html .
Error using mex
No supported compiler or SDK was found. For options, visit https://www.mathworks.com/support/requirements/previous-releases.html
any explanation(solution) for this ?
  1 件のコメント
Esha Bhargava
Esha Bhargava 2016 年 5 月 4 日
If the workaround provided above does not work for you, please contact MathWorks Technical Support.

サインインしてコメントする。


Brigitte Reniers
Brigitte Reniers 2016 年 3 月 1 日
編集済み: Walter Roberson 2016 年 3 月 2 日
I did all that and I still get this error:
mex Gamma4DCPU.cpp
Building with 'Xcode Clang++'.
Error using mex
/Users/brigitte/Documents/SmartScientificSolutions/Code/Gamma4D/Gamma4DCPU.cpp:111:10:
fatal error: 'malloc.h' file not found
#include <malloc.h>
^
1 error generated.
Does anybody know what it's about?
  1 件のコメント
Xiaoyu Sun
Xiaoyu Sun 2016 年 3 月 30 日
I also get this error.did you solve this problem successfully?

サインインしてコメントする。


Pascal
Pascal 2016 年 3 月 30 日
worked for me. Perfectly. Thanks
  1 件のコメント
Richa Gupta
Richa Gupta 2016 年 4 月 25 日
If the workaround provided above does not work for you, please contact MathWorks Technical Support.

サインインしてコメントする。



cihat tek
cihat tek 2016 年 5 月 18 日
for windows ?
>> mex -setup
Error using mex
No supported compiler or SDK was found. For options, visit
http://www.mathworks.com/support/compilers/R2015a/maci64.html.
  1 件のコメント
Walter Roberson
Walter Roberson 2016 年 5 月 18 日
The error message suggests you are on OS-X but your question has to do with MS Windows?
For OS-X you should follow the instructions above.

サインインしてコメントする。


Hitham
Hitham 2016 年 6 月 13 日
編集済み: MathWorks Support Team 2021 年 4 月 19 日 16:29
I have the same problem. I am using MATLAB R2014b (It is said, No supported compiler or SDK was found. For options, visit https://www.mathworks.com/content/dam/mathworks/mathworks-dot-com/support/sysreq/files/SystemRequirements-Release2014b_SupportedCompilers.pdf ).
How to fix it?
  2 件のコメント
Vandana Ravichandran
Vandana Ravichandran 2017 年 2 月 22 日
What is your platform and Xcode version? Note that the supported compilers for MATLAB R2014b are Xcode 4.6+ and Xcode 5.0

サインインしてコメントする。


Bhavesh Dharmani
Bhavesh Dharmani 2016 年 6 月 27 日
I have installed just the Xcode command line tools and it is installed at /Library/Developer/CommandLineTools. So, whether the same solution will work for me?
I have also changed [matlabroot '/bin/maci64/mexopts/clang_maci64.xml'] and [matlabroot '/bin/maci64/mexopts/clang++_maci64.xml'] to search corresponding to mac OSX 10.11. But, nothing works to setup mex.
  1 件のコメント
Richa Gupta
Richa Gupta 2016 年 7 月 21 日
Bhavesh, I would suggest contacting MathWorks Technical Support.

サインインしてコメントする。



ahmed ali
ahmed ali 2016 年 9 月 29 日
i want to ask about the detailed steps to download minGW-compiler for mex files for matlab 2015b
  2 件のコメント
Anudeep Katragadda
Anudeep Katragadda 2016 年 10 月 21 日
@ahamed ali Here is a link from MathWorks documentation that might help you: https://www.mathworks.com/help/matlab/matlab_external/install-mingw-support-package.html

サインインしてコメントする。


Fateh Benma
Fateh Benma 2017 年 6 月 24 日
編集済み: MathWorks Support Team 2021 年 4 月 19 日 16:29
i have this error !! why ?? any help >> mex -setup Warning: Xcode appears to be installed, but it has not been configured. Run "osascript -e 'do shell script "xcode-select -switch /Applications/Xcode.app" with administrator privileges'" to configure Xcode. You must be an administrator of this computer to complete this action.
Error using mex No supported compiler or SDK was found. For options, visit https://www.mathworks.com/support/requirements/previous-releases.html

Yang Gao
Yang Gao 2019 年 7 月 9 日
Hi! I have problem with my Matlab_R2019a, and my Xcode version is 11. MacOS version 10.14.5.
I can't find any string that contains MacOSX10.12.sdk or similiar string in my clang and clang++ file.
  2 件のコメント
Zahra Ashouri
Zahra Ashouri 2021 年 1 月 17 日
I have this problem with OS 10.15. I have downloaded an older version of xcode (xcode 6) but I have two versions of Matlab, 2020b and 2015a. How can I set a different scode for each of them?

サインインしてコメントする。

製品


リリース

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by