[R] Problem installing rgdal.

Michael Sumner mdsumner at gmail.com
Wed Oct 5 11:09:38 CEST 2016


>From source I always consult Edzer's Travis configurations such as:
https://github.com/edzer/spacetime/blob/master/.travis.yml
<https://github.com/edzer/gstat/blob/master/.travis.yml>

For really bleeding edge and all the other hard install libs on Docker  I
just go straight to the rockerverse:
https://hub.docker.com/r/rocker/hadleyverse/

For package installs, this is more or less what I do from scratch on Ubuntu
16.04, I *always* go for the updated packages to ensure GDAL is reasonably
up to date (current GDAL is 2.1.1 and PROJ.4 is 4.9.2).

(Everything else advice-wise seems to be forever out of date. )

(I include PROJ.4, GEOS, HDF4, NetCDF4 and their tools since I always need
them.)

## manual set config and key for apt-get update, see
http://cran.r-project.org/bin/linux/ubuntu/README
# echo 'deb https://cloud.r-project.org/bin/linux/ubuntu xenial/' >>
/etc/apt/sources.list
# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9

## manually set updated GDAL
## https://launchpad.net/~ubuntugis/+archive/ubuntu/ubuntugis-unstable
# add-apt-repository ppa:ubuntugis/ubuntugis-unstable --yes

apt-get update
apt-get upgrade

## Install 3rd parties ymmv

## HDF4
apt-get install libhdf4-dev
apt-get install hdf4-tools

## NetCDF
apt-get install libnetcdf-dev
apt-get install netcdf-bin

## GEOS
apt-get install libgeos-dev

## PROJ.4 and GDAL
apt-get install proj-bin
apt-get install libproj-dev
apt-get install libgdal-dev
apt-get install gdal-bin

## now R
apt-get install r-base r-base-dev

Rscript -e 'install.packages(c("rgdal"))'

Cheers, Mike.

On Wed, 5 Oct 2016 at 19:41 Rolf Turner <r.turner at auckland.ac.nz> wrote:

> On 05/10/16 20:47, Rainer M Krug wrote:
> > Rolf Turner <r.turner at auckland.ac.nz> writes:
> >
> >> On 05/10/16 12:56, ProfJCNash wrote:
> >>> Can you build/install the source package? I had a problem once where
> my libraries were "too recent" for the R package,
> >>> but I could build against my installed base. In any event, it may
> point out the source of the problem.
> >>>
> >>> I can appreciate your frustration -- been there, but wish I hadn't.
> >>
> >> Essentially install.packages() builds from source.
> >>
> >> I also tried to install from the source tarball; same error resulted.
> >>
> >> Surely there *must* be somebody out there who understands what's going
> >> on and how to fix it.  Mustn't there?
> >
> > I didn't follow the thread closely, but these types of errors can mean
> > version conflicts, i.e. that you have either two versions of gdal
> > installed and the installer picks up the wrong version or a mix of
> > versions or that you have the wrong version installed.
> >
> > Check you gdal installations (from source, package manager, whatever
> > there is), uninstall gdal completely and search thoroughly if there are
> > any leftovers (apt-get purge ...). Then I would logout and login again -
> > just to be sure that all caches are up to date (although I doubt this
> > is necessary).
> >
> > Than I would check if there are any stray installations or rgdal sitting
> > in any library.
> >
> > Than I would install all ubuntu packages neeed for gdal (from the CRAN
> > for rgdal: "for building from source: GDAL >= 1.6.3, library from
> http://trac.osgeo.org/gdal/wiki/DownloadSource and PROJ.4 (proj >= 4.4.9)
> from http://download.osgeo.org/proj/"), make sure that
> > they are working from the commandline, and that try again installing the
> > version of rgdal.
> >
> > And if not, there is r-sig-spatial which is a much better place to ask
> > rgdal related questions than r-help.
> >
> > Hope this helps.
>
> Thanks.  That seems to be good advice.  I'll try it.
>
> cheers,
>
> Rolf
>
> --
> Technical Editor ANZJS
> Department of Statistics
> University of Auckland
> Phone: +64-9-373-7599 ext. 88276 <+64%209-373%207599>
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
-- 
Dr. Michael Sumner
Software and Database Engineer
Australian Antarctic Division
203 Channel Highway
Kingston Tasmania 7050 Australia

	[[alternative HTML version deleted]]



More information about the R-help mailing list