4

Possible Duplicate:
Problem Installing rgl

I'm trying to install the R package rgl on Ubuntu 9.10. I'm using R version 2.12.1.

I got the following error: "configure: error: missing required header GL/gl.h"

I asked this question earlier without the restriction that I use Ubuntu 9.10, and the answer I got was to update R, but I haven't been able to do this, possibly because Ubuntu 9.10 is not supported by the folks at CRAN.

Community
  • 1
  • 1
BenH
  • 2,100
  • 2
  • 22
  • 33
  • Do you have OpenGL (http://www.opengl.org/) installed? –  Sep 20 '11 at 14:04
  • @JackManey I don't know. How would I tell? – BenH Sep 20 '11 at 14:22
  • 2
    How about updating your Ubuntu? It's a couple of years out of date and not an LTS release (I think). – Spacedman Sep 20 '11 at 14:34
  • http://www.cyberciti.biz/faq/find-out-if-package-is-installed-in-linux/#debian –  Sep 20 '11 at 14:37
  • @JackManey How is that helpful? I didn't get an answer to that question because it wasn't clear that I wanted to do this on Ubuntu 9.10 in the question. This question is looking like it might get me somewhere. – BenH Sep 20 '11 at 14:44
  • No, I don't have OpenGL installed. I have not been successful in figuring out how to install it. – BenH Sep 20 '11 at 14:58
  • @Name: It's helpful to the community because we wish to avoid duplicate questions when possible (http://blog.stackoverflow.com/2009/04/handling-duplicate-questions/). As to how to install OpenGL, download the source, and run `configure`, `make`, and `sudo make install`. –  Sep 20 '11 at 15:04
  • 1
    Also, "Name" this site works with a reputation syste, which you can use to your advantage by participating according to its rules. Re-posting from anonymous one-off accounts is not the way to do that. – Dirk Eddelbuettel Sep 20 '11 at 15:09
  • Jack, no, he is on Ubunto so you do **not** recommend rebuilding OpenGL from source but rather by installing the appropriate existing packages; see my answer. – Dirk Eddelbuettel Sep 20 '11 at 15:10
  • Ok, I didn't mean to upset the community. I guess my point though is that my first question didn't get answered, which I believe is because I wasn't clear that the Linux version I was using was important to the question. If you remove this question, how will this ever get answered? I realize now that I should have posted this question originally, but if I edit the old question, then people's comments and answers won't make sense, and I would expect that no one new would look at it. How is this sort of situation handled? – BenH Sep 20 '11 at 15:24
  • From the OpenGL website, I found a [FAQ](http://www.opengl.org/wiki/FAQ#Where_can_I_download.3F) that tells me that OpenGL is not a software product, it is a specification, and that I probably need to download drivers. The next question gives instructions on how to do that, but I do not understand them. – BenH Sep 20 '11 at 15:38
  • What don't you understand? What have you tried? Where did you get stuck? –  Sep 20 '11 at 15:41
  • It looks like I need to update my graphics drivers, but this does not sound like the same thing as downloading the source, running configure, etc. I started searching for instructions on how to update my graphics drivers, but I was not able to find anything that would allow me to do that quickly, and since it's not clear that this is going to be helpful (since it's not what either commenter on here recommended) and it would take me a long time, I decided to ask for help again. I also spent a while searching for somewhere to download the OpenGL source from, but was unsuccessful. – BenH Sep 20 '11 at 15:48

1 Answers1

9

Just do

  sudo apt-get install r-cran-rgl

As there is a reason we spent time harder-to-install packages with less common dependencies. So that you do not have to worry.

If you insist on building it locally, you can still take advantage of the package for understanding its Build-Dependencies, i.e. apt-get build-dep r-cran-rgl. For the current package (on Ubuntu 11.04) I have

 Build-Depends: debhelper (>= 7.0.0), r-base-dev (>= 2.12.1), cdbs, \
        libgl1-mesa-dev | libgl-dev, \
        libglu1-mesa-dev | libglu-dev, \
        libpng12-dev, libx11-dev, libxt-dev, x11proto-core-dev
Jarrod Urban
  • 134
  • 7
Dirk Eddelbuettel
  • 360,940
  • 56
  • 644
  • 725
  • I did that, and it said "r-cran-rgl is already the newest version." But when I go into R and type "library(rgl)", it says "Error in library(rgl) : there is no package called 'rgl'". – BenH Sep 20 '11 at 14:21
  • Then look at the output of `.libPath()` and compare it with what you have installed. – Dirk Eddelbuettel Sep 20 '11 at 14:22
  • I guess I should mention that I am not a competent Linux user...How do I look at the output of .libPath()? I typed that in to my terminal, and it didn't give me anything, and I couldn't find anything online about it. I also don't know how I would compare it with what I have installed. – BenH Sep 20 '11 at 14:41
  • 1
    @Name you type that within R. It is an R function that returns the list of current libraries and their paths. – Gavin Simpson Sep 20 '11 at 15:51
  • @GavinSimpson Ah! Unfortunately though it says "Error: could not find function ".libPath"" – BenH Sep 20 '11 at 15:53
  • 2
    @Name That's because it is `.libPaths()` with an `s`. – Gavin Simpson Sep 20 '11 at 16:18
  • @GavinSimpson Ok, that worked. What do you think Dirk meant for me to compare the output to? – BenH Sep 20 '11 at 17:34
  • @Name I don't use Ubuntu, but check that the place it installed the package when you did `apt get ....` is the same as, or one of, the entries shown by `.libPaths()`. It might not have put the package where your R is looking for it. – Gavin Simpson Sep 20 '11 at 17:38
  • @GavinSimpson "/usr/lib/R/site-library" is in the output of .libPaths() and the output of "dpkg -L r-cran-rgl". There's quite a bit more that is output by "dpkg -L r-cran-rgl" though. – BenH Sep 20 '11 at 17:49
  • @Name Sorry I can't help further - I don't use Ubuntu and compile my own R on Linux so am not going to be much help I'm afraid. Take this up on the [R Ubuntu list](http://cran.r-project.org/bin/linux/ubuntu/) if Dirk doesn't comment further. – Gavin Simpson Sep 20 '11 at 18:54
  • I would try `i1 <- installed.packages(); i1["rgl",]` which will give you a version number and a `LibPath` (i.e. the location where it is installed). `.libPaths()` will tell you all the locations where R will look for installed packages. On the other hand, I'm not sure (not being a Debian/`apt-get` whiz) how to ask `apt` where it is putting the stuff from `r-cran-rgl` ... – Ben Bolker Sep 20 '11 at 22:19
  • Ben, that last part is eg `dpkg -l r-cran-rgl`. Good advice otherwise. – Dirk Eddelbuettel Sep 20 '11 at 22:22
  • @Ben > i1 <- installed.packages(); i1["rgl",] Error: subscript out of bounds – BenH Sep 22 '11 at 12:12
  • @Dirk $ dpkg -l r-cran-rgl Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) – BenH Sep 22 '11 at 12:14
  • Sorry, my typo, use uppercase L: "dpkg -L r-cran-rgl" – Dirk Eddelbuettel Sep 22 '11 at 13:15