解决:在ubuntu下安装R语言ks包时的error:configuration failed for package ‘rgl’

在做Multivariate kernel density estimation


用到R语言的ks包,在ubuntu下(R studio)安装遇到了问题:

> install.packages("ks")
Installing package into ‘/home/coolwaterld/R/i686-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
also installing the dependency ‘rgl’

trying URL 'http://cran.rstudio.com/src/contrib/rgl_0.95.1158.tar.gz'
Content type 'application/x-gzip' length 1783656 bytes (1.7 Mb)
opened URL
==================================================
downloaded 1.7 Mb

trying URL 'http://cran.rstudio.com/src/contrib/ks_1.9.3.tar.gz'
Content type 'application/x-gzip' length 308363 bytes (301 Kb)
opened URL
==================================================
downloaded 301 Kb

* installing *source* package ‘rgl’ ...
** package ‘rgl’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -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 -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for gcc... (cached) gcc -std=gnu99
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc -std=gnu99 accepts -g... (cached) yes
checking for gcc -std=gnu99 option to accept ISO C89... (cached) none needed
checking whether __attribute__((visibility())) is supported... yes
checking whether gcc -std=gnu99 accepts -fvisibility... yes
checking whether  accepts -fvisibility... no
checking for libpng-config... yes
configure: using libpng-config
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 ‘/home/coolwaterld/R/i686-pc-linux-gnu-library/3.0/rgl’
Warning in install.packages :
  installation of package ‘rgl’ had non-zero exit status
ERROR: dependency ‘rgl’ is not available for package ‘ks’
* removing ‘/home/coolwaterld/R/i686-pc-linux-gnu-library/3.0/ks’
Warning in install.packages :
  installation of package ‘ks’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/Rtmp2FbviI/downloaded_packages’

发现为rgl包的问题,可以在终端中安装rgl

sudo apt-get install r-cran-rgl
再次安装ks包

> install.packages("ks")
Installing package into ‘/home/coolwaterld/R/i686-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/ks_1.9.3.tar.gz'
Content type 'application/x-gzip' length 308363 bytes (301 Kb)
opened URL
==================================================
downloaded 301 Kb

* installing *source* package ‘ks’ ...
** package ‘ks’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -O3 -pipe  -g  -c ks.c -o ks.o
gcc -std=gnu99 -shared -o ks.so ks.o -L/usr/lib/R/lib -lR
installing to /home/coolwaterld/R/i686-pc-linux-gnu-library/3.0/ks/libs
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (ks)

The downloaded source packages are in
	‘/tmp/Rtmp2FbviI/downloaded_packages’
成功

参考:http://ubuntuforums.org/showthread.php?t=787464

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值