0

I have R (ver. 3.1.2) installed and I tried to install rgdal package. First I downloaded the package source (tar.gz) from here. Finally I installed the sp package on which rgdal depends. Then I run R and typed install.packages("/home/umberto/Scaricati/rgdal_1.1-3.tar.gz").

It seems it cannot find lgdal, below is the error I received:

Installing package into ‘/home/umberto/R/x86_64-pc-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
inferring 'repos = NULL' from 'pkgs'
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: rgdal: 1.1-3
checking for /usr/bin/svnversion... yes
configure: svn revision: 594
checking for gdal-config... /usr/local/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 1.11.0
checking GDAL version >= 1.6.3... yes
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking gdal: linking with --libs only... no
checking gdal: linking with --libs and --dep-libs... no
/usr/bin/ld: cannot find -lgdal
collect2: error: ld returned 1 exit status
/usr/bin/ld: cannot find -lgdal
collect2: error: ld returned 1 exit status
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/umberto/R/x86_64-pc-linux-gnu-library/3.1/rgdal’
Warning message:
In install.packages("/home/umberto/Scaricati/rgdal_1.1-3.tar.gz") :
  installation of package ‘/home/umberto/Scaricati/rgdal_1.1-3.tar.gz’ had non-zero exit status
umbe1987
  • 2,894
  • 6
  • 35
  • 63
  • 2
    Try installing `libgdal-dev` and/or `libgdal1-dev` and/or `libgdal1h` and/or `gdal-bin`. Those are the `gdal`-related packages I have installed on my machine (Linux Mint 17.3 built on Trusty). I remember it being a pain to install `rgdal`... – MichaelChirico Dec 23 '15 at 19:05
  • Thanks. I run "sudo apt-get update && sudo apt-get install libgdal-dev libgdal1-dev" but I receive "I seguenti pacchetti hanno dipendenze non soddisfatte: libgdal-dev : Dipende: libgeos-dev ma non sta per essere installato Dipende: libspatialite-dev ma non sta per essere installato E: Impossibile correggere i problemi, ci sono pacchetti danneggiati bloccati." – umbe1987 Dec 23 '15 at 19:10
  • In english is something like "packages with not satisfied dipendencies: libgdal-dev : depends on: libgeos-dev but it is not going to be installed. Impossible to correct issues, there are blocked damaged packages" – umbe1987 Dec 23 '15 at 19:11
  • my limited Italian suggests you also need `libspatialite-dev` – MichaelChirico Dec 23 '15 at 19:11
  • 1
    and if there are damaged packages perhaps un/reinstalling them could help. does Ubuntu have something called synaptic package manager? I use that on mint and it handles all the dependencies and identifies broken packages for me... – MichaelChirico Dec 23 '15 at 19:13
  • Installing it from Ubuntu Software Center. Will come back when I'm done. Still no luck with libspatialite-dev. – umbe1987 Dec 23 '15 at 19:16
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/98851/discussion-between-umbe1987-and-michaelchirico). – umbe1987 Dec 23 '15 at 19:44
  • There appears to be massive confusion here. `rgdal` requires an installation of the external (non-R) package GDAL. There is really no connection between GDAL and `rgl` which is the location you are citing in that link to: http://cran.mirror.garr.it/mirrors/CRAN/web/packages/rgl/index.html – IRTFM Dec 23 '15 at 20:09
  • some other packages i have installed that are related: `libgeos-3.4.2`, `libgeos-c1`, `libgeos-dev`, `libopenal-data`, `libopenal1`, `libspatialindex3`, `libspatialite-dev`, `libspatialite5`, `r-cran-spatial`. don't know which exactly you may be missing. – MichaelChirico Dec 23 '15 at 20:45
  • @42- You're right, the link to 'rgl' page was my mistake, it was just another package I just had to install. I updated the link to 'rgdal' now. – umbe1987 Dec 23 '15 at 23:34
  • 1
    The DESCRIPTION page in Index page for `help(pac=rgdal)` help says you also need 'PROJ.4 (proj >= 4.4.9)' – IRTFM Dec 23 '15 at 23:43
  • Ok, so something has changed. After an "sudo apt-get autoremove" and "sudo apt-get install libgeos-dev libgdal-dev" the error about gdal is gone. Now I have "checking proj_api.h usability... no checking proj_api.h presence... no checking for proj_api.h... no configure: error: proj_api.h not found in standard or given locations." So I think it's a matter of PROJ.4. I installed "libgeo-proj4-perl", but maybe I still miss something else. – umbe1987 Dec 24 '15 at 00:06
  • ok, installing "libproj-dev" from Synaptic Package Manager did solve the problem. @MichaelChirico Thanks for this software and thanks to the other user as well for the support! – umbe1987 Dec 24 '15 at 00:10

0 Answers0