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

Re: 950824: XDR problem with ncopen



>Organization: Princeton/Geophysical Fluid Dynamics Laboratory/NOAA
>Keywords: 199508242019.AA20635 netCDF ncopen XDR

Hi John,

> I just rebuilt "gennet" using the new source Barry Schwartz sent me,
> and although it built OK, we immediately got the following after giving
> it a filename:
> 
>   ncopen: Bad flag 8

I can see how the error message

   ncopen: Bad flag

could occur, by calling either

      CALL NCOPN(filename, NCCLOB, iret) 

or 

      CALL NCOPN(filename, NCNOCLOB, iret)

both of which are errors because the NCCLOB and NCNOCLOB flags are only
appropriate for NCCRE() calls, not NCOPN() calls.  However I don't see where
the "8" comes from or how it could get in the error message.

> Now, you ask, how could such a minor mod have made any difference?
> Well, it probably didn't matter one whit.  It turns out that the
> previous version of the gennet executable (in which we found the
> problem) was built quite a while back, apparently before we went to
> IRIX 5, and before I rebuilt libnetcdf.a using the 'netcdf-232pl4'
> distribution.
> 
> Part of what cued me in that something was different was that the
> compilation and linking of gennet went thru OK without having to
> specify "/usr/lib/libsun.a" to get the XDR stuff in (like we used to
> have to do).  So I guess somewhere along the line, a decision was made
> to use the netCDF-supplied XDR instead of the system's.  (I did notice
> that "/usr/lib/libsun.a" is only 1356 bytes! - that seems odd! - maybe
> it's basically 'empty' under IRIX 5?)

If you use the "configure" script to build the Makefiles, as specified in
the INSTALL document, it still thinks "-lsun" is needed in linking the
executables.  I just verified that the resulting Makefiles use "-lsun" to
build the ncdump, ncgen, and nctest executables (the latter from "make
test").  The SGI system XDR should definitely be used instead of the
netCDF-supplied one.

The reason /usr/lib/libsun.a is so small is that it no longer contains the
Sun RPC and XDR libraries.  Those are now (with IRIX 5.x) included in
/usr/lib/libc.so, which is accessed by default.  It's probably no longer
necessary, with IRIX 5.x, to include "-lsun", and I just checked that ncdump
built fine without it.

> Anyhow, I'm stuck. The error seems to be coming either from 'xdrposix.c'
> or 'xdrstdio.c', but I can't figure out why.

Those aren't XDR library files, but netCDF files with confusing names that
make it look like they are part of the netCDF-supplied XDR library.

> Any ideas?

I suspect a problem with gennet.f, especially if "make test" reveals no
problems with your newly built netCDF software.  I just verified that "make
test" passes all the test on our IRIX 5.3 platform from the 2.3.2pl4 release.

--Russ

______________________________________________________________________________

Russ Rew                                           UCAR Unidata Program
address@hidden                              http://www.unidata.ucar.edu