Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install rgdal library in rstudio - GDALAllRegister not found in libgdal

I'm trying to install rgdal library in Rstudio (0.97.332), using Ubuntu 12.10 (quantal) and R 2.15.1 (Roasted Marshmallows).

I have the following installed regarding gdal in Ubuntu:

$ apt-cache search gdal
dans-gdal-scripts - GDAL contributed tools by Geographic Information Network of Alaska
gdal-bin - Geospatial Data Abstraction Library - Utility programs
libgdal-dev - Geospatial Data Abstraction Library - Development files
libgdal-doc - Documentation for the Geospatial Data Abstraction Library
libgdal-perl - Perl bindings to the Geospatial Data Abstraction Library
libgdal-ruby - Ruby bindings to the Geospatial Data Abstraction Library
libgdal-ruby1.8 - Ruby 1.8 bindings to the Geospatial Data Abstraction Library
libgdal1 - Geospatial Data Abstraction Library
libgdal1-1.9.0-grass - GRASS extension for the GDAL library
libgdal1-dev - Geospatial Data Abstraction Library - Development files
python-gdal - Python bindings to the Geospatial Data Abstraction Library
qlandkartegt - GPS mapping (GeoTiff and vector) and GPSr management

I also have proj installed:

$ apt-cache search proj-
libproj-dev - Cartographic projection library (development files)
proj-bin - Cartographic projection library (tools)
proj-data - Cartographic projection filter and library (datum package)
proj-ps-doc - PostScript docs for cartographic projection filters and library
$ apt-cache search proj.4
libgeo-proj4-perl - PROJ.4 library for cartographic projections
python-mpltoolkits.basemap - matplotlib toolkit to plot on map projections
python-mpltoolkits.basemap-data - matplotlib toolkit to plot on map projections (data package)
python-mpltoolkits.basemap-doc - matplotlib toolkit to plot on map projections (documentation)
python-pyproj - Python interface to PROJ.4 library

Now I start rstudio and run install.packages("rgdal",dependencies=TRUE) I get the following:

> install.packages("rgdal",dependencies=TRUE)
Installing package(s) into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/rgdal_0.8-5.tar.gz'
Content type 'application/x-gzip' length 1584889 bytes (1.5 Mb)
opened URL
==================================================
downloaded 1.5 Mb

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: rgdal: 0.8-4
checking for /usr/bin/svnversion... no
configure: svn revision: 449
configure: gdal-config: gdal-config
checking gdal-config usability... yes
configure: GDAL: 1.9.0
checking GDAL version >= 1.7.1... 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
./configure: line 3373: g++: command not found
./configure: line 3388: g++: command not found
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/usr/local/lib/R/site-library/rgdal’
Warning in install.packages :
  installation of package ‘rgdal’ had non-zero exit status

I do not know what is GDALAllRegister and what should be my next step.

like image 501
Tomas Greif Avatar asked Mar 22 '13 11:03

Tomas Greif


1 Answers

check if you have c++ really installed. I suspect that you don't have it.

g++: command not found
like image 116
HoofarLotusX Avatar answered Sep 20 '22 13:09

HoofarLotusX