Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

unable to install R ggmap package: compilation failed for package ‘jpeg’

Tags:

r

ggmap

When I am trying to install "ggmap" package in my R server(installed on Redhat linux) I am geeting the error message.. Please help me.. it is very important for me to install "ggmap" or else please suggest an alternative.

`> 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’
`
like image 254
Ravi Kumar Avatar asked Aug 29 '15 09:08

Ravi Kumar


1 Answers

Ok, on CentOs 7 (3.10.0-514.el7.x86_64)

I use:

sudo yum install libjpeg-turbo-devel

to fix the installation of ggmap for use it on RStudio.

like image 140
Undigo Factory Avatar answered Sep 29 '22 13:09

Undigo Factory