1

I am trying to run MakeCMG (from here http://www.cs.cmu.edu/~jkoutis/cmg.html) file in Matlab, and I get this error. Can someone help me figureout how to fix it?

xcrun: error: SDK "macosx10.7" cannot be located
clang: warning: no such sysroot directory: '-mmacosx-version-min=10.7'
../../../Source/Hierarchy/adjacency_cmg.c:8:1: warning: '/*' within block
  comment [-Wcomment]
 /* The CMG solver is distributd under the terms of the GNU General Public */
 ^
In file included from ../../../Source/Hierarchy/adjacency_cmg.c:13:
In file included from /Applications/MATLAB_R2013a_Student.app/extern/include   
/mex.h:58:
In file included from /Applications/MATLAB_R2013a_Student.app/extern/include   
/matrix.h:294:
/Applications/MATLAB_R2013a_Student.app/extern/include/tmwtypes.h:819:9:    
error: 
unknown type name 'char16_t' 
typedef char16_t CHAR16_T;
    ^
In file included from ../../../Source/Hierarchy/adjacency_cmg.c:13: 
In file included from /Applications/MATLAB_R2013a_Student.app/extern/include
/mex.h:58:
/Applications/MATLAB_R2013a_Student.app/extern/include/matrix.h:851:10: fatal    
error: 
  'stdlib.h' file not found
#include <stdlib.h>
     ^
1 warning and 2 errors generated.

mex: compile of ' "../../../Source/Hierarchy/adjacency_cmg.c"' failed.
peterh
  • 11,875
  • 18
  • 85
  • 108
aregak
  • 137
  • 4
  • 9
  • It looks like you don't have any development tools installed on your Mac OS. Did you install the Command Line Tools for Mac OS? Go here: https://developer.apple.com/xcode/downloads/ - then go to Additional Tools. You'll need to log in with your Apple ID to access them. Also, that `CHAR16_T` error is a known problem on Mac OS. Check out chappjc's solution here: http://stackoverflow.com/questions/22367516/mex-compile-error-unknown-type-name-char16-t – rayryeng Mar 11 '15 at 07:36
  • Thanks a lot! I did those steps, but now I am getting this error. Any idea how I can fix it. Thanks `/Applications/MATLAB_R2012a.app/bin/mex: line 305: gcc-4.2: command not found` `/Applications/MATLAB_R2012a.app/bin/mex: line 1326: gcc-4.2: command not found` `mex: compile of ' "../../../Source/Hierarchy/adjacency_cmg.c"' failed.` – aregak Mar 12 '15 at 00:40
  • You still haven't installed the developer tools. `gcc` is the C compiler and you get that with the development tools. – rayryeng Mar 12 '15 at 17:08
  • I think I did though. They are all in the directory /Library/Developer/CommandLineTools/usr/bin – aregak Mar 14 '15 at 02:18
  • Hmm.... You might need to add that path to your `$PATH` variable in your `.bashrc` file. In your Terminal, if you type in `gcc`, what does it say? – rayryeng Mar 14 '15 at 02:19
  • When I just put gcc, it says clang: error: no input files – aregak Mar 14 '15 at 02:24
  • OK. Looks like you do have it. I'm not sure what it is then I'll have to get back to you – rayryeng Mar 14 '15 at 02:25

0 Answers0