Re: [netcdfgroup] problem compiling netcdf 4.0.1

Cedric Roux <cedric.roux@xxxxxxxxxx> writes:

> Hi NetCDF people,
>
> I tried to compile netCDF 4.0.1 with HDF5 1.8.4.
> I use the --enable-hdf5-convert (why? I don't know,
> this parameter looked nice) and I have a problem
> in /libsrc4/nc4hdf.c, line 742. We have:
> ----
> #ifdef HDF5_CONVERT
>    if (H5Pset_type_conv_cb(xfer_plistid, except_func,
>                            &range_error) < 0)
>       BAIL(NC_EHDFERR);
> #endif
> ----
> But except_func is not defined anywhere in this file
> nor any other file.
> So the flag --enable-hdf5-convert does not work.
> (I also checked in 4.1pre-something, except_func
> is not defined there too.)
>
> I added:
> ----
> static H5T_conv_ret_t except_func(H5T_conv_except_t except_type,
>                                   hid_t src_id, hid_t dst_id,
>                                   void *src_buf, void *dst_buf,
>                                   void *op_data)
> {
>   printf("Sir, we have a problem...\n");
>   return H5T_CONV_ABORT;
> }
> ----
> a bit upper in the file to compile netCDF. Everything went
> fine then.
> (My bet is a better function has to be written. I am
> a total noob in there, can't be of much help.)
>
> Ah yes, I also enabled the version 4 support in
> the ./configure stage with the --enable-netcdf-4
>

Howdy Cedric!

May I first applaud your adventurousness. How refreshing it is to find
such hope and optimism! So sorry to have to crush them.

The conversion that is being controlled is the conversion of numbers
from one type to another - for example from floats to ints. It turns out
that netCDF classic and HDF5 handle converting out-of-range numbers in a
slightly different way. In order to get netCDF-4 behavior matching
netCDF classic, I have to take over this conversion from HDF5 and do it
my way.

The --enable-hdf5-convert option was intended to allow one to use the
HDF5 conversion instead, primarily because I wanted to test to see if it
was faster (but I never did).

Certainly there is no need for ordinary users to worry about this. The
only differences between HDF5 and netCDF are for extreme cases that
should not arise in normal practice anyway. So don't use
--enable-hdf5-convert.

I suppose I should just take this option out...

Thanks,

Ed

-- 
Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx



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