[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #YSA-381038]: Experience building netcdf-4.1.3.-rc1 on Cygwin



> Further to our dilatory exchanges of emails on the oddities of building 
> netCDF 4 with shared libraries under Cygwin (see ticket CLB-814953, which I 
> think has been closed) I have rebuilt Cygwin netcdf-4.1.3.-rc1 and I think I 
> have come to understand the source of the difficulties.
> 
> The problem, if you recall, is that if you build netCDF under Cygwin without 
> specifying --disable-shared, then the nc-config script is created under the 
> assumption that shared libraries will be built (i.e the only Fortran 
> libraries listed are netcdff and netcdf), but shared lbraries are not in fact 
> built, so linking fails until you edit the nc-config script to add the 
> missing libraries (hdf5, curl and such) back in. Or just accept the 
> inevitable  and build with --disable-shared.
> 
> With netcdf-4.1.3.-rc1 the build process is cleaner (as promised on the box), 
> but the same basic issue exists. But I think I understand why. It's because 
> there are no shared libraries for HDF5. And this occurs because (with 
> hdf5-1.8.7):
> The default is --disable-shared
> If --enable-shared is specfied, the hdf5 configure script rejects it, saying
> warning: shared libraries are not supported on Cygwin!
> disabling shared libraries
> use --enable-unsupported to override this warning and keep shared libraries 
> enabled
> I haven't yet been brave enough to turn on --enable-unsupported, so I have no 
> HDF5 shared libraries, hence no netCDF shared libraries, even if the 
> configure script thinks they're going to be built?
> 
> Does this make sense?
> 
> 
> Mark Hadfield          "Kei puwaha te tai nei, Hoea tahi tatou"
> address@hidden
> NIWA
> Please consider the environment before printing this email.
> 
> NIWA is the trading name of the National Institute of Water & Atmospheric 
> Research Ltd.
> 
> 

Yes, not only does this make sense, but I also figured this out.

You should certainly contact HDF5 support and tell them you want cygwin shared 
libraries. Actually they know how to do this, it may already work. Try 
searching for "cygwin" in the HDF5 configure script, and removing the lines 
that always turn off shared libraries. HDF5 might build shared libraries for 
you then.

If you don't have HDF5 shared libraries, then you cannot build netCDF shared 
libraries.

Thanks,

Ed

Ticket Details
===================
Ticket ID: YSA-381038
Department: Support netCDF
Priority: Normal
Status: Closed