![如何在 Fedora 22 中添加 jpeg 支持以便 R 可以使用它?](https://linux22.com/image/1466123/%E5%A6%82%E4%BD%95%E5%9C%A8%20Fedora%2022%20%E4%B8%AD%E6%B7%BB%E5%8A%A0%20jpeg%20%E6%94%AF%E6%8C%81%E4%BB%A5%E4%BE%BF%20R%20%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E5%AE%83%EF%BC%9F.png)
我收到错误,如下所示:
gcc -m64 -I/usr/include/R -DNDEBUG -I/usr/local/include -fpic -O2 -g -pipe -Wall -Werror=format-security -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
In file included from read.c:1:0:
rjcommon.h:11:21: fatal error: jpeglib.h: No such file or directory
compilation terminated.
/usr/lib64/R/etc/Makeconf:134: recipe for target 'read.o' failed
make: *** [read.o] Error 1
ERROR: compilation failed for package ‘jpeg’
* removing ‘/home/-/R/x86_64-redhat-linux-gnu-library/3.2/jpeg’
Warning in install.packages :
installation of package ‘jpeg’ had non-zero exit status
ERROR: dependency ‘jpeg’ is not available for package ‘ggmap’
* removing ‘/home/-/R/x86_64-redhat-linux-gnu-library/3.2/ggmap’
Warning in install.packages :
installation of package ‘ggmap’ had non-zero exit status
所以据我所知,R 基本上无法获得 jpeg 支持,但我已经安装了这个:
http://rpmfind.net/linux/rpm2html/search.php?query=openjpeg-libs%28x86-32%29
对于 Fedora 22 x64,它无法解决问题。有什么解决办法吗?我遗漏了什么?
答案1
您缺少 JPEG 库的开发包。openjpeg-libs
是一个运行时包,这意味着它不包含编译使用该库的源文件时所需的头文件。
但是,这openjpeg-libs
不是您需要的,根据 rpmfind.net 搜索丢失的.h
文件,正确的文件是libjpeg-turbo-devel
。当然,你还需要相应的運行時庫libjpeg-turbo
。