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

19991022: Stand-alone Grib Decoder



>From: "Jennie L. Moody" <address@hidden>
>Organization: UVa
>Keywords: 199910221947.NAA19009 standalone grib decoder

Jennie,

>I was finally getting around to trying to use the stand-alone
>grib decoder that Chad gave you, but I have hit a snag.  I
>don't think its a big one, but I cannot find the solution
>without some help.
>
>The readme says to create a new user (a user that will not be
>running mcidas, so as not to interfere), so I have made
>
>/home/mccode
>
>this user account is on an external hard disk (which has a lot
>of space for decoding/storing eta model fields).  So the home
>mccode is a link to /q5/usr/mccode.

I wouldn't have created a new user, but...

>After setting up this user, I ftp'd the mcgribdec tar file,
>untarred it, made the required directories, set the PATH,
>a few environement variables, etc.  Here is the top of the
>Makefile:
>
>MCCOMP      = mccomp
>
>MCROOT      = /home/mcidas
>MCLIB       = $(MCROOT)/lib
>MCMAIN      = $(MCLIB)/main.o
>MCHOME      = /q5/usr/mccode/mcidas
>HOME_BIN    = $(HOME)/mcidas/bin
>MCHOMEDATA  = $(MCHOME)/data
>MCHOMEHELP  = $(MCHOME)/help
>INCARGS     = -I. -I$(MCROOT)/inc
>LIBARGS     = -L. -L$(HOME)/mcidas/xcd/src -L$(MCLIB)               -lmcidas -
> lm
>
>
>since /home/mcidas/bin is in my path, it should
>find mccomp.
>
>But I get an error when I run the makefile:
>
>windfall: /q5/usr/mccode/mcgribdec $ make
>mccomp -I. -I/home/mcidas/inc -c Mcgribdecoder.c
>gcc -c -O -ansi -pedantic -I. -I/home/mcidas/inc
>-I/usr/dt/include -I/usr/openwin/include Mcgribdecoder.c
>Mcgribdecoder.c: In function `gbtable000':
>Mcgribdecoder.c:1241: warning: comparison is always 0 due to
>limited range of data type
>Mcgribdecoder.c:1242: warning: comparison is always 0 due to
>limited range of data type
>Mcgribdecoder.c: In function `gbtable002':
>Mcgribdecoder.c:1428: warning: comparison is always 0 due to
>limited range of data type
>Mcgribdecoder.c:1429: warning: comparison is always 0 due to
>limited range of data type
>Mcgribdecoder.c: In function `gbtable004':
>Mcgribdecoder.c:1651: warning: comparison is always 0 due to
>limited range of data type
>Mcgribdecoder.c:1652: warning: comparison is always 0 due to
>limited range of data type
>Mcgribdecoder.c: In function `gbtable00a':
Mcgribdecoder.c:1842: warning: comparison is always 0 due to
>limited range of data type
>Mcgribdecoder.c:1843: warning: comparison is always 0 due to
>limited range of data type
>Mcgribdecoder.c: In function `gbtable00b':
>Mcgribdecoder.c:2035: warning: comparison is always 0 due to
>limited range of data type
>Mcgribdecoder.c:2036: warning: comparison is always 0 due to
>limited range of data type
>mccomp -I. -I/home/mcidas/inc -c Mcmkmcgrid.c
>gcc -c -O -ansi -pedantic -I. -I/home/mcidas/inc
>-I/usr/dt/include -I/usr/openwin/include Mcmkmcgrid.c
>mccomp -I. -I/home/mcidas/inc -c Mcupackbit.c
>gcc -c -O -ansi -pedantic -I. -I/home/mcidas/inc
>-I/usr/dt/include -I/usr/openwin/include Mcupackbit.c
>mccomp -I. -I/home/mcidas/inc -c Mcisbitset.c
>gcc -c -O -ansi -pedantic -I. -I/home/mcidas/inc
>-I/usr/dt/include -I/usr/openwin/include Mcisbitset.c
>mccomp -I. -I/home/mcidas/inc -c Mcgtpstrg.c
>gcc -c -O -ansi -pedantic -I. -I/home/mcidas/inc
>-I/usr/dt/include -I/usr/openwin/include Mcgtpstrg.c
>mccomp -I. -I/home/mcidas/inc -c Mcibmfloat.c
>gcc -c -O -ansi -pedantic -I. -I/home/mcidas/inc
>-I/usr/dt/include -I/usr/openwin/include Mcibmfloat.c
>mccomp -I. -I/home/mcidas/inc -c Mcgetmemory.c
>gcc -c -O -ansi -pedantic -I. -I/home/mcidas/inc
>-I/usr/dt/include -I/usr/openwin/include Mcgetmemory.c
>mccomp -c gribdec.pgm -I. -I/home/mcidas/inc
>cd /tmp/Mu6382
>ln -s /q5/usr/mccode/mcgribdec/gribdec.f .
>ln -s /home/mcidas/inc/gridparm.inc .
>ln -s /home/mcidas/inc/m0xcd.inc .
>fc -c -O gribdec.f
>/usr/bin/fc[8]: fc: bad option(s)
>*** Error code 1
>make: Fatal error: Command failed for target `gribdec.o'
>
>This looked to me like it thought fc was a fortrans
>compiler?  But thats not the case:
>
>windfall: /q5/usr/mccode/mcgribdec $ man fc
>Reformatting page.  Wait... done
>User Commands                                          history(1)
>
>...

