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

[netCDF #OOJ-683540]: Building NetCDF with szlib



> Hi Russ,
> 
> Thanks for the quick response.
> I seem to be able to configure the NetCDF Fortran libraries okay, but
> running "make check" I get into trouble (see make-check-fortran.log).
> 
> I run configure with:
> CPPFLAGS=-I/home/clouds/cosp.v1.3.2/config/include
> LDFLAGS=-L/home/clouds/cosp.v1.3.2/config/lib
> LD_LIBRARY_PATH=/home/clouds/cosp.v1.3.2/config/lib ./configure
> --disable-shared --prefix=/home/clouds/cosp.v1.3.2/config
> 
> (If I run it without the LDFLAGS, it seems to miss out on the HDF
> libraries.)

I should have noticed you were using --disable-shared.  The instructions I
gave assumed you were using the default of shared libraries.

> libtool: link: gfortran -I../fortran -I../f90 -g -O2 -o nf_test test_get.o 
> test_put.o nf_error.o nf_test.o test_read.o test_write.o util.o fortlib.o  
> -L/home/clouds/cosp.v1.3.2/config/lib ../fortran/.libs/libnetcdff.a
> ../fortran/.libs/libnetcdff.a(fort-attio.o): In function `nf_put_att_text_':
/home/clouds/cosp.v1.3.2/install/netcdf-fortran-4.2/fortran/fort-attio.c:15: 
undefined reference to `nc_put_att_text'

That error is becasue "-lnetcdf" is missing, after the "-lnetcdff".
I think things will work if you try the configure again with
LDFLAGS="-L/home/clouds/cosp.v1.3.2/config/lib -lnetcdf", though if
the netCDF C library was built static instead of shared, you will
also need additional libraries in LDFLAGS, whatever "nc-config --libs"
shows are needed, for the nc-config that "make install" installed when
you built the netCDF C library.  So another way to set it would be to
use
LDFLAGS="`nc-config --libs`"

If that doesn't work, please let me know and we'll try to figure it out
from the resulting config.log and make check output.

--Russ



> On 11/15/11 20:06, Unidata netCDF Support wrote:
> > Hi Thorwald,
> >
> >> I'm struggling building NetCDF with szip (and HDF5).
> >> My best attempt seems to get through ./configure and make successfully,
> >> but fails midway through make check (see logs attached).
> >>
> >> In the directory /home/clouds/cosp.v1.3.2/config I have the following
> >> libraries installed (with --disable-shared):
> >> hdf5-1.8.7
> >> szip-2.1
> >> zlib-1.2.5
> >> udunits-2.1.24
> >> uuid-1.6.2
> >>
> >> After trawling through several online support discussions, I decided to
> >> try install the latest snapshot (2011111419), which compiled okay but
> >> lacked the fortran libraries I need.
> >
> > If you've successfully built and installed the netCDF C library from the 
> > snapshot,
> > getting the Fortran libraries is pretty easy.  Just download the (now 
> > separate)
> > netCDF Fortran release from here:
> >
> >    ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-fortran-4.2.tar.gz
> >
> > and run the configure script, specifying with LDFLAGS or LD_LIBRARY_PATH 
> > where the
> > C netCDF library is installed.  By giving a --prefix option to the configure
> > script, you can specify where the Fortran libraries should be installed, if
> > /usr/local isn't right:
> >
> >    LD_LIBRARY_PATH=/usr/local/lib CPPFLAGS=-I/usr/local/include ./configure 
> > --prefix=/where/ever/...
> >
> > Then run "make check" and "make install" to install the Fortran libraries.
> >
> > To link Fortran applications, you will need something like -L/usr/inlcude 
> > -lnetcdff -lnetcdf
> > to specify the separate netCDFFortran library before the netCDF C library.
> >
> > --Russ
> >
> > Russ Rew                                         UCAR Unidata Program
> > address@hidden                      http://www.unidata.ucar.edu
> >
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: OOJ-683540
> > Department: Support netCDF
> > Priority: Normal
> > Status: Closed
> >
> 
> --
> Dr Thorwald Stein, DYMECS Research Assistant
> Room 1U02, Dept of Meteorology
> University of Reading             Tel: +44 118 378 7995
> READING RG6 6BB, UK               Email: address@hidden
> 
> 

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



Ticket Details
===================
Ticket ID: OOJ-683540
Department: Support netCDF
Priority: Normal
Status: Closed