Compiling Mex files in Mac 10.9
Show older comments
I'm trying to compile a mex file (in OS X 10.9) To be more specific, I'm trying to install the function SVMStruct (from http://www.robots.ox.ac.uk/~vedaldi/code/svm-struct-matlab.html#ssvm.download) but lack of mex command on my mac prevents from doing so. Here is the complete error message after typing
make MEX=/Applications/MATLAB_R2013a.app/bin/mex
/Applications/MATLAB_R2013a.app/bin/mex -largeArrayDims - CFLAGS='$CFLAGS -Wall' LDFLAGS='$LDFLAGS ' -outdir "build//" -c "svm_struct_api.c"
mex: - not a valid option.
Usage:
MEX [option1 ... optionN] sourcefile1 [... sourcefileN]
[objectfile1 ... objectfileN] [libraryfile1 ... libraryfileN]
Use the -help option for more information, or consult the MATLAB External Interfaces Guide.
make: *** [build//svm_struct_api.o] Error 1
And this is the error message I receive when typing
make MEX=/Applications/MATLAB_R2013a.app/bin/mex ARCH=maci64
/Applications/MATLAB_R2013a.app/bin/mex -largeArrayDims -maci64 CFLAGS='$CFLAGS -m64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.4 -Wall' LDFLAGS='$LDFLAGS -mmacosx- version-min=10.4' -outdir "build/maci64/" -c "svm_struct_api.c"
xcrun: error: SDK "macosx10.7" cannot be located
clang: warning: no such sysroot directory: '/Developer/SDKs/MacOSX10.6.sdk'
svm_struct_api.c:20:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^
1 error generated.
mex: compile of ' "svm_struct_api.c"' failed.
make: *** [build/maci64/svm_struct_api.o] Error 1
The error talks about Mac OS X 10.6 and 10.7 but I'm using 10.9.
Accepted Answer
More Answers (1)
psr
on 3 Dec 2016
0 votes
This solution still works for me on Matlab R2015b on MacOSierra
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!