在MacOS X上从Source安装Kernlab时出错(延迟加载失败)

时间:2011-04-23 17:15:28

标签: r install kernlab

我一直在尝试从源代码安装R包,Kernlab,但我遇到了问题。起初,我有一些与gfortran相关的错误,所以我从http://r.research.att.com/tools/下载了GNU fortran编译器

然后当我输入以下命令时: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。这是我的错误的来源,还是我看错了方向?

2 个答案:

答案 0 :(得分:0)

它必须与您的系统有关。在我的Linux机器上,kernlab_0.9-12安装得很好:

edd@max:/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)
edd@max:/tmp$ 

此外,它与gfortran无关,因为包似乎只包含C和C ++文件。

答案 1 :(得分:0)

我怀疑Xcode的一个小版本转换是你的问题的根源(使用未说明的fortran版本......和未说明的R版本),但为什么不安装Mac二进制文件?

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