installation of package ‘raster’ had non-zero exit status


installation of package ‘raster’ had non-zero exit status



i'm trying install the package "Raster", but appear the error installation of package ‘raster’ had non-zero exit status.



I have read in other sites, without success
I thank you in advance



I detail below the process and the errors.


install.packages("raster")
Installing package into ‘/home/hectorirc/R/x86_64-pc-linux-gnu-



library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘sp’, ‘Rcpp’


probando la URL 'https://cloud.r-project.org/src/contrib/sp_1.3-1.tar.gz'
Content type 'application/x-gzip' length 1133621 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

probando la URL 'https://cloud.r-project.org/src/contrib/Rcpp_0.12.17.tar.gz'
Content type 'application/x-gzip' length 3766351 bytes (3.6 MB)
==================================================
downloaded 3.6 MB

probando la URL 'https://cloud.r-project.org/src/contrib/raster_2.6-7.tar.gz'
Content type 'application/x-gzip' length 1080946 bytes (1.0 MB)
==================================================
downloaded 1.0 MB

* installing *source* package ‘sp’ ...
** package ‘sp’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c Rcentroid.c -o Rcentroid.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c gcdist.c -o gcdist.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c init.c -o init.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c pip.c -o pip.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c pip2.c -o pip2.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c sp_xports.c -o sp_xports.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c surfaceArea.c -o surfaceArea.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c zerodist.c -o zerodist.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o sp.so Rcentroid.o gcdist.o init.o pip.o pip2.o sp_xports.o surfaceArea.o zerodist.o -L/usr/lib/R/lib -lR
/bin/bash: línea 2: g++: no se encontró la orden
/usr/share/R/share/make/shlib.mk:6: recipe for target 'sp.so' failed
make: *** [sp.so] Error 127
ERROR: compilation failed for package ‘sp’
* removing ‘/home/hectorirc/R/x86_64-pc-linux-gnu-library/3.4/sp’
Warning in install.packages :
installation of package ‘sp’ had non-zero exit status
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/ -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c Date.cpp -o Date.o
/bin/bash: g++: no se encontró la orden
/usr/lib/R/etc/Makeconf:168: recipe for target 'Date.o' failed
make: *** [Date.o] Error 127
ERROR: compilation failed for package ‘Rcpp’
* removing ‘/home/hectorirc/R/x86_64-pc-linux-gnu-library/3.4/Rcpp’
Warning in install.packages :
installation of package ‘Rcpp’ had non-zero exit status
ERROR: dependencies ‘sp’, ‘Rcpp’ are not available for package ‘raster’
* removing ‘/home/hectorirc/R/x86_64-pc-linux-gnu-library/3.4/raster’
Warning in install.packages :
installation of package ‘raster’ had non-zero exit status

The downloaded source packages are in
‘/tmp/RtmpRSrx6A/downloaded_packages’



thanks :)





Try with install.packages("raster", dependencies = TRUE)
– akrun
Jul 3 at 4:00


install.packages("raster", dependencies = TRUE)





I had already tried it without any success. a similar result appears
– HectorIRC
Jul 3 at 4:04






The first thing that fails is the installation of sp, and then the installation of Rcpp also fails. So start there. The reason seems to be that the g++ compiler is not available.
– Robert Hijmans
Jul 3 at 4:10



sp


Rcpp





when i try to install the package "sp" appear similar to the previous case Warning in install.packages : installation of package ‘sp’ had non-zero exit status.... And with the package "Rcpp", the same thing appears Warning in install.packages : installation of package ‘Rcpp’ had non-zero exit status
– HectorIRC
Jul 3 at 4:17





try reinstalling R, updating R to 3.5
– Calum You
Jul 3 at 4:25




1 Answer
1



I think the problem is not with R but missing build tools. You need to install the g++ compiler, which . On Ubuntu you would just (in a command line shell, not in R):


sudo apt-get install build-essential



assuming you have permissions to install things;...but from a quick web search it may be a bit more complicated with Linux Mint.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

api-platform.com Unable to generate an IRI for the item of type

How to set up datasource with Spring for HikariCP?

Display dokan vendor name on Woocommerce single product pages