Message-ID: <CAKk5Q9Xsa_HywXRLWLUw04c1HvmQ0WfTMtMaMxfsO_MeNyqY6Q@mail.gmail.com>
Date: 2015-04-22T04:43:19Z
From: Rob Skelly
Subject: rgdal installation with two versions of GDAL
Hello,
I am using GDAL 2.0 for most of my work, but rgdal depends on GDAL < 2. I
have built and installed GDAL 1.11.2 in /opt/gdal-1.11.2, and rgdal
compiles and installs into R, using the following command:
sudo R CMD INSTALL
--configure-args="--with-gdal-config=/opt/gdal.1.11.2/bin/gdal-config"
rgdal-0.9-2.tar.gz
However when R attempts to load rgdal at the end of the installation, it
fails with the error,
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object
'/usr/local/lib/R/site-library/rgdal/libs/rgdal.so':
/usr/local/lib/R/site-library/rgdal/libs/rgdal.so: undefined symbol:
_ZN10OGRPolygon7addRingEP13OGRLinearRing
The addRing method on OGRPolygon seems to be a relic of GDAL 1.11.2 and no
longer exists in 2.0, so R is loading libgdal from /usr/local/lib, not
/opt/gdal-1.11.2/lib. I have confirmed this by temporarily moving the
1.11.2 libs into /usr/local, where it works fine.
So, the question is, how to I convince R to use the new library search
path? I'm on xubuntu, and R is installed using apt.
Thanks,
Rob
[[alternative HTML version deleted]]