我正在尝试使用 Ubuntu 12.10 (quantal) 和 R 2.15.1 (Roasted Marshmallows) 在 Rstudio (0.97.332) 中安装 rgdal 库。
我在 Ubuntu 中安装了关于 gdal 的以下内容:
$ 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
我也安装了项目:
$ 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
现在我启动 rstudio 并运行install.packages("rgdal",dependencies=TRUE)
我得到以下信息:
> 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
我不知道什么是 GDALAllRegister 以及我的下一步应该是什么。