2011-04-23 74 views
0

我一直在嘗試從源代碼安裝R包,Kernlab,但我一直在遇到問題。起初,我不得不gfortran相關的一些錯誤,所以我從網上下載http://r.research.att.com/tools/在MacOS X上從源代碼安裝Kernlab時出錯(延遲加載失敗)

的GNU C++編譯器然後當我鍵入以下命令,R CMD INSTALL kernlab_0.9-12.tar.gz

我得到出現以下錯誤:

installing to /Library/Frameworks/R.framework/Versions/2.13/Resources/library/kernlab/libs/x86_64 
** R 
** data 
** inst 
** preparing package for lazy loading 
Error in .walkClassGraph(ClassDef, "contains", where, attr(ext, "conflicts")) : 
    the "superClass" list for class "list", includes an undefined class "input" 
Error in .walkClassGraph(ClassDef, "contains", where, attr(ext, "conflicts")) : 
    the "superClass" list for class "numeric", includes an undefined class "output" 
Error : evaluation nested too deeply: infinite recursion/options(expressions=)? 
Error in setClassUnion("listI", c("list", "numeric", "vector", "integer", : 
    unable to create union class: could not set members "list", "numeric" 
Error : unable to load R code in package 'kernlab' 
ERROR: lazy loading failed for package ‘kernlab’ 
* removing ‘/Library/Frameworks/R.framework/Versions/2.13/Resources/library/kernlab’ 
* restoring previous ‘/Library/Frameworks/R.framework/Versions/2.13/Resources/library/kernlab’ 

有沒有人知道如何解決這個錯誤? PS。對於我下載的GNU fortran編譯器來說,它表示Xcode版本高達3.2.5;我有Xcode版本3.2.6。這是我的錯誤的來源,還是我看錯了方向?

回答

0

它必須與您的系統有關。在我的Linux系統中,kernlab_0.9-12精細安裝:

[email protected]:/tmp$ R CMD INSTALL kernlab_0.9-12.tar.gz 
* installing to library ‘/usr/local/lib/R/site-library’ 
* installing *source* package ‘kernlab’ ... 
** libs 
g++-4.4 -I/usr/share/R/include  -fpic -O3 -pipe -c brweight.cpp -o brweight.o 
g++-4.4 -I/usr/share/R/include  -fpic -O3 -pipe -c ctable.cpp -o ctable.o 
g++-4.4 -I/usr/share/R/include  -fpic -O3 -pipe -c cweight.cpp -o cweight.o 
gcc-4.4 -I/usr/share/R/include  -fpic -O3 -g0 -Wall -pipe -pedantic -std=gnu99 -c dbreakpt.c -o dbreakpt.o 
gcc-4.4 -I/usr/share/R/include  -fpic -O3 -g0 -Wall -pipe -pedantic -std=gnu99 -c dcauchy.c -o dcauchy.o 
gcc-4.4 -I/usr/share/R/include  -fpic -O3 -g0 -Wall -pipe -pedantic -std=gnu99 -c dgpnrm.c -o dgpnrm.o 
gcc-4.4 -I/usr/share/R/include  -fpic -O3 -g0 -Wall -pipe -pedantic -std=gnu99 -c dgpstep.c -o dgpstep.o 
gcc-4.4 -I/usr/share/R/include  -fpic -O3 -g0 -Wall -pipe -pedantic -std=gnu99 -c dprecond.c -o dprecond.o 
gcc-4.4 -I/usr/share/R/include  -fpic -O3 -g0 -Wall -pipe -pedantic -std=gnu99 -c dprsrch.c -o dprsrch.o 
gcc-4.4 -I/usr/share/R/include  -fpic -O3 -g0 -Wall -pipe -pedantic -std=gnu99 -c dspcg.c -o dspcg.o 
gcc-4.4 -I/usr/share/R/include  -fpic -O3 -g0 -Wall -pipe -pedantic -std=gnu99 -c dtron.c -o dtron.o 
gcc-4.4 -I/usr/share/R/include  -fpic -O3 -g0 -Wall -pipe -pedantic -std=gnu99 -c dtrpcg.c -o dtrpcg.o 
dtrpcg.c: In function ‘dtrpcg’: 
dtrpcg.c:157: warning: value computed is not used 
gcc-4.4 -I/usr/share/R/include  -fpic -O3 -g0 -Wall -pipe -pedantic -std=gnu99 -c dtrqsol.c -o dtrqsol.o 
g++-4.4 -I/usr/share/R/include  -fpic -O3 -pipe -c esa.cpp -o esa.o 
g++-4.4 -I/usr/share/R/include  -fpic -O3 -pipe -c expdecayweight.cpp -o expdecayweight.o 
g++-4.4 -I/usr/share/R/include  -fpic -O3 -pipe -c inductionsort.cpp -o inductionsort.o 
g++-4.4 -I/usr/share/R/include  -fpic -O3 -pipe -c kspectrumweight.cpp -o kspectrumweight.o 
g++-4.4 -I/usr/share/R/include  -fpic -O3 -pipe -c lcp.cpp -o lcp.o 
gcc-4.4 -I/usr/share/R/include  -fpic -O3 -g0 -Wall -pipe -pedantic -std=gnu99 -c misc.c -o misc.o 
g++-4.4 -I/usr/share/R/include  -fpic -O3 -pipe -c msufsort.cpp -o msufsort.o 
gcc-4.4 -I/usr/share/R/include  -fpic -O3 -g0 -Wall -pipe -pedantic -std=gnu99 -c solvebqp.c -o solvebqp.o 
gcc-4.4 -I/usr/share/R/include  -fpic -O3 -g0 -Wall -pipe -pedantic -std=gnu99 -c stringk.c -o stringk.o 
g++-4.4 -I/usr/share/R/include  -fpic -O3 -pipe -c stringkernel.cpp -o stringkernel.o 
g++-4.4 -I/usr/share/R/include  -fpic -O3 -pipe -c svm.cpp -o svm.o 
g++-4.4 -I/usr/share/R/include  -fpic -O3 -pipe -c wkasailcp.cpp -o wkasailcp.o 
g++-4.4 -I/usr/share/R/include  -fpic -O3 -pipe -c wmsufsort.cpp -o wmsufsort.o 
g++ -shared -o kernlab.so brweight.o ctable.o cweight.o dbreakpt.o dcauchy.o dgpnrm.o dgpstep.o dprecond.o dprsrch.o dspcg.o dtron.o dtrpcg.o dtrqsol.o esa.o expdecayweight.o inductionsort.o kspectrumweight.o lcp.o misc.o msufsort.o solvebqp.o stringk.o stringkernel.o svm.o wkasailcp.o wmsufsort.o -llapack -lblas -lgfortran -lm -L/usr/lib64/R/lib -lR 
installing to /usr/local/lib/R/site-library/kernlab/libs 
** R 
** data 
** inst 
** preparing package for lazy loading 
Creating a new generic function for "terms" in "kernlab" 
Creating a new generic function for "fitted" in "kernlab" 
Creating a new generic function for "coef" in "kernlab" 
Creating a new generic function for "predict" in "kernlab" 
Creating a new generic function for "plot" in "kernlab" 
** help 
*** installing help indices 
** building package indices ... 
** testing if installed package can be loaded 

* DONE (kernlab) 
[email protected]:/tmp$ 

而且,它還具有無關gfortran的包似乎只包含C和C++文件。

+0

Hi Dirk。看到類似的問題/帖子,其中一些你已經評論/回答自己,我意識到這一定是我的系統的問題,而不是與R或kernlab軟件包。 不幸的是,我不太熟悉電腦的東西,如命令行安裝,從終端調試信息,但是,慢慢地,當然,我到了那裏。鑑於您的專業知識,您能否提供一些指導,以瞭解如何找出系統出了什麼問題?這樣的信息可能對其他新手像我自己:) Thanx提前任何幫助,你可以提供。我正在使用OSX 10.6。 – lalas 2011-04-23 23:03:27

+0

我從來沒有擁有OS X系統,因此您應該嘗試r-sig-mac列表。 – 2011-04-24 00:26:53

+0

我在一個星期前做了,但沒有人回答,我不明白爲什麼(也許太基本,或者太難,或者沒有人關心;(嘿嘿),所以我想在這裏發佈它,因爲我喜歡用戶社區的快速反應.. :)你認爲我應該在一般的R-Help郵件列表中重新發布這個問題 - 也許它有比r-sig-mac列表更大的社區嗎? – lalas 2011-04-24 01:09:14

0

我懷疑Xcode中的一個小版本轉換是問題的根源(Fortran的未聲明版本和R的未聲明版本),但爲什麼不安裝Mac二進制文件?

http://cran.r-project.org/bin/macosx/leopard/contrib/r-release/kernlab_0.9-12.tgz

+0

鑑於它是開源的,我想修改函數rvm(相關向量機)中的一個函數,以便返回代碼/函數中使用的變量(Sigma Matrix)。該變量用於計算置信區間。 – lalas 2011-04-23 22:49:39