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

后端 未结 3 856
广开言路
广开言路 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.

提交回复
热议问题