0

I have been trying to install the R package, Kernlab from source, but I have been running into problems. At first, I had some error related to gfortran, so I downloaded the GNU fortran compiler from http://r.research.att.com/tools/

Then when I type the following command: R CMD INSTALL kernlab_0.9-12.tar.gz

I get the following error:

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’

Does anyone know how to solve this error? PS. For the GNU fortran compiler I downloaded, it says that is for Xcode version up to 3.2.5; and I have Xcode version 3.2.6. Is this the source of my error, or am I looking in the wrong direction?

michael
  • 9,161
  • 2
  • 52
  • 49
lalas
  • 763
  • 1
  • 7
  • 10

2 Answers2

0

It must be something with your system. On my Linux box, kernlab_0.9-12 installs fine:

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$ 

Moreover, it has nothing to do with gfortran as the package seems to contain only C and C++ files.

Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • Hi Dirk. Looking at similar problems/posts, some of which u have commented/answered yourself, I realized that it must be a problem with my system, and not with R or kernlab package. Unfortunately, i am not very versed with computer stuff such command line installation, debug the information from the terminal, but, slowly and surely i am getting there. Given your expertise, can you provide some guidance into how to find out what is wrong with my system? Such information might be usefull for other novice like myself :) Thanx in advance for any help u can provide. I am using OSX 10.6. – lalas Apr 23 '11 at 23:03
  • I never owned an OS X system so you should try the r-sig-mac list. – Dirk Eddelbuettel Apr 24 '11 at 00:26
  • I did, over a week ago, but noone answered, i don't why (maybe is too basic, or too difficult, or no-one seems to care ;( (hehe). so i thought of posting it here, since i like the quick response of the user community.. :) Do you think i should repost the question in the general R-Help mailing list - maybe it has a bigger community than r-sig-mac list ?? – lalas Apr 24 '11 at 01:09
  • No, you need to figure what you hosed on your system. Just posting "it doesn't work for me" will not get you there. Dunno--maybe you need to reinstall R and tools on your Mac or something. – Dirk Eddelbuettel Apr 24 '11 at 01:23
0

I doubt that a minor version shift in Xcode is the source of your problem (with the unstated version of fortran ... and the unstated version of R), but why not just install the Mac binary?

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

IRTFM
  • 258,963
  • 21
  • 364
  • 487
  • Given that it is open source, i wanted to modify one of the function, rvm (relevant vector machine), so that it returns a variable (Sigma Matrix), used in the code/function. This variable is needed to calculate the Confidence Interval. – lalas Apr 23 '11 at 22:49