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

Roger Bivand Roger.Bivand at nhh.no
Fri Sep 19 12:14:42 CEST 2014


On Fri, 19 Sep 2014, Michael Sumner wrote:

> Do we have the process used by CRAN to cross compile for Windows? I have
> the original notes but they are not complete especially for non gurus. It
> seems that prospects for support are more likely with this approach. I find
> the Windows config path very hard to understand.
>
> Still, I am keen to get this on Windows too if anyone else wants to start
> digging.

CRAN Windows rgdal binary packages are built statically linked (OSX 
binaries are also statically linked), so it is very much harder to include 
drivers involving external libraries.

For OSX, Kyngchaos remains a viable alternative for binary installs of 
rgdal.

It may be worth revisiting OSGeo4W as a route to a (slightly) wider range 
of drivers under Windows. There has been some mention of R on the 
OSGeo4W-dev list and in a ticket:

http://trac.osgeo.org/osgeo4w/ticket/413

but I think that it would call for a good deal of commitment to get 
OSGeo4W with rgdal, R, and more drivers to the level of Kyngchaos for OSX.

In general the conservative approach taken for CRAN external dependencies 
is well-motivated. The GDAL, PROJ.4 and GEOS external dependencies are 
satisfied thanks to work by Brian Ripley, Uwe Ligges and Simon Urbanek. 
For the vast majority of users, these drivers are sufficient. For almost 
everybody else, using a command line utility via system() is the best 
route to take. The level of complexity increases as a power of the number 
of different components and compilers.


>
> rgdal2 works with GDAL 2.0 but requires the linux gdal-config to be
> present. rgdal won't work with GDAL 2.0 but again I can spend time in the
> hole if others are able to help or encourage.
>

It may be worth adding the required #ifdef code to support GDAL 2.0 in 
rgdal, but GDAL 2.0 is not close to release. There is discussion on 
releasing GDAL 1.11.1, and current rgdal works as expected with the 
current 1.11 development branch of GDAL:

http://lists.osgeo.org/pipermail/gdal-dev/2014-September/040077.html

as well as the forthcoming PROJ.4 4.9.0:

http://lists.maptools.org/pipermail/proj/2014-September/006911.html

especially as GDAL 1.11.* is the stable branch and GDAL 2.* is still 
effectively experimental.

> I am not sure many users realize the enormity of this impending crisis

The real danger to GDAL and PROJ.4 is the very narrow developer base, 
(PROJ.4: > 90% commits Frank Warmerdam; GDAL: 23% commits Frank Warmerdam, 
50% Even Roualt, others most often in specific drivers or SWIG 
interfaces).

We all owe them more than we can imagine for their dedication and 
commitment.

Roger



>
> Cheers, Mike
> On 19 Sep 2014 18:17, "Roger Bivand" <Roger.Bivand at nhh.no> wrote:
>
>> 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 Windows:
>>
>> http://postgis.net/windows_downloads
>>
>> 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,
>>
>> Roger
>>
>>  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
>>
>> _______________________________________________
>> 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