无法构建R包"png"浅顶软呢帽20 [英] Cannot build R package "png" Fedora 20
本文介绍了无法构建R包"png"浅顶软呢帽20的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试构建R
包 png
,则仓库说libpng
需要可用.
I am trying to build the R
package png
, the repo says that libpng
needs to be available.
我运行Linux Fedora 20发行版
I run a Linux Fedora 20 distro
好像我有...
[root@localhost bin]# yum install libpng
Loaded plugins: langpacks, refresh-packagekit
Package 2:libpng-1.6.3-3.fc20.x86_64 already installed and latest version
Nothing to do
但是当我尝试安装它时:
But when I try to install it:
> install.packages("png")
Installing package into ‘/home/statquant/R/x86_64-redhat-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/png_0.1-7.tar.gz'
Content type 'application/x-gzip' length 24990 bytes (24 Kb)
opened URL
==================================================
downloaded 24 Kb
* installing *source* package ‘png’ ...
** package ‘png’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include `libpng-config --cflags` -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c read.c -o read.o
/bin/sh: libpng-config: command not found
read.c:3:17: fatal error: png.h: No such file or directory
#include <png.h>
^
compilation terminated.
make: *** [read.o] Error 1
ERROR: compilation failed for package ‘png’
* removing ‘/home/statquant/R/x86_64-redhat-linux-gnu-library/3.0/png’
The downloaded source packages are in
‘/tmp/RtmpG5MjG9/downloaded_packages’
Warning message:
In install.packages("png") :
installation of package ‘png’ had non-zero exit status
推荐答案
对于某些R软件包,您需要相应的开发库才能成功安装R软件包.在您的情况下,这应该可以满足您的需求
For some R packages you need the corresponding development library to successfully install the R package. In your case this should do what you need
# Do the following in your terminal (not in an R session)
yum install libpng-devel
之后,您应该能够安装R软件包
afterwards you should be able to install the R package
# Do the following in the R console (during an R session)
install.packages("png")
这篇关于无法构建R包"png"浅顶软呢帽20的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文