#63 Build problem in NCO v4.2.1

closed-fixed
None
5
2013-01-15
2012-10-29
Jeffrey Blundell
No

I'm trying to build NCO v4.2.1, having previously built several versions up to v4.0.7 successfully. I'm now having problems running ./configure, which fails in running some of the netCDF test programs, because it can't/doesn't link the underlying HDF5 libraries correctly. I used to provide information about the (nonstandard) location of my HDF5 library via the HDF5_LIB_DIR environment variable, but since v4.0.7 configure doesn't seem to recognise this. How do I now tell the configuration process where HDF5 is hiding? Thanks in anticipation,

Jeff Blundell

Discussion

  • Charlie Zender
    Charlie Zender
    2012-10-29

    We just released 4.2.2. Please try to build with that.
    You can always pass compiler options straight through to configure with, e.g.,

    CPPFLAGS='-DHAVE_NETCDF4_H -I/usr/local/include' LDFLAGS='-L/usr/local/lib' ./configure --prefix='/usr/local'

    But basically configure is supposed to find HDF for you, and if it's on your default paths (i.e., PATH and LD_LIBRARY_PATH) then it will.

    Keep us posted.

     
  • Charlie Zender
    Charlie Zender
    2012-10-29

    • assigned_to: nobody --> zender
     
  • OK, I've tried adding the HDF5 information to my environment via PATH and LD_LIBRARY_PATH, but it doesn't help. I think I see the problem more clearly; as well as that information, it needs to be told how to link the HDF5. If I look at my successful build of v4.0.7, in the output from ./configure it says:
    #################################
    # Test for netCDF4 support #
    #################################
    NETCDF4_ROOT is set and exists---assuming it is real
    checking for nc4_enddef_netcdf4_file in -lnetcdf... yes
    DEBUG: After netCDF4 section LIBS = -lnetcdf -lhdf5_hl -lhdf5 -lz

    The current ./configure (I'm still trying v4.2.1 as v4.2.2 is still in beta) doesn't seem to figure out that it needs to add -lhdf5_hl -lhdf5 -lz after -lnetcdf, and if I try to specify these in LIBS before starting ./configure, it fails at a much earlier stage, claiming that the C compiler is broken (which it isn't). So I think the key is feeding in the -lhdf5_hl -lhdf5 -lz stuff somehow, or getting ./configure to do it like it used to. Any thoughts?
    Jeff

     
  • OK, I think I've got it to work, and the additional tricks were

    setenv LDFLAGS -L${HDF5_LIB_DIR}
    setenv LIBS '-lhdf5_hl -lhdf5 -lz'

    which all makes sense in retrospect (I could explain if you're interested).
    Thanks for your earlier help,

    Jeff Blundell

     
  • Charlie Zender
    Charlie Zender
    2012-10-31

    i agree with your diagnosis and the fix makes sense.
    NCO configure tries to use nc-config to set these.
    if you supply a patch to configure.in that makes this work in your case, that would be great.
    cz

     
  • Charlie Zender
    Charlie Zender
    2012-10-31

    • status: open --> open-fixed
     
  • Charlie Zender
    Charlie Zender
    2013-01-15

    • status: open-fixed --> closed-fixed