Why do only two .c files from libsvm compile to mex files?

I am using MATLAB 2015a and have loaded libsvm 3.20. Following the instructions in README only libsvmread and libsvmwrite are changed to .mexw64 files. Here is what I have done:
>>make
Building with 'Microsoft Windows SDK 7.1 (C)'.
MEX completed successfully.
Building with 'Microsoft Windows SDK 7.1 (C)'.
MEX completed successfully.
If make.m fails, please check README about detailed instructions.
>>mex -setup
MEX configured to use 'Microsoft Windows SDK 7.1 (C)' for C language compilation.
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.
To choose a different language, select one from the following:
mex -setup C++
mex -setup FORTRAN
The above is what I see when I follow the README instructions. And only two of the files are compiled to .mexw64. I have all the up to date SDK and .NET programs installed on Windows 8.1. If I select C++ I have the same problem. Please advise.

1 Comment

Hi Craig, I have the same problem. Did you manage to resolve it? Thanks!

Sign in to comment.

Answers (1)

Hypothetically, two (or even one) mex* could be enough: each .mex* file is an object library, the equivalent of a dll if it needs to be, so all of the *.c could compile and link together into a small number of object libraries.

3 Comments

OK, but using the "which" command to see the file paths of the libsvm functions the only two that don't say 'file not found' are the two that are .mexw64. So it seems to me that MATLAB isn't recognizing svmtrain and svmpredict because they are still .c files. Maybe I'm misunderstanding how to manipulate an object library but I've tried to use the svmtrain and svmpredict function and the functions are not recognized. I tried this:
>> mex svmtrain.c
Building with 'Microsoft Windows SDK 7.1 (C)'.
Error using mex
svmtrain.c
C:\Users\craig\Documents\MATLAB\LIBSVM\matlab\svmtrain.c(5) : fatal error C1083: Cannot open include
file: '../svm.h': No such file or directory
When I open svmtrain.c in the editor I see
#include "../svm.h"
Look starting from the LIBSVM directory and indicate which directory you find svm.h in.
Did you solve it? If yes please let me know what you did. Thanks in advance

Sign in to comment.

Categories

Products

Tags

Asked:

on 6 Aug 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!