Matlab 2020b does not find Xcode Mac OS Big Sur
31 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(3 个)
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
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
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.
Rameez Wajid
2020-12-2
Release 2020b does not support Xcode 12.x yet ... https://www.mathworks.com/support/requirements/supported-compilers.html
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Troubleshooting in MATLAB Compiler SDK 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!