MATLAB Answers

Matlab 2020b does not find Xcode Mac OS Big Sur

76 views (last 30 days)
Luiz Morales
Luiz Morales on 26 Nov 2020
Answered: Rameez Wajid on 2 Dec 2020
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 Comments

Sign in to comment.

Answers (2)

Steven Lord
Steven Lord on 26 Nov 2020
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 Comment

Luiz Morales
Luiz Morales on 29 Nov 2020
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?

Sign in to comment.


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

  0 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!