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.
> Glenn, > > In trying to duplicate a netCDF problem reported to support, I tried to > run "make test" in the libsrc directory of the 3.3.1 distribution on > chevy: > > netcdf-3/irix_6.2-mips/src/libsrc$ make test > ar cru libnetcdf.a attr.o dim.o error.o libvers.o nc.o ncio.o ncx.o putget.o string.o v1hpg.o v2i.o var.o > : libnetcdf.a > /bin/c89 -o t_nc -g t_nc.o -L. -lnetcdf > ./t_nc > trying again > *** Error code 13 (bu21) > > This is repeatable, but only seems to happen when I'm running the test > in an NFS-mounted directory (my /home/russ/netcdf-3/ directory). I had > Mike create an NFS2 mount in /mnt/, and the same error still occurred. > But if I copy the files to /tmp/ on chevy, everything seems to work > fine. > > I doubt if it matters, but I'm using the following environment variables > for building and testing: > > export CPPFLAGS= > export CFLAGS=-g > export CC=/bin/c89 > export FC=/bin/f77 > export FFLAGS=-g > export CXX=/bin/CC > > I've already answered the support question by using the /tmp/ directory > on chevy, but do you have any idea why running libsrc/t_nc on > NFS-mounted directories on chevy is now failing? The problem is that the first create is making a file with mode 0, due to improper modes being set. This has already been reported and fixed: % cvs log posixio.c ... revision 1.59 date: 1997/09/23 18:55:19; author: davis; state: Exp; lines: +14 -4 Use standard macros. No need to set O_TRUNC when O_EXCL, and having both set causes problems with IRIX 6.2 and NFS. address@hidden (Ethan Alpert) 199709221820.MAA25471 You can seach for the discourse between Ethan and myself on this Subject using the word IRIX in the email database. Find the referenced revision as a patch attached. -glenn >Keywords: 199709221820.MAA25471 >Re: 970922: problem with nccreate on IRIX 6.2 using netcdf3.3.1
Index: posixio.c =================================================================== RCS file: /upc/share/CVS/netcdf-3/libsrc/posixio.c,v retrieving revision 1.59 retrieving revision 1.58 diff -c -r1.59 -r1.58 *** posixio.c 1997/09/23 18:55:19 1.59 --- posixio.c 1997/07/19 22:14:21 1.58 *************** *** 2,8 **** * Copyright 1996, University Corporation for Atmospheric Research * See netcdf/COPYRIGHT file for copying and redistribution conditions. */ ! /* $Id: posixio.c,v 1.59 1997/09/23 18:55:19 davis Exp $ */ #include "ncconfig.h" #include <assert.h> --- 2,8 ---- * Copyright 1996, University Corporation for Atmospheric Research * See netcdf/COPYRIGHT file for copying and redistribution conditions. */ ! /* $Id: posixio.c,v 1.58 1997/07/19 22:14:21 davis Exp $ */ #include "ncconfig.h" #include <assert.h> *************** *** 738,751 **** #define NCIO_MINBLOCKSIZE 256 #define NCIO_MAXBLOCKSIZE 268435456 /* sanity check, about X_SIZE_T_MAX/8 */ - #ifdef S_IRUSR - #define NC_DEFAULT_CREAT_MODE \ - (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) /* 0666 */ - - #else - #define NC_DEFAULT_CREAT_MODE 0666 - #endif - int ncio_create(const char *path, int ioflags, size_t initialsz, --- 738,743 ---- *************** *** 753,759 **** ncio **nciopp, void **const igetvpp) { ncio *nciop; ! int oflags = (O_RDWR|O_CREAT); int fd; int status; --- 745,751 ---- ncio **nciopp, void **const igetvpp) { ncio *nciop; ! int oflags = (O_RDWR|O_CREAT|O_TRUNC); int fd; int status; *************** *** 771,786 **** if(fIsSet(ioflags, NC_NOCLOBBER)) fSet(oflags, O_EXCL); - else - fSet(oflags, O_TRUNC); #ifdef O_BINARY fSet(oflags, O_BINARY); #endif #ifdef vms ! fd = open(path, oflags, NC_DEFAULT_CREAT_MODE, "ctx=stm"); #else /* Should we mess with the mode based on NC_SHARE ?? */ ! fd = open(path, oflags, NC_DEFAULT_CREAT_MODE); #endif #if 0 (void) fprintf(stderr, "ncio_create(): path=\"%s\"\n", path); --- 763,776 ---- if(fIsSet(ioflags, NC_NOCLOBBER)) fSet(oflags, O_EXCL); #ifdef O_BINARY fSet(oflags, O_BINARY); #endif #ifdef vms ! fd = open(path, oflags, 0666, "ctx=stm"); #else /* Should we mess with the mode based on NC_SHARE ?? */ ! fd = open(path, oflags, 0666); #endif #if 0 (void) fprintf(stderr, "ncio_create(): path=\"%s\"\n", path);