[R] Help reinstalling rgdal (Ubuntu 16.04)

Alexandra Thorn m@il @ending from @lex@ndr@thorn@com
Thu Aug 9 17:36:23 CEST 2018


Hi all,

Following some updates to R that I received via Synaptic Package
Manager on Ubuntu 16.04 (looks like I now have R 3.4.4-1xenial0), I
have been unable to reinstall rgdal, and I need help.

Initially I was getting error messages about dependencies on GDAL
1.11.4, but after following instructions to install GDAL from source
(into my /usr/local directory) I'm now getting a different set of error
messages (see the output error messages posted below my signature).  

I can't tell if this means that I've made a mistake installing GDAL or
if there's some other problem with my setup/configuration.  I really
need rgdal for the analyses I do in R and could use some help figuring
this out.

Thanks,
Alex

> install.packages("rgdal")
Installing package into ‘/home/athorn/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/rgdal_1.3-4.tar.gz'
Content type 'application/x-gzip' length 1664774 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: R_HOME: /usr/lib/R
configure: CC: gcc -std=gnu99
configure: CXX: g++
configure: C++11 support available
configure: rgdal: 1.3-4
checking for /usr/bin/svnversion... no
configure: svn revision: 766
checking for gdal-config... /usr/local/bin/gdal-config
checking gdal-config usability... yes
configure: GDAL: 2.3.1
checking C++11 support for GDAL >= 2.3.0... yes
checking GDAL version >= 1.11.4... yes
checking gdal: linking with --libs only... no
checking gdal: linking with --libs and --dep-libs... no
In file included from /usr/local/include/gdal.h:45:0,
                 from gdal_test.cc:1:
/usr/local/include/cpl_port.h:187:6: error: #error Must have C++11 or
  newer. #    error Must have C++11 or newer.
      ^
In file included from /usr/local/include/gdal.h:49:0,
                 from gdal_test.cc:1:
/usr/local/include/cpl_minixml.h:202:47: error: expected template-name
  before '<' token class CPLXMLTreeCloser: public
  std::unique_ptr<CPLXMLNode, CPLXMLTreeCloserDeleter> ^
/usr/local/include/cpl_minixml.h:202:47: error: expected '{' before '<'
  token /usr/local/include/cpl_minixml.h:202:47: error: expected
  unqualified-id before '<' token In file included
  from /usr/local/include/ogr_api.h:45:0,
  from /usr/local/include/gdal.h:50, from gdal_test.cc:1:
/usr/local/include/ogr_core.h:79:28: error: expected '}' before end of
  line /usr/local/include/ogr_core.h:79:28: error: expected declaration
  before end of line In file included
  from /usr/local/include/gdal.h:45:0, from gdal_test.cc:1:
/usr/local/include/cpl_port.h:187:6: error: #error Must have C++11 or
  newer. #    error Must have C++11 or newer.
      ^
In file included from /usr/local/include/gdal.h:49:0,
                 from gdal_test.cc:1:
/usr/local/include/cpl_minixml.h:202:47: error: expected template-name
  before '<' token class CPLXMLTreeCloser: public
  std::unique_ptr<CPLXMLNode, CPLXMLTreeCloserDeleter> ^
/usr/local/include/cpl_minixml.h:202:47: error: expected '{' before '<'
  token /usr/local/include/cpl_minixml.h:202:47: error: expected
  unqualified-id before '<' token In file included
  from /usr/local/include/ogr_api.h:45:0,
  from /usr/local/include/gdal.h:50, from gdal_test.cc:1:
/usr/local/include/ogr_core.h:79:28: error: expected '}' before end of
  line /usr/local/include/ogr_core.h:79:28: error: expected declaration
  before end of line configure: Install failure: compilation and/or
  linkage problems. configure: error: GDALAllRegister not found in
  libgdal. ERROR: configuration failed for package ‘rgdal’
* removing ‘/home/athorn/R/x86_64-pc-linux-gnu-library/3.4/rgdal’

The downloaded source packages are in
	‘/tmp/RtmpeuSDnj/downloaded_packages’
Warning message:
In install.packages("rgdal") :
  installation of package ‘rgdal’ had non-zero exit status
> 



More information about the R-help mailing list