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

[netCDF #CLB-814953]: Experience with netcdf-4.1.2-beta2



> Oh yes, I've been meaning to get back to you on this.
> 
> The behaviour on cygwin with the 4.1.2 release is the same as with the 
> pre-releases:
> If you specify --disable-shared, then you get static libraries only and 
> "nc-config --flibs" has a complete list of libraries.
> If you specify --enable-shared or don't specify --disable-shared, then you 
> *still* get only static libraries, but "nc-config --flibs" lists only 
> "-lnetcdff" and "-lnetcdf", so linking fails.
> So I build with --disable-shared.
> 
> Now, as to why shared libraries are not built where requested, I'm not sure 
> about that, though obviously Cygwin isn't really Unix so you'd expect some 
> differences. (And I must say I'm rather confused about the whole shared 
> library thing on Unix anyway.) The netCDF configure script confirms on 
> several occasions that the linker can create shared libraries, but none are 
> created. In the Cygwin system area (/usr/lib) all the static libraries have 
> shared counterparts with the names "libfoo.a" and "libfoo.dll.a", 
> respectively. Perhaps it's just some confusion because Cygwin shared 
> libraries don't follow the expected "libfoo.so" pattern, though you'd think 
> linktool and autoconf on Cygwin could handle that seamlessly by now.
> 
> By the way, I'm curious: if these magical shared libraries know what other 
> libraries they need, then why does "nc-config --libs" print a complete list 
> of libraries when "nc-config --flibs" doesn't?
> 
> Mark Hadfield          "Kei puwaha te tai nei, Hoea tahi tatou"
> address@hidden
> NIWA

Howdy Mark!

Shared libraries are a bit complex, but they offer significant advantages. And, 
best of all, when you use a tool like yum or apt-get you get the shared 
libraries without the hassle of having to understand what the heck is going on 
under the covers.

Unfortunately my cygwin system is (as our sysadmin puts it) "FUBARed" at the 
moment. When it comes back on line I will test with cygwin.

What I believe should happen with the daily snapshot is that cygwin should 
compile shared libaries just fine. Just run configure without any options and 
it will do shared libaries by default.

The topic of DLLs vs. shared libraries is one that has caused me considerable 
sweat and tears over the last year. However now I have mastered them and am 
producing DLLs on my linux box without the involvement of windows. It's 
charming.

To answer your final question, the configure script was overloading the way in 
which libraries were invoked. A recent refactoring of the build system has 
removed much of the complexity and I have just rewritten the construction of 
the nc-config script. In fact, it is nothing other than the value of LIBS after 
the netCDF configure script has been run, and has found all the libraries it 
needs. The changes I just made are in my branch, and will appear in the daily 
snapshot REAL SOON NOW.

Thanks!

Ed

Ticket Details
===================
Ticket ID: CLB-814953
Department: Support netCDF
Priority: Critical
Status: Closed