[R-sig-Geo] Trying to install rgdal from source on Windows 7 (and failing)

Roger Bivand Roger.Bivand at nhh.no
Fri Sep 19 10:15:30 CEST 2014

On Fri, 19 Sep 2014, Dutrieux, Loic wrote:

> You may try some steps documented in the README.windows file, included 
> in the package sources. 
> https://r-forge.r-project.org/scm/viewvc.php/pkg/inst/README.windows?view=markup&root=rgdal

Thank you for pointing to this file.

> But note that the file has not been updated in a little while. I can't 
> tell whether this is still likely to work or not...

This is correct.

My feeling is that installing rgdal from source on Windows is going to 
take (much) more time learning about compilers and their peculiarities 
than using command line utilities distributed in the PostGIS bundle for 


There shp2pgsql and pgsql2shp are mentioned, but as GDAL is also 
installed, ogr2ogr would let you use other intermediate file formats than 
ESRI Shapefiles, provided that the drivers are in the rgdal Windows binary 
package. Writing a small R function to run and check system() or system2() 
to run the command line utilities from inside R will be much easier than 
installing rgdal from source unless you know a lot about the compliers 
used with PostGIS and R. It also removes concerns that some components may 
be 32-bit or 64-bit.

Hope this helps,


> Cheers,
> Loïc
> ________________________________________
> From: r-sig-geo-bounces at r-project.org [r-sig-geo-bounces at r-project.org] on behalf of Cynthia Hart [cyndyh at nmsu.edu]
> Sent: Thursday, September 18, 2014 7:34 PM
> To: r-sig-geo at r-project.org
> Cc: cyndyh at nmsu.edu
> Subject: [R-sig-Geo] Trying to install rgdal from source on Windows 7 (and      failing)
> I have been using the (wonderfully useful) rgdal package for some time
> now, but I now have a need to incorporate rgdal with PostGIS/PostgreSQL,
> so, I find that I need more drivers than were included with the CRAN
> release version of rdgal that I was using.  I have GDAL already
> installed.   However, I am unable to build rgdal from source.  I have
> the rgdal_0.8-16.tar file, and when I try to run install.packages from
> this tar file, I get"
>        install.packages("C:\\JORNADA\\rgdal_0.8-16.tar", repos = NULL, type="source")
>        Installing package into ‘C:/Users/cynthart/Documents/R/win-library/3.0’
>        (as ‘lib’ is unspecified)
>        * installing *source* package 'rgdal' ...
>        ** package 'rgdal' successfully unpacked and MD5 sums checked
> *       cp: cannot stat `/share/proj': No such file or directory
>        cp: cannot stat `/share/gdal': No such file or directory*
>        ERROR: configuration failed for package 'rgdal'
>        * removing 'C:/Users/cynthart/Documents/R/win-library/3.0/rgdal'
>        Warning in install.packages :
>        running command '"C:/PROGRA~1/R/R-30~1.1/bin/x64/R" CMD INSTALL -l "C:\Users\cynthart\Doc               uments\R\win-library\3.0" "C:/JORNADA/rgdal_0.8-16.tar"' had status 1
>        Warning in install.packages :
>        installation of package ‘C:/JORNADA/rgdal_0.8-16.tar’ had non-zero exit status
> I basically understand the error, but I do not know how to go about 'fixing' it.  Can anyone please point me in the right direction?  Thank you!
>        [[alternative HTML version deleted]]
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: Roger.Bivand at nhh.no

More information about the R-sig-Geo mailing list