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

[netCDF #GPS-461433]: netcdf-4: libsrc/v2i.c needs nc.h



> Hi Ed,
>
> > Are you building with --enable-netcdf-4? I assume not, because that is
where the problem is. When nc.h is included, the netcdf-4 layer no longer works
with the v2 api, and that's no good.
> >
> > This is a little complicated because of the way the v2/v3/v4 APIs are
handled, but basically the rename.h file included in nc.h will rename all
functions nc_* to nc3_*, and only call the v3 API version of those functions,
instead of the v4.
> >
> > Since v2 API users also need access to V4 features, making the change you
suggest is no good.
> >
> > Can you send me the configure and build commands you are using for the
cross-compile? Perhaps I can try it here and reproduce your original problem,
and see if there is a good way around it. I'm sure there must be a mistake
somewhere else, because I don't get these build errors.
>
> this problem is really independent of cross-compiling, it happens
> also with native compiles.  The basic reason is that for the NEC SX,
> SIZEOF_LONG is *different* from SIZEOF_SIZE_T by default; this is
> documented behavior , and it needs a special compiler flag to enable
> the equality by changing SIZEOF_SIZE_T.  However, this would require
> to recompile all programs and libraries with this flag.
>
> You can reproduce the compilation failure by temporarily replacing
> line 13 in libsrc/v2i.c
>
> #if SIZEOF_LONG == SIZEOF_SIZE_T
>
> by
>
> #if (SIZEOF_LONG == SIZEOF_SIZE_T) && 0
>
> I just did this on my Linux box (with --disable-netcdf-4 !!) and got:
>
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I../fortran -I../libdap
> -DgFortran -DNDEBUG -DUSE_SXP -g -Os -pipe -MT v2i.lo -MD -MP -MF
> .deps/v2i.Tpo -c v2i.c -o v2i.o
> v2i.c: In function 'nvdims':
> v2i.c:40: error: 'NC' undeclared (first use in this function)
> v2i.c:40: error: (Each undeclared identifier is reported only once
> v2i.c:40: error: for each function it appears in.)
> v2i.c:40: error: 'ncp' undeclared (first use in this function)
> v2i.c:44: error: expected '=', ',', ';', 'asm' or '__attribute__' before
> '*' token
> v2i.c:44: error: expected expression before 'const'
> v2i.c:45: error: 'varp' undeclared (first use in this function)
> make[3]: *** [v2i.lo] Error 1
> make[3]: Leaving directory
> `/home/hanlauf/xfer/netcdf-4.0.1-beta1-snapshot2008112502/libsrc'
> make[2]: *** [all] Error 2
> make[2]: Leaving directory
> `/home/hanlauf/xfer/netcdf-4.0.1-beta1-snapshot2008112502/libsrc'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory
> `/home/hanlauf/xfer/netcdf-4.0.1-beta1-snapshot2008112502'
> make: *** [all] Error 2
>
>
> The error message is exactly the same as in the SX case!
> Maybe this helps to see where the bug is.
>

Howdy Harald!

Well I looked into this issue again, and I see it is a complex one which has
haunted us in the past.

So I would like to fist see if your build works with --disable-v2.

This will test whether the problem is confined to the v2i.c file, or exists in
other part of the code.

Please do send me *all* output, including all make check output and the
config.log. It is hard to know what I will need to see, so please send it all.

Thanks,

Ed


Ticket Details
===================
Ticket ID: GPS-461433
Department: Support netCDF
Priority: Critical
Status: Open