redhat7.5在R下安装devtools库失败(libjpeg)

redhat7.5在R下安装devtools库失败如何解决

img


img

* installing *source* package ‘ragg’ ...
** 成功将‘ragg’程序包解包并MD5和检查
** using staged installation
Package libjpeg was not found in the pkg-config search path.
Perhaps you should add the directory containing `libjpeg.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libjpeg' found
Package libjpeg was not found in the pkg-config search path.
Perhaps you should add the directory containing `libjpeg.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libjpeg' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lfreetype -lpng16 -ltiff -lz -ljpeg -lbz2
-----------------------------[ ANTICONF ]-------------------------------
Configuration failed to find one of freetype2 libpng libtiff-4 libjpeg. Try installing:
 * deb: libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev (Debian, Ubuntu, etc)
 * rpm: freetype-devel libpng-devel libtiff-devel libjpeg-turbo-devel (Fedora, CentOS, RHEL)
 * csw: libfreetype_dev libpng16_dev libtiff_dev libjpeg_dev (Solaris)
If freetype2 libpng libtiff-4 libjpeg is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a freetype2 libpng libtiff-4 libjpeg.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
In file included from <stdin>:1:0:
/usr/include/ft2build.h:56:38: 致命错误:freetype/config/ftheader.h:没有那个文件或目录
 #include <freetype/config/ftheader.h>
                                      ^
编译中断。
--------------------------------------------------------------------
ERROR: configuration failed for package ‘ragg’
* removing ‘/usr/local/R/library/ragg’

使用以下命令安装即可(缺什么就在下面的链接的上级目录找,然后用相同的命令下载)
install.packages("https://cran.r-project.org/src/contrib/Archive/ragg/ragg_0.4.0.tar.gz%22, repo=NULL, type="source")

参考:http://www.shajuta.com/go/794

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^