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

[netCDF #JZT-105309]: neCDF 4.3.0 installation issue - Can't find or link to the hdf5 library



Peter,

I'm happy to report that things work as they are supposed to with
netCDF 4.3.0 and hdf5-1.8.9, with these differences from what you are
doing:

  1.  When building HDF5, tell it where to find the szip library, but
      don't specify --disable-shared, so it will build and install
      both shared and static libraries.

  2.  Then, building netCDF-4.3.0, don't mention anything about the
      location for where szip is installed in CPPFLAGS or LDFLAGS,
      just where HDF5 is installed.  The shared library is used in
      preference to the static library, and it has information about
      where to find szlib.  When I tested this approach, everything
      just worked.

The moral is, it's more difficult to build and test static libraries
than shared libraries, and you have to make sure paths to all
dependent libraries are properly specified when building netCDF, even
those you shouldn't have to care about, such as szlib.  For some
reason, our configure script isn't getting "-lsz" where it should when
building with a static hdf5 library, and the symptom is that it
reports it can't find the hdf5 library.

Shared libraries are easier for users to link against than static
libraries also.

If there's some reason you must build only static libraries, such as
that you intend to support parallel I/O, then it would be easier if
you install dependent libraries such as libsz in the same directories
you use for hdf5.

(By the way, if you're going to be rebuilding netcdf-4.3.0 , I suggest
using the more recent hdf5-1.8.11, as it has some bug fixes and
performance improvements that affect netCDF-4.)

Here's exactly what worked for me, to get a netCDF-4.3.0 shared
library with DAP support, netCDF-4 support, and ability to read
szip-compressed files::

#!/bin/sh
SRCDIRS=/machine/russ/sources
INSTALLS=/machine/russ/installs
cd ${SRCDIRS}/szip-2.1
SZDIR=${INSTALLS}/szip-2.1
./configure --prefix=${SZDIR} && make && make check install
cd ${SRCDIRS}/hdf5-1.8.9
H5DIR=${INSTALLS}/hdf5_189sz
./configure --prefix=${H5DIR} --with-szlib=${SZDIR} && make check install
cd ${SRCDIRS}/netcdf-4.3.0
NCDIR=${INSTALLS}/nc430_hdf189sz
CPPFLAGS=-I${H5DIR}/include LDFLAGS=-L${H5DIR}/lib ./configure 
--prefix=${NCDIR} && make check install

--Russ

Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: JZT-105309
Department: Support netCDF
Priority: Normal
Status: Closed