Re: [netcdfgroup] installing netCDF with --enable-hdf4

On Mar 20, 2013, at 11:46 AM, Charlie Zender wrote:

> Hi netCDFers,
> 
> I'm trying to install netCDF with the optional HDF4 support.
> Is there a site that illustrates the procedure?
> I'm closer than before, stymied by a linking error.
> A summary of my attempt follows.
> 
> Any help appreciated,

Clearly the main HDF4 libraries, -lmfhdf and -ldf, are not getting into the 
link specification, though they are getting picked up at preprocessor time.  

I tried an opposite approach to yours, starting with the near-minimum, 
--enable-netcdf4 --enable-hdf4, and it compiled all the way through, including 
ncgen3.  However, one of the make checks failed to compile, interops3.  Anyway, 
perhaps that is worth trying:  start with just --enable-hdf4 and then add in 
options after that until it fails.

If the minimal approch still doesn't work, note that your LDFLAGS environment 
has to be set to find the HDF4 libraries, e.g., 
LDFLAGS=-L/wherever/your/libdf.a/is/located.

> cz
> 
> I build and install HDF5, then HDF4, then (attempt to build) netCDF4:
> 
> # HDF5 ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4/hdf5-1.8.9.tar.gz
> ./configure --prefix=/usr/local --enable-cxx --enable-fortran
> make;sudo make install
> # HDF4 http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/hdf-4.2.9.tar.gz
> ./configure --prefix=/usr/local --enable-fortran
> make;sudo make install
> # netCDF4
> LDFLAGS='-L/usr/local/lib' ./configure --prefix=/usr/local
> --enable-shared --enable-dap --enable-hdf4 --enable-logging
> --enable-netcdf4 --enable-v2
> make
> 
> The steps above all work fine with the simple change to --disable-hdf4.
> With --enable-hdf4 the netCDF make command fails in the ncgen3 section:
> 
> Making check in libsrc4
> make[1]: entrant dans le répertoire «
> /data/zender/tmp/netcdf-4.3.0-rc3/libsrc4 »
> make[1]: Rien à faire pour « check ».
> make[1]: quittant le répertoire «
> /data/zender/tmp/netcdf-4.3.0-rc3/libsrc4 »
> Making check in libdap2
> make[1]: entrant dans le répertoire «
> /data/zender/tmp/netcdf-4.3.0-rc3/libdap2 »
> make[1]: Rien à faire pour « check ».
> make[1]: quittant le répertoire «
> /data/zender/tmp/netcdf-4.3.0-rc3/libdap2 »
> Making check in liblib
> make[1]: entrant dans le répertoire «
> /data/zender/tmp/netcdf-4.3.0-rc3/liblib »
> make[1]: Rien à faire pour « check ».
> make[1]: quittant le répertoire « /data/zender/tmp/netcdf-4.3.0-rc3/liblib »
> make[1]: Rien à faire pour « check ».
> make[1]: entrant dans le répertoire «
> /data/zender/tmp/netcdf-4.3.0-rc3/ncgen3 »
> /bin/bash ../libtool --tag=CC   --mode=link gcc  -fPIC -m64
> -L/usr/local/lib -o ncgen3 main.o load.o escapes.o getfill.o init.o
> genlib.o ncgentab.o ../liblib/libnetcdf.la  -lhdf5_hl -lhdf5 -lm -lz -lcurl
> libtool: link: gcc -fPIC -m64 -o .libs/ncgen3 main.o load.o escapes.o
> getfill.o init.o genlib.o ncgentab.o  -L/usr/local/lib
> ../liblib/.libs/libnetcdf.so /usr/local/lib/libhdf5_hl.so
> /usr/local/lib/libhdf5.so -lm -lz
> /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so
> ../liblib/.libs/libnetcdf.so: undefined reference to `SDstart'
> ../liblib/.libs/libnetcdf.so: undefined reference to `SDend'
> ../liblib/.libs/libnetcdf.so: undefined reference to `SDattrinfo'
> ../liblib/.libs/libnetcdf.so: undefined reference to `SDfileinfo'
> ../liblib/.libs/libnetcdf.so: undefined reference to `SDreadattr'
> ../liblib/.libs/libnetcdf.so: undefined reference to `SDselect'
> ../liblib/.libs/libnetcdf.so: undefined reference to `SDreaddata'
> ../liblib/.libs/libnetcdf.so: undefined reference to `SDdiminfo'
> ../liblib/.libs/libnetcdf.so: undefined reference to `SDgetfillvalue'
> ../liblib/.libs/libnetcdf.so: undefined reference to `SDgetinfo'
> ../liblib/.libs/libnetcdf.so: undefined reference to `SDgetdimid'
> collect2: error: ld returned 1 exit status
> make[1]: *** [ncgen3] Erreur 1
> make[1]: quittant le répertoire « /data/zender/tmp/netcdf-4.3.0-rc3/ncgen3 »
> make: *** [check-recursive] Erreur 1
> 
> -- 
> Charlie Zender, Earth System Sci. & Computer Sci.
> University of California, Irvine 949-891-2429 )'(
> 
> _______________________________________________
> netcdfgroup mailing list
> netcdfgroup@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe,  visit: 
> http://www.unidata.ucar.edu/mailing_lists/ 

--
Dr. Christopher Lynnes     NASA/GSFC, Code 610.2    phone: 301-614-5185




  • 2013 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: