Matlab 2020b does not find Xcode Mac OS Big Sur

67 ビュー (過去 30 日間)
Luiz Morales
Luiz Morales 2020 年 11 月 26 日
コメント済み: McBola 2023 年 2 月 17 日
Hi all,
Yesterday I have updated my Mac to the new Mac OS Big Sur, I have installed Xcode 12.2, have installed the X code command line, have accepted the licenses using sudo xcodebuild -license accept, but when I open Matlab and try to install a toolbox I make use for analysis of materials (MTEX - https://mtex-toolbox.github.io), Matlab tries to compile some files, but keeps complaining that Xcode is installed but its license has not been accepted. The full list of errors is below:
>> startup_mtex
I found another version of MTEX and remove it from the current search path!
initialize MTEX 5.5.0 ....
--------------------------------------------------------------------------------
Checking mex files failed!
> Trying now to recompile mex files.
... compiling S1Grid_find.c
Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement.
> In mex_install (line 18)
In check_installation>check_mex (line 75)
In check_installation (line 39)
In startup_mtex (line 70)
Compiling /Users/lfgmorales/Documents/MATLAB/mtex-5.5.0/mex/S1Grid_find.c failed!
... compiling S1Grid_find_region.c
Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement.
> In mex_install (line 18)
In check_installation>check_mex (line 75)
In check_installation (line 39)
In startup_mtex (line 70)
Compiling /Users/lfgmorales/Documents/MATLAB/mtex-5.5.0/mex/S1Grid_find_region.c failed!
... compiling S2Grid_find.c
Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement.
> In mex_install (line 18)
In check_installation>check_mex (line 75)
In check_installation (line 39)
In startup_mtex (line 70)
Compiling /Users/lfgmorales/Documents/MATLAB/mtex-5.5.0/mex/S2Grid_find.c failed!
... compiling S2Grid_find_region.c
Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement.
> In mex_install (line 18)
In check_installation>check_mex (line 75)
In check_installation (line 39)
In startup_mtex (line 70)
Compiling /Users/lfgmorales/Documents/MATLAB/mtex-5.5.0/mex/S2Grid_find_region.c failed!
... compiling SO3Grid_dist_region.c
Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement.
> In mex_install (line 18)
In check_installation>check_mex (line 75)
In check_installation (line 39)
In startup_mtex (line 70)
Compiling /Users/lfgmorales/Documents/MATLAB/mtex-5.5.0/mex/SO3Grid_dist_region.c failed!
... compiling SO3Grid_find.c
Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement.
> In mex_install (line 18)
In check_installation>check_mex (line 75)
In check_installation (line 39)
In startup_mtex (line 70)
Compiling /Users/lfgmorales/Documents/MATLAB/mtex-5.5.0/mex/SO3Grid_find.c failed!
... compiling SO3Grid_find_region.c
Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement.
> In mex_install (line 18)
In check_installation>check_mex (line 75)
In check_installation (line 39)
In startup_mtex (line 70)
Compiling /Users/lfgmorales/Documents/MATLAB/mtex-5.5.0/mex/SO3Grid_find_region.c failed!
... compiling insidepoly_dblengine.c
Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement.
> In mex_install (line 18)
In check_installation>check_mex (line 75)
In check_installation (line 39)
In startup_mtex (line 70)
Compiling /Users/lfgmorales/Documents/MATLAB/mtex-5.5.0/mex/insidepoly_dblengine.c failed!
... compiling insidepoly_sglengine.c
Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement.
> In mex_install (line 18)
In check_installation>check_mex (line 75)
In check_installation (line 39)
In startup_mtex (line 70)
Compiling /Users/lfgmorales/Documents/MATLAB/mtex-5.5.0/mex/insidepoly_sglengine.c failed!
********************************************************************************
MTEX: Couldn't get the mex files working!
The original error message was:
Invalid MEX-file '/Users/lfgmorales/Documents/MATLAB/mtex-5.5.0/mex/SO3Grid_dist_region.mexmaci64': dlopen(/Users/lfgmorales/Documents/MATLAB/mtex-5.5.0/mex/SO3Grid_dist_region.mexmaci64, 6): Library not loaded: @loader_path/libmex.dylib
Referenced from: /Users/lfgmorales/Documents/MATLAB/mtex-5.5.0/mex/SO3Grid_dist_region.mexmaci64
Reason: image not found
Please have a look at https://mtex-toolbox.github.io/installation
or ask in the forum https://groups.google.com/forum/#!forum/mtexmail for help.
********************************************************************************
If I do mex -setup, it returns:
Warning: Xcode is installed, but its license has not been accepted. Run Xcode and accept its license agreement.
Error using mex
No supported compiler was found. For options, visit https://www.mathworks.com/support/compilers.
Does anyone know how to solve that, I know this is not specific for this toolbox, but a compiler issue?
thanks a lot
Luiz

回答 (3 件)

Mario A
Mario A 2022 年 6 月 29 日
編集済み: Mario A 2022 年 6 月 29 日
MATLAB requires Xcode to build MEX files on macOS: if only the Command Line Tools are available, MATLAB complains that "Xcode is installed, but its license has not been accepted."
To build MEX files with only the Command Line Tools installed, open Terminal and execute the following command to create a property list:
defaults write com.apple.dt.Xcode IDEXcodeVersionForAgreedToGMLicense 12.4
(Replace 12.4 by your version of Xcode)
You should now be able to use mex and mex -setup without MATLAB issuing Xcode-related complaints.
  1 件のコメント
McBola
McBola 2023 年 2 月 17 日
Thanks, this fixed my very vexing problem. Other attempts at accepting the license were accepted by the OS (Catalina) but did not solve the matlab problem (e.g., sudo xcodebuild -license accept)

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


Steven Lord
Steven Lord 2020 年 11 月 26 日
I would try following the instruction in the warning message. Run Xcode (outside of MATLAB) and when it prompts you to accept the license agreement, read and accept it. Then run the code in MATLAB again.
  1 件のコメント
Luiz Morales
Luiz Morales 2020 年 11 月 29 日
Hi Steve, thanks for taking the time to answer, but I am afraid I don’t understand wjat you mean. I already accept the Xcode license, so if I open Xcode by itself, there is nothing to accept, I have accepted the license via terminal as described above. But maybe I am missing something trivial here?

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


Rameez Wajid
Rameez Wajid 2020 年 12 月 2 日
Release 2020b does not support Xcode 12.x yet ... https://www.mathworks.com/support/requirements/supported-compilers.html

カテゴリ

Help Center および File ExchangeIntroduction 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