Reputation: 2744
i am trying to install liblinear 1.91 in octave 3.6.2 on windows 7. octave is a clean mingw install without extra packages except for libsvm 3.12. please note libsvm installed without a problem by running make.m from octave. however when i try the same for liblinear i get:
../blas.o: In function
dscal_': C:\Octave\liblinear-1.91\matlab/../blas/dscal.c:4: multiple definition of
dscal_' ../blas.o:C:\Octave\liblinear-1.91\matlab/../blas/dscal.c:4: first defined here ../blas.o: In functiondscal_': C:\Octave\liblinear-1.91\matlab/../blas/dscal.c:4: multiple definition of
dscal_' ../blas.o:C:\Octave\liblinear-1.91\matlab/../blas/dscal.c:4: first defined here ../blas.o: In functiondscal_': C:\Octave\liblinear-1.91\matlab/../blas/dscal.c:4: multiple definition of
dscal_' ../blas.o:C:\Octave\liblinear-1.91\matlab/../blas/dscal.c:4: first defined here ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:35: multiple definition ofTRON::info(char const*, ...)' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:35: first defined here ...o: In function
TRON': C:\Octave\liblinear-1.91\matlab/../tron.cpp:44: multiple definition ofTRON::TRON(function const*, double, int)' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:44: first defined here ...o: In function
~TRON': C:\Octave\liblinear-1.91\matlab/../tron.cpp:54: multiple definition ofTRON::~TRON()' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:54: first defined here ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:161: multiple definition of
TRON::trcg(double, double*, double*, doubl e*)' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:161: first defined here ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:57: multiple definition ofTRON::tron(double*)' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:57: first defined here ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:224: multiple definition of
TRON::norm_inf(int, double*)' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:224: first defined here ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:234: multiple definition ofTRON::set_print_string(void (*)(char const *))' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:234: first defined here ...o: In function
TRON': C:\Octave\liblinear-1.91\matlab/../tron.cpp:44: multiple definition ofTRON::TRON(function const*, double, int)' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:44: first defined here ...o: In function
~TRON': C:\Octave\liblinear-1.91\matlab/../tron.cpp:54: multiple definition ofTRON::~TRON()' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:54: first defined here train.o: In function
do_cross_validation': C:\Octave\liblinear-1.91\matlab/train.c:86: undefined reference tocross_validation' train.o: In function
parse_command_line': C:\Octave\liblinear-1.91\matlab/train.c:212: undefined reference toset_print_string_function' train.o: In function
mexFunction': C:\Octave\liblinear-1.91\matlab/train.c:374: undefined reference tocheck_parameter' C:\Octave\liblinear-1.91\matlab/train.c:380: undefined reference to
destroy_param' C:\Octave\liblinear-1.91\matlab/train.c:368: undefined reference todestroy_param' C:\Octave\liblinear-1.91\matlab/train.c:357: undefined reference to
destroy_param' C:\Octave\liblinear-1.91\matlab/train.c:405: undefined reference todestroy_param' C:\Octave\liblinear-1.91\matlab/train.c:399: undefined reference to
train' C:\Octave\liblinear-1.91\matlab/train.c:403: undefined reference tofree_and_destroy_model' ...o:tron.cpp:(.text+0x166): undefined reference to
dnrm2_' ...o:tron.cpp:(.text+0x188): undefined reference toddot_' ...o:tron.cpp:(.text+0x1da): undefined reference to
ddot_' ...o:tron.cpp:(.text+0x209): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x220): undefined reference to
dnrm2_' ...o:tron.cpp:(.text+0x261): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x279): undefined reference to
ddot_' ...o:tron.cpp:(.text+0x2c5): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x2dd): undefined reference to
dnrm2_' ...o:tron.cpp:(.text+0x368): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x387): undefined reference to
ddot_' ...o:tron.cpp:(.text+0x3aa): undefined reference toddot_' ...o:tron.cpp:(.text+0x3c6): undefined reference to
ddot_' ...o:tron.cpp:(.text+0x440): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x46e): undefined reference to
daxpy_' ...o:tron.cpp:(.text+0x5df): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x754): undefined reference to
daxpy_' ...o:tron.cpp:(.text+0x78f): undefined reference toddot_' ...o:tron.cpp:(.text+0x7ca): undefined reference to
ddot_' ...o:tron.cpp:(.text+0x828): undefined reference todnrm2_' ...o:tron.cpp:(.text+0xaf2): undefined reference to
dnrm2_' ...o:tron.cpp:(.text+0x166): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x188): undefined reference to
ddot_' ...o:tron.cpp:(.text+0x1da): undefined reference toddot_' ...o:tron.cpp:(.text+0x209): undefined reference to
daxpy_' ...o:tron.cpp:(.text+0x220): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x261): undefined reference to
daxpy_' ...o:tron.cpp:(.text+0x279): undefined reference toddot_' ...o:tron.cpp:(.text+0x2c5): undefined reference to
daxpy_' ...o:tron.cpp:(.text+0x2dd): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x368): undefined reference to
daxpy_' ...o:tron.cpp:(.text+0x387): undefined reference toddot_' ...o:tron.cpp:(.text+0x3aa): undefined reference to
ddot_' ...o:tron.cpp:(.text+0x3c6): undefined reference toddot_' ...o:tron.cpp:(.text+0x440): undefined reference to
daxpy_' ...o:tron.cpp:(.text+0x46e): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x5df): undefined reference to
dnrm2_' ...o:tron.cpp:(.text+0x754): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x78f): undefined reference to
ddot_' ...o:tron.cpp:(.text+0x7ca): undefined reference toddot_' ...o:tron.cpp:(.text+0x828): undefined reference to
dnrm2_' ...o:tron.cpp:(.text+0xaf2): undefined reference todnrm2_' collect2: ld returned 1 exit status warning: unable to find mkoctfile in expected location:
C:\Octave\Octave3.6.2_gcc4.6.2\bin\mkoctfile-3.6.2' warning: mkoctfile exited with failure status ../blas.o: In functiondscal_': C:\Octave\liblinear-1.91\matlab/../blas/dscal.c:4: multiple definition of
dscal_' ../blas.o:C:\Octave\liblinear-1.91\matlab/../blas/dscal.c:4: first defined here ../blas.o: In functiondscal_': C:\Octave\liblinear-1.91\matlab/../blas/dscal.c:4: multiple definition of
dscal_' ../blas.o:C:\Octave\liblinear-1.91\matlab/../blas/dscal.c:4: first defined here ../blas.o: In functiondscal_': C:\Octave\liblinear-1.91\matlab/../blas/dscal.c:4: multiple definition of
dscal_' ../blas.o:C:\Octave\liblinear-1.91\matlab/../blas/dscal.c:4: first defined here ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:35: multiple definition ofTRON::info(char const*, ...)' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:35: first defined here ...o: In function
TRON': C:\Octave\liblinear-1.91\matlab/../tron.cpp:44: multiple definition ofTRON::TRON(function const*, double, int)' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:44: first defined here ...o: In function
~TRON': C:\Octave\liblinear-1.91\matlab/../tron.cpp:54: multiple definition ofTRON::~TRON()' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:54: first defined here ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:161: multiple definition of
TRON::trcg(double, double*, double*, doubl e*)' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:161: first defined here ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:57: multiple definition ofTRON::tron(double*)' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:57: first defined here ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:224: multiple definition of
TRON::norm_inf(int, double*)' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:224: first defined here ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:234: multiple definition ofTRON::set_print_string(void (*)(char const *))' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:234: first defined here ...o: In function
TRON': C:\Octave\liblinear-1.91\matlab/../tron.cpp:44: multiple definition ofTRON::TRON(function const*, double, int)' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:44: first defined here ...o: In function
~TRON': C:\Octave\liblinear-1.91\matlab/../tron.cpp:54: multiple definition ofTRON::~TRON()' ...o:C:\Octave\liblinear-1.91\matlab/../tron.cpp:54: first defined here predict.o: In function
do_predict': C:\Octave\liblinear-1.91\matlab/predict.c:71: undefined reference toget_nr_class' C:\Octave\liblinear-1.91\matlab/predict.c:81: undefined reference to
get_nr_feature' C:\Octave\liblinear-1.91\matlab/predict.c:147: undefined reference topredict_probability' C:\Octave\liblinear-1.91\matlab/predict.c:155: undefined reference to
predict_values' predict.o: In functionmexFunction': C:\Octave\liblinear-1.91\matlab/predict.c:288: undefined reference to
free_and_destroy_model' C:\Octave\liblinear-1.91\matlab/predict.c:312: undefined reference tofree_and_destroy_model' C:\Octave\liblinear-1.91\matlab/predict.c:295: undefined reference to
check_probability_model' ...o:tron.cpp:(.text+0x166): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x188): undefined reference to
ddot_' ...o:tron.cpp:(.text+0x1da): undefined reference toddot_' ...o:tron.cpp:(.text+0x209): undefined reference to
daxpy_' ...o:tron.cpp:(.text+0x220): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x261): undefined reference to
daxpy_' ...o:tron.cpp:(.text+0x279): undefined reference toddot_' ...o:tron.cpp:(.text+0x2c5): undefined reference to
daxpy_' ...o:tron.cpp:(.text+0x2dd): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x368): undefined reference to
daxpy_' ...o:tron.cpp:(.text+0x387): undefined reference toddot_' ...o:tron.cpp:(.text+0x3aa): undefined reference to
ddot_' ...o:tron.cpp:(.text+0x3c6): undefined reference toddot_' ...o:tron.cpp:(.text+0x440): undefined reference to
daxpy_' ...o:tron.cpp:(.text+0x46e): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x5df): undefined reference to
dnrm2_' ...o:tron.cpp:(.text+0x754): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x78f): undefined reference to
ddot_' ...o:tron.cpp:(.text+0x7ca): undefined reference toddot_' ...o:tron.cpp:(.text+0x828): undefined reference to
dnrm2_' ...o:tron.cpp:(.text+0xaf2): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x166): undefined reference to
dnrm2_' ...o:tron.cpp:(.text+0x188): undefined reference toddot_' ...o:tron.cpp:(.text+0x1da): undefined reference to
ddot_' ...o:tron.cpp:(.text+0x209): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x220): undefined reference to
dnrm2_' ...o:tron.cpp:(.text+0x261): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x279): undefined reference to
ddot_' ...o:tron.cpp:(.text+0x2c5): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x2dd): undefined reference to
dnrm2_' ...o:tron.cpp:(.text+0x368): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x387): undefined reference to
ddot_' ...o:tron.cpp:(.text+0x3aa): undefined reference toddot_' ...o:tron.cpp:(.text+0x3c6): undefined reference to
ddot_' ...o:tron.cpp:(.text+0x440): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x46e): undefined reference to
daxpy_' ...o:tron.cpp:(.text+0x5df): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x754): undefined reference to
daxpy_' ...o:tron.cpp:(.text+0x78f): undefined reference toddot_' ...o:tron.cpp:(.text+0x7ca): undefined reference to
ddot_' ...o:tron.cpp:(.text+0x828): undefined reference todnrm2_' ...o:tron.cpp:(.text+0xaf2): undefined reference to
dnrm2_' collect2: ld returned 1 exit status warning: unable to find mkoctfile in expected location: `C:\Octave\Octave3.6.2_gcc4.6.2\bin\mkoctfile-3.6.2' warning: mkoctfile exited with failure status
please help.
Upvotes: 1
Views: 1132
Reputation: 243
I am using octave 3.6.2 with Visual Studio 2010.
I first followed the instructions here to get libsvm working: http://flyingpies.wordpress.com/2012/11/20/getting-libsvm-to-work-with-octave-on-windows/
To get liblinear compiled, run octave with visual studio environment variables (see link above), cd to the liblinear directory, and run these commands:
mex -c 'linear.cpp'
mex -c 'tron.cpp'
cd blas
mex -c 'daxpy.c'
mex -c 'ddot.c'
mex -c 'dnrm2.c'
mex -c 'dscal.c'
cd ..\matlab
mex -DMX_API_VER=0x07030000 -c linear_model_matlab.c -I..\\
mex -DMX_API_VER=0x07030000 train.c -I..\\ '..\tron.o' '..\linear.o' 'linear_model_matlab.o' '..\blas\daxpy.o' '..\blas\ddot.o' '..\blas\dnrm2.o' '..\blas\dscal.o'
mex -DMX_API_VER=0x07030000 predict.c -I..\\ '..\tron.o' '..\linear.o' 'linear_model_matlab.o' '..\blas\daxpy.o' '..\blas\ddot.o' '..\blas\dnrm2.o' '..\blas\dscal.o'
mex -DMX_API_VER=0x07030000 libsvmread.c
mex -DMX_API_VER=0x07030000 libsvmwrite.c
Upvotes: 1
Reputation: 2744
starting from the liblinear-1.91/matlab folder, this compiles for me:
cd ..
mex -c linear.cpp
mex -c tron.cpp
cd blas
mex -c *.c
cd ../matlab
mex libsvmread.c
mex libsvmwrite.c
mex train.c linear_model_matlab.c ../linear.o ../tron.o ../blas/*.o
mex predict.c linear_model_matlab.c ../linear.o ../tron.o ../blas/*.o
Upvotes: 3