简体   繁体   English

如何使用R版本2.12.1在Ubuntu 9.10上安装R包rgl?

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

I'm trying to install the R package rgl on Ubuntu 9.10. 我正在尝试在Ubuntu 9.10上安装R包rgl。 I'm using R version 2.12.1. 我正在使用R版本2.12.1。

I got the following error: "configure: error: missing required header GL/gl.h" 我收到以下错误:“configure:error:缺少必需的标题GL / gl.h”

Edit: My original question did not specify that the operating system must be Ubuntu 9.10. 编辑:我的原始问题没有指定操作系统必须是Ubuntu 9.10。 I gather that otherwise it would be a good idea to update R, but that this cannot be done on Ubuntu 9.10. 我认为,否则更新R是个好主意,但这不能在Ubuntu 9.10上完成。 Because I'm stupid, I posted a new question instead of editing this one, so some discussion has occurred there. 因为我很蠢,我发布了一个新问题而不是编辑这个问题 ,因此在那里进行了一些讨论。

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 在此之后,我只需启动R并使用install.packages函数安装rgl包

In case any newbies like myself have the same or similar issues installing rgl, the following finally worked for me. 如果像我这样的任何新手在安装rgl时遇到相同或类似的问题,以下内容最终对我有用。

1) At the bash prompt: 1)在bash提示符下:

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). 这修复了“缺少必需的标题GL / gl.h”问题(安装libglu1-mesa-dev后我还有一个)。

2) At the R prompt (I started R with 'sudo R' but that probably isn't required): 2)在R提示符下(我用'sudo R'开始R,但可能不需要):

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 我也在步骤2)尝试了sudo apt-get install r-cran-rgl ,但每当我在R中尝试library(rgl)它会抱怨

Error: package 'rgl' was built before R 3.0.0: please re-install it 错误:包'rgl'是在R 3.0.0之前构建的:请重新安装它

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. 但是rgl可以使用R中的update.packages()命令从这一点升级。如果你想让apt-get知道它已经安装了,这可能更好。但是我并不在乎,因为R提供了它自己的包管理工具。

You probably need to be doing this with R 2.13.1. 您可能需要使用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. 如果您真的坚持使用旧版本,则需要使用与该版本匹配的rgl版本进行编译。 There is an Archive of prior versions and the link is at the bottom of the Contributed Packages page at the CRAN website. 有一个以前版本的存档,该链接位于CRAN网站的Contributed Packages页面的底部。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM