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

Russ Rew: Re: 970717: ncgen on cray



>To: address@hidden
>cc: address@hidden,
>cc: address@hidden
>From: John Caron <address@hidden>
>Subject: ncgen on cray
>Organization: UCAR 
>Keywords: 199707171600.KAA13098

Oops, forgot to CC: support-netcdf on this one ...

------- Forwarded Message

Date:    Thu, 24 Jul 1997 15:58:21 -0600
From:    Russ Rew <address@hidden>
To:      address@hidden (Mary Haley)
Subject: Re: 970717: ncgen on cray 

Hi Mary,

> I've been trying to help this user as well, by rebuilding ncgen on SCD's
> Crays with the patch you mentioned.  When I use this new ncgen and also
> the one in /home/antero/davis/netcdf/bin, I get the following message:
> 
> antero[175] which ncgen
> /usr/local/apps/UNICOS-9.02/netcdf-3.31/bin/ncgen
> antero[176] ncgen -b test.cdf
> ncgen: test.cdf line 8: variable : _FillValue type mismatch
> antero[177]  /usr/local/bin/ncgen -b test.cdf
> ncgen: test.cdf line 8: variable Hold: _FillValue type mismatch
> antero[178] /home/antero/davis/netcdf/bin/ncgen -b test.cdf
> ncgen: test.cdf line 8: variable : _FillValue type mismatch
> 
> I didn't get the core dump that he mentioned, but was wondering if this
> error message was to be expected. 

When you rebuilt ncgen after modifying ncgen.y, I suspect that yacc was
never invoked to generate a new version of ncgentab.c from ncgen.y.
This may be because of an error in the ncgen Makefile.  Please replace
the ncgen Makefile with the one I've appended.  (Please try to
preserve the "TAB" characters in the Makefile, which may be lost if you
just cut-and-paste it.  It would be better to save this message in a
file, then delete everything that's not the Makefile.)

Next, in the ncgen directory, delete ncgentab.c and ncgentab.h, make
sure the ncgen.y is the patched version, and try "make all" again in the
ncgen directory.

If this succeeds in building a new ncgen, you can test it on the
following 5-line file, which you should store in fbug.cdl (in this case
you can just cut-and-paste, tabs are not important).

- -----------------------cut here for ncgen/fbug.cdl---------------------
netcdf fbug {
variables:
        float ff;
            :_FillValue = -9999.99f;
}
- -----------------------------------------------------------------------

Then, test if the ncgen is fixed by invoking

  ./ncgen -b fbug.cdl

This should create a netCDF file fbug.nc and produce no error messages,
if the error is fixed.  I've just verified all of this on my Sun, but if
you have any problems, please let me know.  Thanks!

Thanks, and sorry this is so complicated to test.

- --Russ


- -----------------------cut here for ncgen/Makefile----------------------------
# Makefile for ncgen(1).
#
# $Id: Makefile,v 1.26 1997/07/02 17:22:18 steve Exp $

include ../macros.make

PROGRAM         = ncgen
INCLUDES        = -I../libsrc -I.
MANUAL          = ncgen.1
GARBAGE         = $(PROGRAM) \
                  netcdf.inc \
                  c0.nc c1.cdl c1.nc c2.cdl \
                  f0.nc \
                  ctest.c ctest ctest0.nc ctest1.cdl \
                  ftest.f ftest ftest0.nc ftest1.cdl

lib_netcdf      = ../libsrc/libnetcdf.a
# Don't use "-L../libsrc -lnetcdf" in the following because that doesn't
# work on a CRAY T90 (sigh).
ld_netcdf       = $(lib_netcdf)

PACKING_LIST    = Makefile depend escapes.c generic.h \
                  ncgenyy.c ncgentab.c ncgentab.h \
                  genlib.c genlib.h getfill.c init.c load.c \
                  main.c ncgen.1 ncgen.h ncgen.l ncgen.y c0.cdl

OBJS            = main.o load.o ncgentab.o escapes.o \
                  getfill.o init.o genlib.o

lex             = flex
yacc            = yacc

program_srcs    = main.c load.c ncgentab.c escapes.c \
                  getfill.c init.c genlib.c

all:            $(PROGRAM)

test:           $(PROGRAM) b-test c-test f-test FORCE

install:        $(BINDIR)/$(PROGRAM) $(MANDIR)/man1/$(MANUAL)

$(PROGRAM):     $(OBJS) $(lib_netcdf)
        $(LINK.c) $(OBJS) $(ld_netcdf) $(LIBS) 

# "cat >" is used in the following rule to support linktree(1)-style
# development and testing on a Solaris system.
#
ncgentab.c \
ncgentab.h:     ncgen.y ncgenyy.c ncgen.h
            echo 1>&2 "(expect 1 shift/reduce conflict)"; \
            $(yacc) -d ncgen.y; \
            cat y.tab.c >ncgentab.c && rm y.tab.c; \
            cat y.tab.h >ncgentab.h && rm y.tab.h;


# "cat >" is used in the following rule to support linktree(1)-style
# development and testing on a Solaris system.  
#
ncgenyy.c:      ncgen.l
            $(lex) ncgen.l; \
            cat lex.yy.c >ncgenyy.c && rm lex.yy.c;

vmstab.h \
vmstab.c:       ncgen.y
        @echo 1>&2 "$@ is out-of-date with respect to $?"
        @echo 1>&2 "It must be recreated via POSIX yacc(1) on a VMS system"
        false
vms_yy.c:       ncgenyy.c
        @echo 1>&2 "$@ is out-of-date with respect to $?"
        @echo 1>&2 "It must be recreated via POSIX lex(1) on a VMS system"
        false

#
# test "-b" option of ncgen
#
b-test:         $(PROGRAM) c1.cdl
        @./$(PROGRAM) -b c1.cdl && \
        $(NCDUMP) c1.nc > c2.cdl
        @if diff c1.cdl c2.cdl; then \
            echo "*** $(PROGRAM) -b test successful ***"; \
        else \
            echo "*** $(PROGRAM) -b test failed ***"; \
            exit 1; \
        fi

#
# test "-c" option of ncgen
#
c-test: $(PROGRAM) c1.cdl
        ./$(PROGRAM) -c -o ctest0.nc c0.cdl > ctest.c && \
        $(CC) -o ctest $(CFLAGS) $(LDFLAGS) $(CPPFLAGS) ctest.c $(ld_netcdf) 
$(LIBS) && \
        ./ctest && \
        $(NCDUMP) -n c1 ctest0.nc > ctest1.cdl
        @if diff c1.cdl ctest1.cdl; then \
            echo "*** $(PROGRAM) -c test successful ***"; \
        else \
            echo "*** $(PROGRAM) -c test failed ***"; \
            exit 1; \
        fi

c1.cdl: $(PROGRAM) c0.cdl
        ./$(PROGRAM) -b -o c0.nc c0.cdl
        $(NCDUMP) -n c1 c0.nc > $@

#
# test "-f" option of ncgen
#
f-test: $(PROGRAM) c0.cdl c1.cdl
        @if [ -n "$(FC)" ]; then \
            $(MAKE) $(MFLAGS) ftest1.cdl && \
            if diff c1.cdl ftest1.cdl; then \
                echo "*** $(PROGRAM) -f test successful ***"; \
            else \
                echo "*** $(PROGRAM) -f test failed ***"; \
                exit 1; \
            fi; \
        else \
            echo 1>&2 "\`$@' not made because no FORTRAN compiler"; \
        fi

ftest1.cdl: $(PROGRAM) c0.cdl netcdf.inc
        ./$(PROGRAM) -f -o ftest0.nc c0.cdl > ftest.f
        $(FC) -o ftest $(FFLAGS) $(LDFLAGS) ftest.f $(ld_netcdf) $(LIBS)
        ./ftest
        $(NCDUMP) -n c1 ftest0.nc > ftest1.cdl

netcdf.inc:
        @if [ -n "$(FC)" ]; then \
            cp ../fortran/$@ .; \
        else \
            echo 1>&2 "\`$@' not made because no FORTRAN compiler"; \
        fi

$(PROGRAM)_src : $(program_srcs)
        #setopt primary_language C
        #load -C $(CPPFLAGS) $(program_srcs)
        #load -C $(LIBS)
        #load -C /usr/lang/SC2.0.1/libansi.a
        #setopt program_name gribtonc

$(PROGRAM)_obj : $(program_srcs)
        #setopt primary_language C
        #load -C $(CPPFLAGS) $(OBJS)
        #load -C $(LIBS)
        #setopt program_name gribtonc

# Override the default definition for ncdump(1) in the master makefile.
#
NCDUMP          = ../ncdump/ncdump

include ../rules.make

include depend


------- End of Forwarded Message