This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
> Hi > > The new build system in 4.1.3-rc1 gives an incorrect nc-config when static > linking is combined with an installation prefix that differs from the > location of the other libraries (like HDF5). > > I am on Cygwin and am building with static linking for the reasons most > recently explained in ticket YSA-381038. My C libraries are in /usr/lib (z, > curl) and /usr/local/lib (hdf5). Because I am building with a non-standard > Fortran compiler I use an installation prefix that differs from either of > these. As suggested in INSTALL, I tell configure where to find hdf5 using > CPPFLAGS and LDFLAGS. The full command is: > > > CC=gcc FC=g95 CPPFLAGS="-DpgiFortran -I/usr/local/include" > FFLAGS=-fno-second-underscore FCFLAGS=-fno-second-underscore > LDFLAGS=-L/usr/local/lib ./configure --disable-shared --enable-netcdf-4 > --enable-dap --with-libcf --prefix=/usr/local/netcdf4-g95 > The nc-config scripts gives libraries as follows: > > > $ ./nc-config --libs > -L/usr/local/netcdf4-g95/lib -lnetcdf -lhdf5_hl -lhdf5 -lm -lz -lcurl > $ ./nc-config --flibs > -L/usr/local/netcdf4-g95/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lm -lz > -lcurl > But the hdf5 library location is not included in this list, so I have to > specify "LDFLAGS=-L/usr/local/lib" every time I link, which I think you'll > agree is a bit of a drag. (I edited the nc-config script instead.) > > > 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. > Howdy Mark! I have fixed this in the codebase, both in the main trunk and the 4.1.3 branch. I am regenerating the snapshot release now - perhaps you could grab it and let me know if it works for you now. Thanks, Ed Ticket Details =================== Ticket ID: LAW-256659 Department: Support netCDF Priority: Normal Status: Closed