Miklos Kiss
2008-Jul-12 03:32 UTC
[R] Another failed attempt to install an R package in Ubuntu
I am running Ubuntu 8.04 through Wubi on a HP Pavilion dv4000 (my home computer) and I recently installed R 2.7.1. I attempted to install the randomForest package from within the R environment and from the Linux terminal. Both attempts failed. I've tried several mirrors but with no luck. Below is an example of the series of error messages I got when R told me that the installation wasn't going well. It tells me that several header files are missing. For some reason it is also trying to install them in '/home/mik/R/i486-pc-linux-gnu-library/2.7' but my R library packages are located in '/usr/lib/R/library'. I tried downloading various x11dev packages and such, as suggested in similar threads in this forum, but that didn't seem to help. I'm really new (installed Ubuntu less than 4 months ago) to Linux but I've been using R for about a year. If anyone can point me in the right direction on how to correctly install this package, I'd very much appreciate it. Thank you, Miklos Kiss install.packages() --- Please select a CRAN mirror for use in this session --- Loading Tcl/Tk interface ... done Warning in install.packages() : argument 'lib' is missing: using '/home/mik/R/i486-pc-linux-gnu-library/2.7' trying URL 'cran.mtu.edu/src/contrib/randomForest_4.5-25.tar.gz' Content type 'application/x-gzip' length 70212 bytes (68 Kb) opened URL =================================================downloaded 68 Kb * Installing *source* package 'randomForest' ... ** libs gcc -std=gnu99 -I/usr/share/R/include -fpic -g -O2 -c classTree.c -o classTree.o In file included from classTree.c:15: /usr/share/R/include/R.h:28:20: error: stdlib.h: No such file or directory /usr/share/R/include/R.h:29:19: error: stdio.h: No such file or directory In file included from /usr/lib/gcc/i486-linux-gnu/4.2.3/include/syslimits.h:7, from /usr/lib/gcc/i486-linux-gnu/4.2.3/include/limits.h:11, from /usr/share/R/include/R.h:30, from classTree.c:15: /usr/lib/gcc/i486-linux-gnu/4.2.3/include/limits.h:122:61: error: limits.h: No such file or directory In file included from classTree.c:15: /usr/share/R/include/R.h:32:18: error: math.h: No such file or directory /usr/share/R/include/R.h:33:19: error: errno.h: No such file or directory In file included from /usr/share/R/include/R.h:50, from classTree.c:15: /usr/share/R/include/R_ext/RS.h:24:39: error: string.h: No such file or directory classTree.c: In function ?catmax_?: classTree.c:305: warning: implicit declaration of function ?pow? classTree.c:305: warning: incompatible implicit declaration of built-in function ?pow? make: *** [classTree.o] Error 1 ERROR: compilation failed for package 'randomForest' ** Removing '/home/mik/R/i486-pc-linux-gnu-library/2.7/randomForest' The downloaded packages are in /tmp/RtmpT83A76/downloaded_packages Warning message: In install.packages() : installation of package 'randomForest' had non-zero exit status -- View this message in context: nabble.com/Another-failed-attempt-to-install-an-R-package-in-Ubuntu-tp18415721p18415721.html Sent from the R help mailing list archive at Nabble.com.
IAIN GALLAGHER
2008-Jul-12 11:00 UTC
[R] Another failed attempt to install an R package in Ubuntu
Hi Miklos. If you want to install R packages to the /usr/lib/R/library directory you need to start R with 'root' user privileges. Ordinary users do not have the appropriate permissions to write to this directory. At the command line type: sudo R type your password when prompted. You won't need to do this for using R or the packages though; you can start R with you normal user permissions ie in the usual way. There are many online tutorials for the linux permission system... have a google ;-) Your error messages suggest you missing some header files (eg stdlib.h is the header file for the general purpose C library) used to build code. At the command line try this: sudo apt-get install build-essentials That will install many of the files you need. There are many apt-get primers on the web as well; it's worth having a look. Hope this helps somewhat. Cheers Iain Miklos Kiss <mzkiss@gmail.com> wrote: I am running Ubuntu 8.04 through Wubi on a HP Pavilion dv4000 (my home computer) and I recently installed R 2.7.1. I attempted to install the randomForest package from within the R environment and from the Linux terminal. Both attempts failed. I've tried several mirrors but with no luck. Below is an example of the series of error messages I got when R told me that the installation wasn't going well. It tells me that several header files are missing. For some reason it is also trying to install them in '/home/mik/R/i486-pc-linux-gnu-library/2.7' but my R library packages are located in '/usr/lib/R/library'. I tried downloading various x11dev packages and such, as suggested in similar threads in this forum, but that didn't seem to help. I'm really new (installed Ubuntu less than 4 months ago) to Linux but I've been using R for about a year. If anyone can point me in the right direction on how to correctly install this package, I'd very much appreciate it. Thank you, Miklos Kiss install.packages() --- Please select a CRAN mirror for use in this session --- Loading Tcl/Tk interface ... done Warning in install.packages() : argument 'lib' is missing: using '/home/mik/R/i486-pc-linux-gnu-library/2.7' trying URL 'cran.mtu.edu/src/contrib/randomForest_4.5-25.tar.gz' Content type 'application/x-gzip' length 70212 bytes (68 Kb) opened URL =================================================downloaded 68 Kb * Installing *source* package 'randomForest' ... ** libs gcc -std=gnu99 -I/usr/share/R/include -fpic -g -O2 -c classTree.c -o classTree.o In file included from classTree.c:15: /usr/share/R/include/R.h:28:20: error: stdlib.h: No such file or directory /usr/share/R/include/R.h:29:19: error: stdio.h: No such file or directory In file included from /usr/lib/gcc/i486-linux-gnu/4.2.3/include/syslimits.h:7, from /usr/lib/gcc/i486-linux-gnu/4.2.3/include/limits.h:11, from /usr/share/R/include/R.h:30, from classTree.c:15: /usr/lib/gcc/i486-linux-gnu/4.2.3/include/limits.h:122:61: error: limits.h: No such file or directory In file included from classTree.c:15: /usr/share/R/include/R.h:32:18: error: math.h: No such file or directory /usr/share/R/include/R.h:33:19: error: errno.h: No such file or directory In file included from /usr/share/R/include/R.h:50, from classTree.c:15: /usr/share/R/include/R_ext/RS.h:24:39: error: string.h: No such file or directory classTree.c: In function ‘catmax_’: classTree.c:305: warning: implicit declaration of function ‘pow’ classTree.c:305: warning: incompatible implicit declaration of built-in function ‘pow’ make: *** [classTree.o] Error 1 ERROR: compilation failed for package 'randomForest' ** Removing '/home/mik/R/i486-pc-linux-gnu-library/2.7/randomForest' The downloaded packages are in /tmp/RtmpT83A76/downloaded_packages Warning message: In install.packages() : installation of package 'randomForest' had non-zero exit status -- View this message in context: nabble.com/Another-failed-attempt-to-install-an-R-package-in-Ubuntu-tp18415721p18415721.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@r-project.org mailing list stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]]
Matti Pastell
2008-Jul-12 15:26 UTC
[R] Another failed attempt to install an R package in Ubuntu
Hello Miklos, Do you have the "build-essential" package installed in Ubuntu? If not try installing it, as it will install the basic tools needed for compiling things from source. Also as Iain pointed out run R with "sudo R" from the terminal if you want to install packages for all users i.e to usr/lib/R/library. BR, Matti -- View this message in context: nabble.com/Another-failed-attempt-to-install-an-R-package-in-Ubuntu-tp18415721p18420728.html Sent from the R help mailing list archive at Nabble.com.
Vincent Goulet
2008-Jul-13 04:25 UTC
[R] Another failed attempt to install an R package in Ubuntu
MIklos, You may have missed this part of the Ubuntu README on CRAN: Users who need to compile packages should also install the r-base-dev package: sudo apt-get install r-base-dev This will fetch all the standard tools you need to compile packages. If you have more Ubuntu specific questions, please post them to R-SIG- Debian. Best, Vincent Le ven. 11 juil. ? 23:32, Miklos Kiss a ?crit :> > I am running Ubuntu 8.04 through Wubi on a HP Pavilion dv4000 (my home > computer) and I recently installed R 2.7.1. I attempted to install > the > randomForest package from within the R environment and from the Linux > terminal. Both attempts failed. I've tried several mirrors but > with no > luck. Below is an example of the series of error messages I got > when R told > me that the installation wasn't going well. > > It tells me that several header files are missing. For some reason > it is > also trying to install them in '/home/mik/R/i486-pc-linux-gnu- > library/2.7' > but my R library packages are located in '/usr/lib/R/library'. I > tried > downloading various x11dev packages and such, as suggested in similar > threads in this forum, but that didn't seem to help. > > I'm really new (installed Ubuntu less than 4 months ago) to Linux > but I've > been using R for about a year. If anyone can point me in the right > direction on how to correctly install this package, I'd very much > appreciate > it. > > Thank you, > Miklos Kiss > > install.packages() > --- Please select a CRAN mirror for use in this session --- > Loading Tcl/Tk interface ... done > Warning in install.packages() : > argument 'lib' is missing: using > '/home/mik/R/i486-pc-linux-gnu-library/2.7' > trying URL 'cran.mtu.edu/src/contrib > randomForest_4.5-25.tar.gz' > Content type 'application/x-gzip' length 70212 bytes (68 Kb) > opened URL > =================================================> downloaded 68 Kb > > * Installing *source* package 'randomForest' ... > ** libs > gcc -std=gnu99 -I/usr/share/R/include -fpic -g -O2 -c > classTree.c -o > classTree.o > In file included from classTree.c:15: > /usr/share/R/include/R.h:28:20: error: stdlib.h: No such file or > directory > /usr/share/R/include/R.h:29:19: error: stdio.h: No such file or > directory > In file included from > /usr/lib/gcc/i486-linux-gnu/4.2.3/include/syslimits.h:7, > from /usr/lib/gcc/i486-linux-gnu/4.2.3/include/ > limits.h:11, > from /usr/share/R/include/R.h:30, > from classTree.c:15: > /usr/lib/gcc/i486-linux-gnu/4.2.3/include/limits.h:122:61: error: > limits.h: > No such file or directory > In file included from classTree.c:15: > /usr/share/R/include/R.h:32:18: error: math.h: No such file or > directory > /usr/share/R/include/R.h:33:19: error: errno.h: No such file or > directory > In file included from /usr/share/R/include/R.h:50, > from classTree.c:15: > /usr/share/R/include/R_ext/RS.h:24:39: error: string.h: No such file > or > directory > classTree.c: In function ?catmax_?: > classTree.c:305: warning: implicit declaration of function ?pow? > classTree.c:305: warning: incompatible implicit declaration of built- > in > function ?pow? > make: *** [classTree.o] Error 1 > ERROR: compilation failed for package 'randomForest' > ** Removing '/home/mik/R/i486-pc-linux-gnu-library/2.7/randomForest' > > The downloaded packages are in > /tmp/RtmpT83A76/downloaded_packages > Warning message: > In install.packages() : > installation of package 'randomForest' had non-zero exit status > > -- > View this message in context: nabble.com/Another-failed-attempt-to-install-an-R-package-in-Ubuntu-tp18415721p18415721.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.