【问题标题】:installing liblinear in octave on windows在 Windows 上以 octave 安装 liblinear
【发布时间】:2012-09-15 07:15:22
【问题描述】:

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

../blas.o:在函数dscal_': C:\Octave\liblinear-1.91\matlab/../blas/dscal.c:4: multiple definition ofdscal_' ../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 ofdscal_' ../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 ofdscal_' ../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 functionTRON' 的多重定义: 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 ofTRON::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 ofTRON::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 functionTRON' 的多重定义: 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 functiondo_cross_validation'的多重定义: C:\Octave\liblinear-1.91\matlab/train.c:86: 未定义对cross_validation' train.o: In functionparse_command_line' 的引用: C:\Octave\liblinear-1.91\matlab/train.c:212:未定义对set_print_string_function' train.o: In functionmexFunction' 的引用: C:\Octave\liblinear-1.91\matlab/train.c:374: 未定义对check_parameter' C:\Octave\liblinear-1.91\matlab/train.c:380: undefined reference todestroy_param' 的引用 C:\Octave\liblinear-1.91\matlab/train.c:368: 未定义对destroy_param' C:\Octave\liblinear-1.91\matlab/train.c:357: undefined reference todestroy_param' 的引用 C:\Octave\liblinear-1.91\matlab/train.c:405: 未定义对destroy_param' C:\Octave\liblinear-1.91\matlab/train.c:399: undefined reference totrain' 的引用 C:\Octave\liblinear-1.91\matlab/train.c:403: 未定义引用free_and_destroy_model' ...o:tron.cpp:(.text+0x166): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x188): 未定义引用ddot_' ...o:tron.cpp:(.text+0x1da): undefined reference toddot_' ...o:tron.cpp:(.text+0x209): 未定义引用daxpy_' ...o:tron.cpp:(.text+0x220): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x261): 未定义对daxpy_' ...o:tron.cpp:(.text+0x279): undefined reference toddot_' 的引用 ...o:tron.cpp:(.text+0x2c5): 未定义引用daxpy_' ...o:tron.cpp:(.text+0x2dd): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x368): 未定义引用daxpy_' ...o:tron.cpp:(.text+0x387): undefined reference toddot_' ...o:tron.cpp:(.text+0x3aa): 未定义引用 ddot_' ...o:tron.cpp:(.text+0x3c6): undefined reference toddot_' ...o:tron.cpp:(.text+0x440): 未定义对daxpy_' ...o:tron.cpp:(.text+0x46e): undefined reference todaxpy_' 的引用 ...o:tron.cpp:(.text+0x5df): 未定义引用 dnrm2_' ...o:tron.cpp:(.text+0x754): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x78f): 未定义引用ddot_' ...o:tron.cpp:(.text+0x7ca): undefined reference toddot_' ...o:tron.cpp:(.text+0x828): 未定义引用dnrm2_' ...o:tron.cpp:(.text+0xaf2): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x166): 未定义引用dnrm2_' ...o:tron.cpp:(.text+0x188): undefined reference toddot_' ...o:tron.cpp:(.text+0x1da): 未定义对ddot_' ...o:tron.cpp:(.text+0x209): undefined reference todaxpy_' 的引用 ...o:tron.cpp:(.text+0x220): 未定义对 dnrm2_' ...o:tron.cpp:(.text+0x261): undefined reference todaxpy_' 的引用 ...o:tron.cpp:(.text+0x279): 未定义引用 ddot_' ...o:tron.cpp:(.text+0x2c5): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x2dd): 未定义引用 dnrm2_' ...o:tron.cpp:(.text+0x368): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x387): 未定义引用ddot_' ...o:tron.cpp:(.text+0x3aa): undefined reference toddot_' ...o:tron.cpp:(.text+0x3c6): 未定义引用 ddot_' ...o:tron.cpp:(.text+0x440): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x46e): 未定义引用 daxpy_' ...o:tron.cpp:(.text+0x5df): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x754): 未定义引用daxpy_' ...o:tron.cpp:(.text+0x78f): undefined reference toddot_' ...o:tron.cpp:(.text+0x7ca): 未定义对ddot_' ...o:tron.cpp:(.text+0x828): undefined reference todnrm2_' 的引用 ...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 ofdscal_' ../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 ofdscal_' ../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 ofdscal_' ../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 functionTRON' 的多重定义: 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 ofTRON::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 ofTRON::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 functionTRON' 的多重定义: 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 functiondo_predict'的多重定义: C:\Octave\liblinear-1.91\matlab/predict.c:71: 未定义对get_nr_class' C:\Octave\liblinear-1.91\matlab/predict.c:81: undefined reference toget_nr_feature' 的引用 C:\Octave\liblinear-1.91\matlab/predict.c:147: 未定义引用 predict_probability' C:\Octave\liblinear-1.91\matlab/predict.c:155: undefined reference topredict_values' predict.o:在函数mexFunction': C:\Octave\liblinear-1.91\matlab/predict.c:288: undefined reference tofree_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 tocheck_probability_model' ...o:tron.cpp:(.text+0x166): 未定义引用dnrm2_' ...o:tron.cpp:(.text+0x188): undefined reference toddot_' ...o:tron.cpp:(.text+0x1da): 未定义引用 ddot_' ...o:tron.cpp:(.text+0x209): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x220): 未定义引用 dnrm2_' ...o:tron.cpp:(.text+0x261): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x279): 未定义引用 ddot_' ...o:tron.cpp:(.text+0x2c5): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x2dd): 未定义引用 dnrm2_' ...o:tron.cpp:(.text+0x368): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x387): 未定义引用ddot_' ...o:tron.cpp:(.text+0x3aa): undefined reference toddot_' ...o:tron.cpp:(.text+0x3c6): 未定义对ddot_' ...o:tron.cpp:(.text+0x440): undefined reference todaxpy_' 的引用 ...o:tron.cpp:(.text+0x46e): 未定义引用 daxpy_' ...o:tron.cpp:(.text+0x5df): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x754): 未定义引用daxpy_' ...o:tron.cpp:(.text+0x78f): undefined reference toddot_' ...o:tron.cpp:(.text+0x7ca): 未定义引用ddot_' ...o:tron.cpp:(.text+0x828): undefined reference todnrm2_' ...o:tron.cpp:(.text+0xaf2): 未定义引用dnrm2_' ...o:tron.cpp:(.text+0x166): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x188): 未定义引用ddot_' ...o:tron.cpp:(.text+0x1da): undefined reference toddot_' ...o:tron.cpp:(.text+0x209): 未定义对daxpy_' ...o:tron.cpp:(.text+0x220): undefined reference todnrm2_' 的引用 ...o:tron.cpp:(.text+0x261): 未定义引用daxpy_' ...o:tron.cpp:(.text+0x279): undefined reference toddot_' ...o:tron.cpp:(.text+0x2c5): 未定义引用daxpy_' ...o:tron.cpp:(.text+0x2dd): undefined reference todnrm2_' ...o:tron.cpp:(.text+0x368): 未定义引用daxpy_' ...o:tron.cpp:(.text+0x387): undefined reference toddot_' ...o:tron.cpp:(.text+0x3aa): 未定义引用 ddot_' ...o:tron.cpp:(.text+0x3c6): undefined reference toddot_' ...o:tron.cpp:(.text+0x440): 未定义对daxpy_' ...o:tron.cpp:(.text+0x46e): undefined reference todaxpy_' 的引用 ...o:tron.cpp:(.text+0x5df): 未定义引用 dnrm2_' ...o:tron.cpp:(.text+0x754): undefined reference todaxpy_' ...o:tron.cpp:(.text+0x78f): 未定义对ddot_' ...o:tron.cpp:(.text+0x7ca): undefined reference toddot_' 的引用 ...o:tron.cpp:(.text+0x828): 未定义引用dnrm2_' ...o:tron.cpp:(.text+0xaf2): undefined reference todnrm2_' collect2: ld 返回 1 个退出状态 警告:无法在预期位置找到 mkoctfile:`C:\Octave\Octave3.6.2_gcc4.6.2\bin\mkoctfile-3.6.2' 警告:mkoctfile 以失败状态退出

请帮忙。

【问题讨论】:

  • 您是否尝试过询问 liblinear 开发人员?

标签: octave


【解决方案1】:

从 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

【讨论】:

    【解决方案2】:

    我在 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 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-05-31
      • 2020-10-12
      • 2013-03-03
      • 2017-03-22
      • 1970-01-01
      • 1970-01-01
      • 2012-12-25
      • 1970-01-01
      相关资源
      最近更新 更多