[R-sig-Geo] 64-bit ncdf4 for Windows??

Roger Bivand Roger.Bivand at nhh.no
Mon Feb 11 21:27:34 CET 2013


On Mon, 11 Feb 2013, Tom Philippi wrote:

> All--
>
> Does anyone know if the update from R 2.15.2 to 3.0 is likely to change
> they way these binaries would need to be built?  I don't think that the
> NAMESPACE & .First.lib changes will matter, but I don't understand the
> implications of long.vectors. http://developer.r-project.org/30update.txt

No, no impact at all. The changes to NAMESPACE & .First.lib are only to 
lock out packages whose maintainers have not been submitting required 
changes (for years). Long vectors remove the 2^31-1 length limit on 
vectors, meaning that on 64-bit systems, vectors can be longer (and arrays 
and matrices are vectors, so the limit now is on the product of the 
dimensions). As the note says, the only consequence for package authors is 
that the value returned by length() may not be an integer. Otherwise no 
relevance to your concerns, unless you have single objects with > 2G 
values.

>
> The 64-bit MSwin binaries of ncdf available from unidata:
> http://www.unidata.ucar.edu/software/netcdf/win_netcdf/#binaries state that
> they are set up for use with Visual Studio.   I may call in a (big!) favor
> to have a Visual Studio / C friend work on this with me, and then make the
> 64-bit MSwin binary available to all, but I don't want to have to do it
> twice.

I doubt whether Visual Studio / C is of any help, unless you install 
ncdf4 locally using the same build train, so it may work in-house, and 
only as long as the same guy helps each time ncdf4 and/or the external 
software get updated.

What needs to be done for portability and future-proofing is to build the 
ncdf4 static library under MSYS for Windows 32 and 64 bit systems. CRAN 
does not permit the bundling of external DLLs any longer (or is moving 
towards forbidding them). The OSX ncdf4 binaries are built static, as are 
thw Windows ncdf binaries. The spatial packages that have serious external 
dependencies, rgdal and rgeos, are built static against Windows MSYS 
static libraries. See:

http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Windows-external-software

So if your colleague can compile ncdf4 and link it under MSYS using the 
Rtools compilers, and document any patches - feeding them back up to 
Unidata so that they don't need re-doing next time round - maybe this 
might work. The effort involved is typically substantial; Brian Ripley 
submitted patches to clean up GDAL for 64-bit systems.

In the link above, you'll see a reference to configure.win in rgdal; 
thanks to the uniform cross-compilation approach, all this now does is to 
copy PROJ.4 and GDAL metadata files, such as datum grids and EPSG lists, 
no linking to external DLLs remains as the build is static.

Hope this clarifies,

Roger

>
> While I would rather take the easy path & migrate back to linux, I work for
> the same agency as JohnG and thus am required to use MSwin.
>
> Tom 2
>
>
>
> On Sat, Feb 9, 2013 at 1:19 PM, JohnG <John_gross at nps.gov> wrote:
>
>> Yep.  That's what the developers tell me.  I'm grateful they've been
>> willing
>> to work on this, saving me the pain.  When the one working on this returns,
>> I'll post more precise info on the issues and error messages.  The Unidata
>> site makes it look simple, but it obviously is not.
>>
>> Thanks for having a look!
>> johng
>>
>>
>>
>> --
>> View this message in context:
>> http://r-sig-geo.2731867.n2.nabble.com/64-bit-ncdf4-for-Windows-tp7582474p7582549.html
>> Sent from the R-sig-geo mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
> 	[[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
>

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



More information about the R-sig-Geo mailing list