Trouble Installing libsvm on MacOSX 10.10.5 MATLAB R2013a with XCode7.0.1

2 views (last 30 days)
Hi there,
I am trying to setup libsvm for mac version of MATLAB R2013a. I have XCode 7.0.1 as C and C++ compiler. I have trouble setting up the libsvm library. I have used the commands as directed in the README file of the MATLAB LIBSVM however I havent got any results. Upon running
mex -setup
I get this result
mex -setup
Options files control which compiler to use, the compiler and link command
options, and the runtime libraries to link against.
Using the 'mex -setup' command selects an options file that is
placed in /Users/OP/.matlab/R2013a and used by default for 'mex'. An options
file in the current working directory or specified on the command line
overrides the default options file in /Users/OP/.matlab/R2013a.
To override the default options file, use the 'mex -f' command
(see 'mex -help' for more information).
The options files available for mex are:
1: /Applications/MATLAB.app/bin/mexopts.sh :
Template Options file for building MEX-files
0: Exit with no changes
Enter the number of the compiler (0-1):
1
Overwrite /Users/OP/.matlab/R2013a/mexopts.sh ([y]/n)?
y
/Applications/MATLAB.app/bin/mexopts.sh is being copied to
/Users/OP/.matlab/R2013a/mexopts.sh
**************************************************************************
Warning: The MATLAB C and Fortran API has changed to support MATLAB
variables with more than 2^32-1 elements. In the near future
you will be required to update your code to utilize the new
API. You can find more information about this at:
http://www.mathworks.com/help/matlab/matlab_external/upgrading-mex-files-to-use-64-bit-api.html
Building with the -largeArrayDims option enables the new API.
**************************************************************************
I have also configured the Makefile as
MATLABDIR ?= /Users/OP/Applications/MATLAB
Now when I try to run make I get this error
>> make
xcodebuild: error: SDK "macosx10.10" cannot be located.
xcrun: error: unable to find utility "clang", not a developer tool or in PATH
mex: compile of ' "libsvmread.c"' failed.
If make.m fails, please check README about detailed instructions.
After which I have no idea how to configure this out, So anyhelp is much appreciated.
Many Thanks

Accepted Answer

Walter Roberson
Walter Roberson on 22 Oct 2015
See http://www.mathworks.com/matlabcentral/answers/243868-mex-can-t-find-compiler-after-xcode-7-update-r2015b except that you have to change the files to use SDK10.11 rather than SDK10.10 for the new XCode 7.1 release.
  1 Comment
Omer
Omer on 22 Oct 2015
Just to add the procedure for other people, after line 119 or maci64 in mexopts.sh file, you need to change
macosx10.7
or if you have
macosx10.10
to
macosx10.11
for rest of the lines in the file.
As explained by the process here
you may not have mexopt directory as indicated by the fourth step
>> cd( fullfile(matlabroot,'bin','maci64','mexopts'));
Therefore, just create mexopts folder in maci64 folder of bin and move the files of xcode7_mexopts in that folder. After that go to mexopts.sh file using
cd(matlabroot)
cd bin
edit mexopts.sh
in the command window of MATLAB and change line 137 to
CFLAGS="$CFLAGS -fexceptions -Dchar16_t=UINT16_T"
Also change line 150 to
CXXFLAGS="-fno-common -fexceptions -arch $ARCHS -isysroot $MW_SDKROOT -mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET -std=c++11"
And recompile mex -setup and make file. It will create relevant mex files for the libsvm.

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB Compiler 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!