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

Re: 971117: compiling netcdf on VPP 300



> > first error in
> >
> >         vcc -DsunFortran -c -O -I.  -DNDEBUG ncio.c
> > "/usr/include/unistd.h", line 104: error: too many same data types
> > specified for declaration of `(noname)'
>
> Ouch!  The above looks like a problem with your compiler environment.
> What does your systems administrator say about this problem?

This is probably a problem with the #include files on the system.
(Multiple includes without proper protection.) It _may_ also indicate
that he needs to use additional C flags to get the UNIX environment,
like the -D_HPUX_SOURCE on HP-UX.

> >
> > I therefore commented out
> >
> > #include <unistd.h>
> >
> > in posixio.c
> >
> > All fine
>
> Amazing!  Be advised that just because ncio.c compiled without the
> <unistd.h> header, it still might not work without it.  This is because
> the C compiler will assume that undeclared (but used) functions will
> return an "int"; whereas, they might actually return something that
> isn't.

The prototypes needed by posixio.c which should be provided by
<unistd.h> are
        lseek(),
        close(),
        write(),
        read(),
        and possibly ftruncate()
The symbols needed are at least SEEK_SET, SEEK_CUR, and SEEK_END, which
get defaulted to historical values if not available.

> > except the following warning on many lines
> >
> > ncx.c", line 1231: warning: floating point constant `3.40282347e+38' is
> > out of range of `float'
>
> Interesting.  That constant was carefully chosen to be a valid
> floating-point value on IEEE systems (which, apparently, the vpp300
> is).  I note, however, that FLT_MAX on our SunOS 5.6 system is
> 3.402823466E+38F -- a slightly smaller value.  One possible cause for
> the warning is that the vcc compiler uses an algorithm for converting
> a decimal floating-point value into a binary one that is slightly
> different than that of most IEEE machines.
>
> I suggest manually modifying the file libsrc/ncx.h: change the line
>
>     #define X_FLOAT_MAX     3.40282347e+38f
>
> to
>
>     #define X_FLOAT_MAX     3.402823466e+38f
>
> or even
>
>     #define X_FLOAT_MAX     3.40282346e+38f
>
> and excute the command "make" in the libsrc/ directory.  Does the
> warning dissapear?
>
> I've CC'ed the developer of the netCDF package in case he has any
> comments on this.

I agree with Steve's analysis and suggestions.

-glenn