I think that you should change the reference to 'fc' to 'mcfc' in
the makefile (or wherever).  At one point in SSEC's transition to support
of gcc, they had a script named fc whose job was to run f2c and gcc
to emulate a Fortran compiler.  I pointed out to SSEC that the use of
'fc' as the name was unfortunate due to 'fc' being a command on various
Unix platforms.  Chad Johnson of SSEC had already run into this as well,
so he made the decision to change it from 'fc' to 'mcfc'.

That being said, it strikes me that you build using native compilers.
I would suspect that there is a macro inside the makefile that specifies
whether or not the native C and Fortran compiler should be used, or
whether or not the gcc/f2c combination should be used.  In the McIDAS-X
distribution, this makefile macro is named VENDOR.  Since I have not
looked at the code in the standalone grib decoder (and won't before
leaving for Australia), I can't tell you for certain what to look for.
I can warn you, however, that I would expect problems if you build
the standalone grib decoder using gcc/f2c and link against code built
with native compilers in McIDAS-X.

Sorry I can't be of more explicit help.

>I cannot figure out how I can modify the makefile since the fc
>reference seems to be buried within mccomp (ie., none of the
>offending lines above is actually an editable line
>in the Makefile).

It shouldn't be im mccomp IF the copy of mccomp that is being used is
the one created from the 7.6 installation.

>I thought it might be a path problem
>(maybe it was finding some local fc rather than the one
>it should have, but I made the /home/mcidas/bin directory
>the first binary directory searched (see PATH below) and 
>it still gave me the same error. 

It really should be looking for mcfc.  Here is the relevant section in
mccomp:

# by default use gcc and f2c. specify 'mccomp -vendor' to use vendor supplied
# compilers.
cc=gcc
ccopts=
clopts=
fc=mcfc
fcopts=
flopts=
fc_does_INCLUDE_search=true

You will notice that the internal variable 'fc' is defined to be mcfc.

>windfall: /q5/usr/mccode/mcgribdec $ echo $PATH
>/home/mcidas/bin:/uva/bin:/usr/bin:/opt/SUNWspro/bin:/usr/ccs/bin:/usr/ucb:/usr
>/openwin/bin:/usr/dt/bin:/gnu/bin:

>The first time I ran it the first directory in PATH was the $HOME/bin, ie
>/q5/usr/mccode/bin

>Anyway, I don't get it.

>Any ideas??

Not really.  I could take a quick look later tonight if I had a login,
but I can't spend much time on this as I have got to work on an ADDE
server for Australian radar data :-)

Tom