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

  • To: Charlie Zender <zender@xxxxxxx>
  • Subject: Re: [netcdfgroup] installing netCDF with --enable-hdf4
  • From: Roy Mendelssohn - NOAA Federal <roy.mendelssohn@xxxxxxxx>
  • Date: Wed, 20 Mar 2013 11:34:41 -0700
Oops I sent the following to Chris, meant to send to all:

My memory  (and I am old and don't remember too well) is because of the pseudo 
netcdf calls in the HDF4 library, that if the two are compiled and linked 
together  (netcdf3, hdf4) there are collisions and things fail.  There is an 
option in the HDF4 configure that you need to set when you are going to be 
linking both libraries, but I can't remember which.  You might do better 
posting this to the hdf help list.

-Roy
On Mar 20, 2013, at 11:31 AM, "Lynnes, Christopher S. (GSFC-6102)" 
<christopher.s.lynnes@xxxxxxxx> wrote:

> 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
> 
> 
> _______________________________________________
> netcdfgroup mailing list
> netcdfgroup@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe,  visit: 
> http://www.unidata.ucar.edu/mailing_lists/ 

On Mar 20, 2013, at 11:31 AM, "Lynnes, Christopher S. (GSFC-6102)" 
<christopher.s.lynnes@xxxxxxxx> wrote:

> 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
> 
> 
> _______________________________________________
> netcdfgroup mailing list
> netcdfgroup@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe,  visit: 
> http://www.unidata.ucar.edu/mailing_lists/ 

**********************
"The contents of this message do not reflect any position of the U.S. 
Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
1352 Lighthouse Avenue
Pacific Grove, CA 93950-2097

e-mail: Roy.Mendelssohn@xxxxxxxx (Note new e-mail address)
voice: (831)-648-9029
fax: (831)-648-8440
www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.



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