This seems to work, provided the correct nc-config is on the path
LIBS="$(nc-config --libs)" ./configure --disable-shared <other stuff>
though at the cost of some repetition in the end result
$ nc-config --libs
-L/usr/local/lib -L/usr/local/lib -lnetcdf -lhdf5_hl -lhdf5 -lm -lz -lcurl
$ nf-config --flibs
-L/usr/local/lib -lnetcdff -lnetcdf -L/usr/local/lib -L/usr/local/lib -lnetcdf
-lhdf5_hl -lhdf5 -lm -lz -lcurl
Is setting LIBS this way good practice, do you think?
And also you can do this
CPPFLAGS="-I$(nc-config --includedir)"
Just trying to lower the bar a little ;-). I see a lot of people struggling
with netCDF4 configuration on the ROMS forum. The answer I've given up to now
is "nc-config is your friend". And shared libraries, obviously, if your
platform supports them.
Mark Hadfield "Kei puwaha te tai nei, Hoea tahi tatou"
m.hadfield@xxxxxxxxxx
NIWA
>>> On 2011-08-19 at 12:06, "Mark Hadfield" <m.hadfield@xxxxxxxxxx> wrote:
I understand that LIBS is not required with the C library (though you can, of
course, control which libraries are needed via --enable-<package> and
--disable-<package>) so this is a "feature" introduced by the Fortran-C
separation. It's raising the bar a little.
Just saying... :-)
Mark Hadfield "Kei puwaha te tai nei, Hoea tahi tatou"
m.hadfield@xxxxxxxxxx
NIWA
Please consider the environment before printing this email.
NIWA is the trading name of the National Institute of Water & Atmospheric
Research Ltd.