3

I want to install a C/C++ compiler for Matlab R2015b. I am running OSX El Capitan 10.11.3. I installed the newest version of Xcode (Xcode Version 7.3 beta 3).

According to MathWorks, Xcode 7.x should be compatible with Matlab R2015b. http://www.mathworks.com/support/compilers/R2015b/index.html?sec=maci64 I also followed the additional steps to add support for Xcode 7.0 in MATLAB R2015b (this is the most recent post by MathWorks regarding using any Xcode 7.x) http://www.mathworks.com/matlabcentral/answers/246507-why-can-t-mex-find-a-supported-compiler-in-matlab-r2015b-after-i-upgraded-to-xcode-7-0#answer_194526

When I run "mex -setup" in Matlab I get the following error message:

Warning: Xcode is installed, but its license has not been accepted. Run Xcode
and accept its license agreement.

I have already tried the following in my terminal: sudo xcodebuild -license

It loads the license and I am able to scroll through and type "agree". Still, Matlab gives me the same error.

  • Have you tried to run Xcode and agree the license there? – Mattia Feb 19 '16 at 16:11
  • Have you tried xcode-select -reset to make sure that the xcodebuild in the path is the one matlab is calling? I just had this mess up homebrew where I deleted a debug version of Xcode, but some of the tools were "missing" – bmike Feb 19 '16 at 16:51
  • I have tried but the license does not show up when you open the application. @bmike - I just tried the reset but still no luck. Note that Matlab recognizes that Xcode is installed, but it cannot find that I agreed to the license. – MrSpace Feb 19 '16 at 17:05
  • 1
    I wonder if it's some odd thing in the user environment. If you log out or reboot, does gcc also complain that the license is bad? $ gcc --version should put out text like... Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 7.0.2 (clang-700.1.81) – bmike Feb 19 '16 at 17:10
  • No complaints that the license is bad. Only have issues when trying to do "mex -setup" in Matlab. Here is the terminal output for gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 7.3.0 (clang-703.0.21) Target: x86_64-apple-darwin15.3.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin – MrSpace Feb 19 '16 at 19:53

You must log in to answer this question.

Browse other questions tagged .