Mark Hadfield "Kei puwaha te tai nei, Hoea tahi tatou"
m.hadfield@xxxxxxxxxx
NIWA
>>> On 2010-05-25 at 06:39, Jennifer Adams <jma@xxxxxxxxxxxxx> wrote:
Here are the environment variables I had to set, the configure command I used,
and one additional change to the nco config.h file to get it to compile on
CentOS 64bit (gcc 4.1.2). I should add that some of these commands are tailored
to the way I built hdf5 and netcdf4. It seems so kludgey, but it worked. I
haven't tried with nco-4.0.1.
setenv CPPFLAGS -I/path_to_netcdf-4.1.1/include
setenv NETCDF4_ROOT /path_to_netcdf-4.1.1
setenv HDF5_LIB_DIR /path_to_hdf5-1.8.4-patch1
setenv LIBS "-L/path_to_netcdf-4.1.1-rc2/lib -lnetcdf \
-L/path_to_hdf5-1.8.4-patch1/lib -lhdf5_hl -lhdf5 \
-L/path_to_zlib/lib -lz -lm \
/path_to_szip-2.1/lib/libsz.a \
/path_to_curl-7.19.6/lib/libcurl.a \
-lrt -lz"
./configure --prefix=/path_to_nco-4.0.0 --enable-netcdf4 --disable-shared
--enable-static
Also added:
#define HAVE_NETCDF4_H 1
to config.h
I hope this helps!
--Jennifer
As of version 4.0.1, netCDF has the nc-config command to make the finding of
libraries a bit less tedious. So to set the LIBS variable you could write (as
Bash code)
export LIBS=$(nc-config --libs)
or maybe you might need
export LIBS=$(path_to_netcdf-4.1.1/bin/nc-config --libs)
NIWA is the trading name of the National Institute of Water & Atmospheric
Research Ltd.