2015-04-16 16 views
1

我從here下載了源代碼。當我運行make,我得到了以下錯誤消息:如何在Ubuntu上構建SVMstruct Python模塊

make: Entering directory `/home/christopher/SourceCode/svm-python-v204' 
cd svm_light; make svm_learn_hideo_noexe 
make[1]: Entering directory `/home/christopher/SourceCode/svm-python-v204/svm_light' 
make[1]: Nothing to be done for `svm_learn_hideo_noexe'. 
make[1]: Leaving directory `/home/christopher/SourceCode/svm-python-v204/svm_light' 
cd svm_struct; make svm_struct_noexe 
make[1]: Entering directory `/home/christopher/SourceCode/svm-python-v204/svm_struct' 
make[1]: Nothing to be done for `svm_struct_noexe'. 
make[1]: Leaving directory `/home/christopher/SourceCode/svm-python-v204/svm_struct' 
gcc -g -lm svm_struct/svm_struct_learn.o svm_struct_api.o svm_light/svm_hideo.o svm_light/svm_learn.o svm_light/svm_common.o svm_struct/svm_struct_common.o svm_struct/svm_struct_main.o pyobjs/array.o pyobjs/constraints.o pyobjs/default.o pyobjs/document.o pyobjs/kernelparm.o pyobjs/model.o pyobjs/sample.o pyobjs/sparm.o pyobjs/sparse.o pyobjs/structmodel.o pyobjs/svmapi.o -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -o svm_python_learn 
/usr/bin/ld: svm_light/svm_common.o: undefined reference to symbol 'exp@@GLIBC_2.2.5' 
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libm.so: error adding symbols: DSO missing from command line 
collect2: error: ld returned 1 exit status 
make: *** [svm_python_learn_hideo] Error 1 
make: Leaving directory `/home/christopher/SourceCode/svm-python-v204' 
[email protected]:~/SourceCode/svm-python-v204-build$ make -C ./../svm-python-v204 
make: Entering directory `/home/christopher/SourceCode/svm-python-v204' 
cd svm_light; make svm_learn_hideo_noexe 
make[1]: Entering directory `/home/christopher/SourceCode/svm-python-v204/svm_light' 
make[1]: Nothing to be done for `svm_learn_hideo_noexe'. 
make[1]: Leaving directory `/home/christopher/SourceCode/svm-python-v204/svm_light' 
cd svm_struct; make svm_struct_noexe 
make[1]: Entering directory `/home/christopher/SourceCode/svm-python-v204/svm_struct' 
make[1]: Nothing to be done for `svm_struct_noexe'. 
make[1]: Leaving directory `/home/christopher/SourceCode/svm-python-v204/svm_struct' 
gcc -g -lm svm_struct/svm_struct_learn.o svm_struct_api.o svm_light/svm_hideo.o svm_light/svm_learn.o svm_light/svm_common.o svm_struct/svm_struct_common.o svm_struct/svm_struct_main.o pyobjs/array.o pyobjs/constraints.o pyobjs/default.o pyobjs/document.o pyobjs/kernelparm.o pyobjs/model.o pyobjs/sample.o pyobjs/sparm.o pyobjs/sparse.o pyobjs/structmodel.o pyobjs/svmapi.o -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -o svm_python_learn 
/usr/bin/ld: svm_light/svm_common.o: undefined reference to symbol '[email protected]@GLIBC_2.2.5' 
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libm.so: error adding symbols: DSO missing from command line 
collect2: error: ld returned 1 exit status 
make: *** [svm_python_learn_hideo] Error 1 
make: Leaving directory `/home/christopher/SourceCode/svm-python-v204' 

一切是相當「開箱即用」,所以我懷疑這是一個Ubuntu的問題。特別是,我懷疑glibc的是過時的,從

undefined reference to symbol '[email protected]@GLIBC_2.2.5' 

當我嘗試/lib/x86_64-linux-gnu/libc.so.6,我得到

GNU C Library (Ubuntu EGLIBC 2.19-0ubuntu6.6) stable release version 2.19 

最新版本是2.2.5,但eglibc,這似乎是Ubuntu的用戶如何得到glibc,沒有2.2 branch。我已經試過apt-get upgrade,但我仍然在版本2.19。我該怎麼做才能解決這個問題?


截至2014年,Debian似乎已經迴歸glibc。

回答

1

在MakeFile的頂部附近添加LIBS=-lm與數學庫鏈接,解決了我的問題。