How do I install the R package rgl on Ubuntu 9.10, using R version 2.12.1?

后端 未结 3 853
广开言路
广开言路 2020-12-14 12:28

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\

相关标签:
3条回答
  • 2020-12-14 13:11

    In case any newbies like myself have the same or similar issues installing rgl, the following finally worked for me.

    1) At the bash prompt:

    sudo apt-get build-dep r-cran-rgl
    

    This fixes "missing required header GL/gl.h" issues (I still had one after installing libglu1-mesa-dev).

    2) At the R prompt (I started R with 'sudo R' but that probably isn't required):

    install.packages("rgl", repos="http://R-Forge.R-project.org")
    

    which downloads, compiles, and installs the latest version.

    I also tried sudo apt-get install r-cran-rgl at step 2), but whenever I tried library(rgl) within R it would complain with

    Error: package ‘rgl’ was built before R 3.0.0: please re-install it

    But rgl can be upgraded from this point using the update.packages() command in R. This might be preferable if you want apt-get to know it's installed, but I didn't really care since R provides it's own package-management tools.

    0 讨论(0)
  • 2020-12-14 13:14

    I had to deal with this problem many times, and this always worked just fine: type in a terminal

    sudo apt-get install libglu1-mesa-dev
    

    After this I just start R and install the rgl package with the install.packages function

    0 讨论(0)
  • 2020-12-14 13:19

    You probably need to be doing this with R 2.13.1. The linking points are probably different. If you really insist on using an old version, you need to compile with a version of rgl that matches that version. There is an Archive of prior versions and the link is at the bottom of the Contributed Packages page at the CRAN website.

    0 讨论(0)
提交回复
热议问题