This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Hugh, > To: address@hidden > From: Hugh Ellis <address@hidden> > Subject: ncvarget failure > Organization: UCAR/Unidata > Keywords: 200304021507.h32F7p7U006497 The above message contained the following: > In attempting to build netcdf on my linux pc, I get the following error > involving ncvarget when running make test (I use pgf90, pg cc and c++ > compilers and RedHat 8.0). Could you please tell me what might be the > fix? The full log from make test is attached. > > Thanks, > > Hugh Ellis > > *** Testing ncvarput1 ... ok *** > *** Testing ncvarget1 ... ok *** > *** Testing ncvarput ... ok *** > *** Testing ncvarget ... *** test_slabs: ncvarget got wrong value for > point I was able to reproduce this error on our Linux/PC system using version 4.0 of the Portland Group's compilers. As far as I've been able to tell, the problem lies with the Portland Group's C compiler (pgcc). I say this because of the following: 1. We haven't encountered this problem in any other development environment; 2. The primitive C types ("char", "short", etc.) of the Portland Group C compiler are identical to those of the GNU C compiler, yet the netCDF package doesn't have this problem on the same platform when compiled using gcc instead of pgcc; 3. I've looked through the code at the place where the error occurs and I can't find anything wrong; 4. We've had problems with the Portland Group compilers before. I imagine you didn't want to hear this, but that's what it appears to be. As a workaround, I suggest using the GNU C compiler rather than the Portland Group C compiler. You can do this by setting the environment variable CC to the pathname of the GNU C compiler before executing the configure script (after doing a "make distclean", of course). Be sure that the environment variable CPPFLAGS contains the string "-DpgiFortran". Please let me know if this helps. Regards, Steve Emmerson