Compiling Mex files in Mac 10.9
显示 更早的评论
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.
采纳的回答
更多回答(1 个)
psr
2016-12-3
0 个投票
This solution still works for me on Matlab R2015b on MacOSierra
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!