2015-08-29 160 views
4

當我試圖在我的R服務器(安裝在Redhat linux上)中安裝「ggmap」軟件包時,我將出現錯誤消息。請幫助我..對我來說安裝「ggmap」非常重要,否則請提供一個替代方案。無法安裝R ggmap軟件包:編譯包'jpeg'失敗

`> install.packages("ggmap", dependencies = T) 
Installing package into ‘/home/rk/R/x86_64-redhat-linux-gnu-library/3.1’ 
(as ‘lib’ is unspecified) 
also installing the dependency ‘jpeg’ 

trying URL 'http://cran.rstudio.com/src/contrib/jpeg_0.1-8.tar.gz' 
Content type 'application/x-gzip' length 18046 bytes (17 KB) 
opened URL 
================================================== 
downloaded 17 KB 

trying URL 'http://cran.rstudio.com/src/contrib/ggmap_2.5.2.tar.gz' 
Content type 'application/x-gzip' length 2948233 bytes (2.8 MB) 
opened URL 
================================================== 
downloaded 2.8 MB 

* installing *source* package ‘jpeg’ ... 
** package ‘jpeg’ successfully unpacked and MD5 sums checked 
** libs 
gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c read.c -o read.o 
In file included from read.c:1: 
rjcommon.h:11:21: error: jpeglib.h: No such file or directory 
rjcommon.h:29:2: error: #error "Sorry, only 8-bit libjpeg is supported" 
In file included from read.c:1: 
rjcommon.h:33: warning: return type defaults to ‘int’ 
rjcommon.h: In function ‘METHODDEF’: 
rjcommon.h:33: error: expected declaration specifiers before ‘Rjpeg_error_exit’ 
rjcommon.h:41: error: expected declaration specifiers before ‘METHODDEF’ 
rjcommon.h:51: error: field ‘api’ has incomplete type 
rjcommon.h:50: warning: empty declaration 
rjcommon.h:59: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token 
rjcommon.h:75: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token 
In file included from read.c:3: 
jcompat.h:7:20: error: jerror.h: No such file or directory 
In file included from read.c:3: 
jcompat.h:13: error: expected declaration specifiers before ‘METHODDEF’ 
jcompat.h:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘eoi_buf’ 
jcompat.h:15: error: expected declaration specifiers before ‘;’ token 
jcompat.h:17: error: expected declaration specifiers before ‘METHODDEF’ 
jcompat.h:26: error: expected declaration specifiers before ‘METHODDEF’ 
jcompat.h:53: warning: ‘struct jpeg_decompress_struct’ declared inside parameter list 
jcompat.h:53: warning: its scope is only this definition or declaration, which is probably not what you want 
jcompat.h:53: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token 
read.c:7: warning: ‘struct jpeg_decompress_struct’ declared inside parameter list 
read.c:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token 
read.c:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token 
rjcommon.h:32: error: old-style parameter declarations in prototyped function definition 
read.c:176: error: expected ‘{’ at end of input 
make: *** [read.o] Error 1 
ERROR: compilation failed for package ‘jpeg’ 
* removing ‘/home/rk/R/x86_64-redhat-linux-gnu-library/3.1/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/rk/R/x86_64-redhat-linux-gnu-library/3.1/ggmap’ 
Warning in install.packages : 
    installation of package ‘ggmap’ had non-zero exit status 

The downloaded source packages are in 
    ‘/tmp/RtmpnFyWnM/downloaded_packages’ 
` 
+6

錯誤信息:'jpeglib.h:沒有這樣的文件或目錄。爲jpeg安裝標題。在Unbuntu上,它是'sudo apt-get install libjpeg-dev'。 –

+0

我沒有Sudo訪問我的linux ..請建議一個替代,可以從R控制檯.. –

+1

我想你需要與管理員交談,要求他或她安裝庫建議@Pascal並*更新R *的版本。您正在使用大約兩年前的R v3.1。最新的軟件包需要更新版本的R. – RHertel

回答

5

好的,在CentOS 7(3.10.0-514.el7.x86_64

我使用:

sudo yum install libjpeg-turbo-devel 

以固定的ggmap安裝使用它RStudio

+1

這也適用於安裝'jpeg' R軟件包時遇到困難。 –