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

[netCDF #XIZ-386452]: netCDF v4 beta fails to build on Mac OS X



>
> >> My host:
> >>
> >> % uname -a
> >> Darwin trites.scd.ucar.edu 8.9.0 Darwin Kernel Version 8.9.0: Thu Feb
> >> 22 20:54:07 PST 2007; root:xnu-792.17.14~1/RELEASE_PPC Power
> >> Macintosh powerpc
> >>
> >> My compilers:
> >>
> >> % gcc -v
> >> gcc version 4.2.0 20060318 (experimental)
> >>
> >> % gfortran -v
> >> gcc version 4.2.0 20060218 (experimental)
> >>
> >> My environment:
> >>
> >> setenv CC gcc
> >> setenv CPPFLAGS '-DNDEBUG -Df2cFortran'
> >> setenv CFLAGS '-O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC'
> >> setenv FC gfortran
> >> setenv F77 gfortran
> >> setenv F90 gfortran
> >> setenv F77FLAGS '-O -Wno-globals'
> >> setenv F90FLAGS '-O -fno-common'
> >>
> >> Relevant files for HDF5 v1.8.0-beta1 installed in  /Users/grubin/
> >> {lib,include}.
> >>
> >> Your requested information:
> >>
> >> -- the exact version of netCDF - see the VERSION file.
> >>
> >> % pwd
> >> /Users/grubin/src/netcdf-4.0-beta1
> >>
> >> trites% cat VERSION
> >> 4.0-beta1
> >>
> >>
> >> -- the *complete* output of “./configure”,
> >> “make”, and “make
> >> check. Yes, it's long, but it's all important.
> >>
> >> Attached is output from:  ./configure --with-hdf5=/Users/grubin --
> >> enable-netcdf-4 --disable-f77 --disable-f90
> >>
> >>
> >>
> >> -- if the configure failed, the contents of config.log.
> >>
> >> Attached is the config.log file
> >>
> >>
> >>
> >
> > Howdy Rick!
> >
> > There is no point tricking the configure into proceeding. If it
> > detects a problem, then there will be a problem in the build, even
> > if the configure proceeded. ;-)
> >
> > The problem may be that you did not build HDF5 with the zlib
> > compression library. Complete instructions for building HDF5 as
> > part of netCDF-4 can be found here:
> >
> > http://www.unidata.ucar.edu/software/netcdf/netcdf-4/newdocs/netcdf-
> > install/Quick-Instructions.html
> >
> > Please let me know if this doesn't help.
>
> I beg to differ:
>
> % head src/hdf5-1.8.0-beta1/config.log
> This file contains any messages produced by compilers while
> running configure, to aid debugging if configure makes a mistake.
>
> It was created by HDF5 configure 1.8.0-beta1, which was
> generated by GNU Autoconf 2.61.  Invocation command line was
>
> $ ./configure --prefix=/Users/grubin --disable-shared --disable-
> fortran --disable-cxx --enable-static-exec --enable-linux-lfs --with-
> pic --with-szlib=/Users/grubin --with-zlib=/Users/grubin
>
> Clearly HDF5 was built with zlib (and szlib).  Checking the HDF5
> libraries shows the relevant symbols are present.
>
> I believe that netCDF4's configure file isn't including "-lsz" when
> checking for the presence of HDF5 libraries.  When I add "-lsz" to
> the   LIBS="-lhdf5  $LIBS"   portion of the configure script that
> checks for HDF5 library presence, the configure script completes
> normally, and everything proceeeds as expected.
>
> I think the script is broken.  When I look at the output of
> config.log, I see this:
>
> configure:28904: gcc -o conftest -O -D_FILE_OFFSET_BITS=64 -
> D_LARGEFILE_SOURCE -fPIC -DNDEBUG -Df2cFortran \
> -I/Users/grubin/include  -L/Users/grubin/lib conftest.c -lhdf5   -lm -
> lz -lhdf5 >&5
> /usr/bin/ld: Undefined symbols:
> _SZ_encoder_enabled
> _SZ_BufftoBuffCompress
> _SZ_BufftoBuffDecompress
>
> That looks like failing to find symbols in libsz.a, because "-lsz"
> isn't in the compile command.
>
> Since HDF5 can be built with szip compression (see .../hdf5-1.8.0-
> beta1/release_docs/INSTALL, section 4.2) so that lossless
> compression is available, not accounting for that possibility seems
> to be causing the problem.
>

It is true that the netCDF-4 build is failing because szip is not included, but
you can include it by setting the flags appropriatly. The following works for
me:
FFLAGS=-L$HDF5DIR/lib FCFLAGS=-L$HDF5DIR/lib CFLAGS=-L$HDF5DIR/lib
CPPFLAGS=-I$HDF5DIR/include LIBS=-lsz ./configure --enable-netcdf-4
--with-hdf5=$HDF5DIR

(Where $HDF5DIR is a directory holding both szip and HDF5).

It is not clear to me that the netCDF-4 configure script should actually do
this for you, but we are discussing that now. There are some license issues
with the szip library.

> ---------------------
>
> As well, this question/problem was not addressed (so I include it
> again):
>
> Second problem: netCDF-4 fails to build once configured
>
> configured as:  ./configure --with-hdf5=/Users/grubin --enable-netcdf-4
> (wanting a Fortran interface built).
>
> Attached is the output from 'make' but it essentially boils down to
> the C interface to v2 compatibility.
>
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I. -I.. -I. -I/Users/
> grubin/include -I../libsrc4 -DNDEBUG -Df2cFortran -I/Users/grubin/
> include -O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -MT fort-
> v2compat.lo -MD -MP -MF .deps/fort-v2compat.Tpo -c fort-v2compat.c -o
> fort-v2compat.o
> fort-v2compat.c: In function 'c_nccre':
> fort-v2compat.c:242: error: 'NC_CLASSIC_MODEL' undeclared (first use
> in this function)
> fort-v2compat.c:242: error: (Each undeclared identifier is reported
> only once
> fort-v2compat.c:242: error: for each function it appears in.)
> fort-v2compat.c: In function 'c_ncopn':
> fort-v2compat.c:288: error: 'NC_CLASSIC_MODEL' undeclared (first use
> in this function)
> make[3]: *** [fort-v2compat.lo] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
>
>
>

Could you have an old version of netCDF installed in these directories? Is your
build finding an old netcdf.h?

Thanks,

Ed


Ticket Details
===================
Ticket ID: XIZ-386452
Department: Support netCDF
Priority: Critical
Status: Closed