在Windows上以八度方式安装liblinear

时间:2012-09-23 17:48:16

标签: octave

我正在尝试在Windows 7上的octave 3.6.2中安装liblinear 1.91。 octave是一个干净的mingw安装,没有额外的包,除了libsvm 3.12。 请注意通过从八度运行make.m安装libsvm没有问题。 然而,当我为liblinear尝试相同的时候,我得到:

  

../ blas.o:在函数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:首先在这里定义   ../blas.o:在函数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:首先在这里定义   ../blas.o:在函数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:首先在这里定义   ... o:C:\ Octave \ liblinear-1.91 \ matlab /../ tron.cpp:35: TRON::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: TRON::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: TRON::~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:首先在这里定义   ... o:C:\ Octave \ liblinear-1.91 \ matlab /../ tron.cpp:57: TRON::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:首先在这里定义   ... o:C:\ Octave \ liblinear-1.91 \ matlab /../ tron.cpp:234:TRON::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: TRON::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: TRON::~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:未定义引用cross_validation' train.o: In function parse_command_line':   C:\ Octave \ liblinear-1.91 \ matlab / train.c:212:未定义引用set_print_string_function' train.o: In function mexFunction':   C:\ Octave \ liblinear-1.91 \ matlab / train.c:374:未定义引用check_parameter' C:\Octave\liblinear-1.91\matlab/train.c:380: undefined reference to destroy_param'   C:\ Octave \ liblinear-1.91 \ matlab / train.c:368:未定义引用destroy_param' C:\Octave\liblinear-1.91\matlab/train.c:357: undefined reference to destroy_param'   C:\ Octave \ liblinear-1.91 \ matlab / train.c:405:未定义引用destroy_param' C:\Octave\liblinear-1.91\matlab/train.c:399: undefined reference to列车'   C:\ Octave \ liblinear-1.91 \ matlab / train.c:403:未定义引用free_and_destroy_model' ...o:tron.cpp:(.text+0x166): undefined reference to dnrm2 _'   ... o:tron.cpp :(。text + 0x188):对ddot_' ...o:tron.cpp:(.text+0x1da): undefined reference to ddot _'的未定义引用   ... o:tron.cpp :(。text + 0x209):对daxpy_' ...o:tron.cpp:(.text+0x220): undefined reference to dnrm2 _'的未定义引用   ... o:tron.cpp :(。text + 0x261):对daxpy_' ...o:tron.cpp:(.text+0x279): undefined reference to ddot _'的未定义引用   ... o:tron.cpp :(。text + 0x2c5):未定义引用daxpy_' ...o:tron.cpp:(.text+0x2dd): undefined reference to dnrm2 _'   ... o:tron.cpp :(。text + 0x368):对daxpy_' ...o:tron.cpp:(.text+0x387): undefined reference to ddot _'的未定义引用   ... o:tron.cpp :(。text + 0x3aa):对ddot_' ...o:tron.cpp:(.text+0x3c6): undefined reference to ddot _'的未定义引用   ... o:tron.cpp :(。text + 0x440):对daxpy_' ...o:tron.cpp:(.text+0x46e): undefined reference to daxpy _'的未定义引用   ... o:tron.cpp :(。text + 0x5df):对dnrm2_' ...o:tron.cpp:(.text+0x754): undefined reference to daxpy _'的未定义引用   ... o:tron.cpp :(。text + 0x78f):对ddot_' ...o:tron.cpp:(.text+0x7ca): undefined reference to ddot _'的未定义引用   ... o:tron.cpp :(。text + 0x828):未定义引用dnrm2_' ...o:tron.cpp:(.text+0xaf2): undefined reference to dnrm2 _'   ... o:tron.cpp :(。text + 0x166):对dnrm2_' ...o:tron.cpp:(.text+0x188): undefined reference to ddot _'的未定义引用   ... o:tron.cpp :(。text + 0x1da):对ddot_' ...o:tron.cpp:(.text+0x209): undefined reference to daxpy _'的未定义引用   ... o:tron.cpp :(。text + 0x220):对dnrm2_' ...o:tron.cpp:(.text+0x261): undefined reference to daxpy _'的未定义引用   ... o:tron.cpp :(。text + 0x279):对ddot_' ...o:tron.cpp:(.text+0x2c5): undefined reference to daxpy _'的未定义引用   ... o:tron.cpp :(。text + 0x2dd):对dnrm2_' ...o:tron.cpp:(.text+0x368): undefined reference to daxpy _'的未定义引用   ... o:tron.cpp :(。text + 0x387):对ddot_' ...o:tron.cpp:(.text+0x3aa): undefined reference to ddot _'的未定义引用   ... o:tron.cpp :(。text + 0x3c6):对ddot_' ...o:tron.cpp:(.text+0x440): undefined reference to daxpy _'的未定义引用   ... o:tron.cpp :(。text + 0x46e):未定义引用daxpy_' ...o:tron.cpp:(.text+0x5df): undefined reference to dnrm2 _'   ... o:tron.cpp :(。text + 0x754):对daxpy_' ...o:tron.cpp:(.text+0x78f): undefined reference to ddot _'的未定义引用   ... o:tron.cpp :(。text + 0x7ca):对ddot_' ...o:tron.cpp:(.text+0x828): undefined reference to dnrm2 _'的未定义引用   ... o:tron.cpp :(。text + 0xaf2):未定义引用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'   警告:mkoctfile退出并显示失败状态   ../blas.o:在函数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:首先在这里定义   ../blas.o:在函数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:首先在这里定义   ../blas.o:在函数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:首先在这里定义   ... o:C:\ Octave \ liblinear-1.91 \ matlab /../ tron.cpp:35: TRON::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: TRON::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: TRON::~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:首先在这里定义   ... o:C:\ Octave \ liblinear-1.91 \ matlab /../ tron.cpp:57: TRON::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:首先在这里定义   ... o:C:\ Octave \ liblinear-1.91 \ matlab /../ tron.cpp:234:TRON::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: TRON::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: TRON::~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:未定义引用get_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:对predict_probability' C:\Octave\liblinear-1.91\matlab/predict.c:155: undefined reference to predict_values'的未定义引用   predict.o:在函数mexFunction': 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:未定义引用free_and_destroy_model' C:\Octave\liblinear-1.91\matlab/predict.c:295: undefined reference to check_probability_model'   ... o:tron.cpp :(。text + 0x166):对dnrm2_' ...o:tron.cpp:(.text+0x188): undefined reference to ddot _'的未定义引用   ... o:tron.cpp :(。text + 0x1da):对ddot_' ...o:tron.cpp:(.text+0x209): undefined reference to daxpy _'的未定义引用   ... o:tron.cpp :(。text + 0x220):对dnrm2_' ...o:tron.cpp:(.text+0x261): undefined reference to daxpy _'的未定义引用   ... o:tron.cpp :(。text + 0x279):对ddot_' ...o:tron.cpp:(.text+0x2c5): undefined reference to daxpy _'的未定义引用   ... o:tron.cpp :(。text + 0x2dd):对dnrm2_' ...o:tron.cpp:(.text+0x368): undefined reference to daxpy _'的未定义引用   ... o:tron.cpp :(。text + 0x387):对ddot_' ...o:tron.cpp:(.text+0x3aa): undefined reference to ddot _'的未定义引用   ... o:tron.cpp :(。text + 0x3c6):对ddot_' ...o:tron.cpp:(.text+0x440): undefined reference to daxpy _'的未定义引用   ... o:tron.cpp :(。text + 0x46e):未定义引用daxpy_' ...o:tron.cpp:(.text+0x5df): undefined reference to dnrm2 _'   ... o:tron.cpp :(。text + 0x754):对daxpy_' ...o:tron.cpp:(.text+0x78f): undefined reference to ddot _'的未定义引用   ... o:tron.cpp :(。text + 0x7ca):对ddot_' ...o:tron.cpp:(.text+0x828): undefined reference to dnrm2 _'的未定义引用   ... o:tron.cpp :(。text + 0xaf2):未定义引用dnrm2_' ...o:tron.cpp:(.text+0x166): undefined reference to dnrm2 _'   ... o:tron.cpp :(。text + 0x188):对ddot_' ...o:tron.cpp:(.text+0x1da): undefined reference to ddot _'的未定义引用   ... o:tron.cpp :(。text + 0x209):对daxpy_' ...o:tron.cpp:(.text+0x220): undefined reference to dnrm2 _'的未定义引用   ... o:tron.cpp :(。text + 0x261):对daxpy_' ...o:tron.cpp:(.text+0x279): undefined reference to ddot _'的未定义引用   ... o:tron.cpp :(。text + 0x2c5):未定义引用daxpy_' ...o:tron.cpp:(.text+0x2dd): undefined reference to dnrm2 _'   ... o:tron.cpp :(。text + 0x368):对daxpy_' ...o:tron.cpp:(.text+0x387): undefined reference to ddot _'的未定义引用   ... o:tron.cpp :(。text + 0x3aa):对ddot_' ...o:tron.cpp:(.text+0x3c6): undefined reference to ddot _'的未定义引用   ... o:tron.cpp :(。text + 0x440):对daxpy_' ...o:tron.cpp:(.text+0x46e): undefined reference to daxpy _'的未定义引用   ... o:tron.cpp :(。text + 0x5df):对dnrm2_' ...o:tron.cpp:(.text+0x754): undefined reference to daxpy _'的未定义引用   ... o:tron.cpp :(。text + 0x78f):对ddot_' ...o:tron.cpp:(.text+0x7ca): undefined reference to ddot _'的未定义引用   ... o:tron.cpp :(。text + 0x828):未定义引用dnrm2_' ...o:tron.cpp:(.text+0xaf2): undefined reference to dnrm2 _'   collect2:ld返回1退出状态   警告:无法在预期位置找到mkoctfile:`C:\ Octave \ Octave3.6.2_gcc4.6.2 \ bin \ mkoctfile-3.6.2'   警告:mkoctfile退出并显示失败状态

请帮忙。

2 个答案:

答案 0 :(得分:3)

从liblinear-1.91 / matlab文件夹开始,这为我编译:

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

答案 1 :(得分:1)

我在Visual Studio 2010中使用了octave 3.6.2。

我首先按照此处的说明运行libsvm:http://flyingpies.wordpress.com/2012/11/20/getting-libsvm-to-work-with-octave-on-windows/

要获得liblinear编译,请使用visual studio环境变量运行octave(请参阅上面的链接),cd到liblinear目录,然后运行以下命令:

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