问题
I am trying to install rgdal in my computer that runs ubuntu linux 14.04. The R version that I am using is: 3.3.1. I installed gdal and related packages from the regular ubuntu repository and also using the ubuntu-gis ppa (https://launchpad.net/~ubuntugis/+archive/ubuntu/ppa). In both cases, I've got the same error message while compiling:
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/include/gdal -I"/home/magdiel/R/x86_64-pc-linux-gnu-library/3.3/sp/include" -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c inverser.c -o inverser.o
inverser.c:3:22: fatal error: projects.h: No existe el archivo o el directorio
#include <projects.h>
^
compilation terminated.
make: *** [inverser.o] Error 1
ERROR: compilation failed for package ‘rgdal’
I had rgdal installed before without problem and was trying to update it to a newer version as required for R.
I will greatly appreciate any help
回答1:
In February 2016, on Ubuntu 14.04.2 (and with R 3.2.2), I needed the following to get both rgdal and the complementary (and frequently very useful) gdalUtils package installed:
sudo apt-get update
sudo apt-get -y install libgdal1h
sudo apt-get -y install libgdal1-dev
sudo apt-get install libproj-dev
sudo apt-get install gdal-bin
Rscript 'install.packages(c("rgdal", "gdalUtils"))'
来源:https://stackoverflow.com/questions/38213027/rgdal-installation-failed-on-ubuntu-14-04