gpt4 book ai didi

r - 如何在centos 6下安装R "rgl"包?

转载 作者:行者123 更新时间:2023-12-04 11:26:38 29 4
gpt4 key购买 nike

我有下面的环境,
CentOS 6.4 版,R 版 3.2.2。
我想为 R 安装“rgl”包。
一开始我用的是install.packages("rgl") ,它在下面抛出错误:

 Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
trying URL 'http://mirror.bjtu.edu.cn/cran/src/contrib/rgl_0.95.1367.tar.gz'
Content type 'application/octet-stream' length 2033202 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

* installing *source* package ‘rgl’ ...
** package ‘rgl’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -m64 -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -m64 -std=gnu99 accepts -g... yes
checking for gcc -m64 -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -m64 -std=gnu99 -E
checking for gcc... (cached) gcc -m64 -std=gnu99
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc -m64 -std=gnu99 accepts -g... (cached) yes
checking for gcc -m64 -std=gnu99 option to accept ISO C89... (cached) none needed
checking whether __attribute__((visibility())) is supported... yes
checking whether gcc -m64 -std=gnu99 accepts -fvisibility... yes
checking whether accepts -fvisibility... no
checking for libpng-config... no
checking libpng... checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking png.h usability... no
checking png.h presence... no
checking for png.h... no
checking for png_read_update_info in -lpng... no
configure: libpng header and lib found
configure: using libpng dynamic linkage
checking for X... no
configure: error: X11 not found but required, configure aborted.
ERROR: configuration failed for package ‘rgl’
* removing ‘/usr/lib64/R/library/rgl’

The downloaded source packages are in
‘/tmp/Rtmp6mou8m/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("rgl") :
installation of package ‘rgl’ had non-zero exit status
然后我尝试使用 R CMD 安装“rgl”包。我从 http://cran.at.r-project.org/web/packages/rgl/index.html 下载了“rgl_0.95.1367.tar.gz”。 .我是通过 R CMD INSTALL 安装的命令:
[root@srv005 RFile]# R CMD INSTALL -l rgl_0.95.1367.tar.gz 
Error: ERROR: no packages specified
[root@srv005 RFile]# R CMD INSTALL rgl_0.95.1367.tar.gz
* installing to library ?.usr/lib64/R/library?
* installing *source* package ?.gl?....
** package ?.gl?.successfully unpacked and MD5 sums checked
checking for gcc... gcc -m64 -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -m64 -std=gnu99 accepts -g... yes
checking for gcc -m64 -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -m64 -std=gnu99 -E
checking for gcc... (cached) gcc -m64 -std=gnu99
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc -m64 -std=gnu99 accepts -g... (cached) yes
checking for gcc -m64 -std=gnu99 option to accept ISO C89... (cached) none needed
checking whether __attribute__((visibility())) is supported... yes
checking whether gcc -m64 -std=gnu99 accepts -fvisibility... yes
checking whether accepts -fvisibility... no
checking for libpng-config... no
checking libpng... checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking png.h usability... no
checking png.h presence... no
checking for png.h... no
checking for png_read_update_info in -lpng... no
configure: libpng header and lib found
configure: using libpng dynamic linkage
checking for X... no
configure: error: X11 not found but required, configure aborted.
ERROR: configuration failed for package ?.gl?
* removing ?.usr/lib64/R/library/rgl?
它也不起作用。
有没有人知道如何在 CentOS 中安装这个“rgl”包?或者该软件包根本无法安装在 CentOS 中?谢谢。

最佳答案

在 RHEL 上你必须安装 libX11-devel,AFAIR

sudo yum install libX11-devel

我想在 CentOS 上也是一样。

关于r - 如何在centos 6下安装R "rgl"包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33512641/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com