1753444 Members
4704 Online
108794 Solutions
New Discussion юеВ

Re: GAWK for I64

 
SOLVED
Go to solution
Lester Dreckow
Advisor

GAWK for I64

Does anyone know if VMS binaries for Itanium have been built for GAWK?

From the Freeware V8.0 download, I have attempted the build (see attached).

Not being a C programmer, I thought I'd ask the question before proceeding further.

$ tcpip show version

HP TCP/IP Services for OpenVMS Industry Standard 64 Version V5.6
on an HP rx2620 (1.40GHz/6.0MB) running OpenVMS V8.3

$ cc/version
HP C V7.2-001 on OpenVMS IA64 V8.3
$

Thanks, Lester.



8 REPLIES 8
labadie_1
Honored Contributor
Solution

Re: GAWK for I64

I have just checked on an Itanium, it is no longer in
SYS$COMMON:[SYSHLP.EXAMPLES.TCPIP.SNMP], where it was on Alpha.

May be it is included in GNV ? (Gnu is not Vms)
Richard Whalen
Honored Contributor

Re: GAWK for I64

Those errors are due to the C definition (.H) files on Itanium having the definition for getenv already in them. I would put the following around the function definitions:

#ifndef __ia64

#endif

so that they are ignored on the Itanium but would still be used on Alpha and VAX.
Hoff
Honored Contributor

Re: GAWK for I64

The gawk tool was pulled out of TCP/IP a while back.

The easiest way to get most of the classic Unix tools loaded onto OpenVMS is via the GNV package.

In this case, somebody referenced the reserved symbol getenv in their own code -- this is an exceedingly common mistake in porting code -- and they got caught when the reserved symbol was subsequently implemented.

Richard's approach -- using conditionalization to block visibility of the getopt symbols (and probably the whole of the getopt.c module) -- will very likely work, though I'd probably first try dropping the getopt.c module from the compilation sequence entirely (and also any references to getopt.obj from any subsequent LINK command), and try linking gawk with the system-provided version of getopt.

gawk-3.1.5 looks to be current.
ftp://ftp.gnu.org/pub/gnu/gawk/


Stephen Hoffman
HoffmanLabs
Steven Schweda
Honored Contributor

Re: GAWK for I64

1. Don't think of it as IA64 v. VAX or IA64
v. Alpha. Think of it as new v. old. The
DEC/Compaq/HP C RTL has included getenv()
for a while now, at least on Alpha and IA64.

2. I'd also vote for trying the build
omitting getenv.c. If that turns out to
cause problems because the getenv() in the
C RTL is not so good as the one supplied with
your kit, then change:
$ CC = "cc/DECC/Prefix=All"
to:
$ CC = "cc/DECC/Prefix=(All, except = getenv)"
and see what happens then. Alternatively,
open up getenv.c and change the declaration
of the function to match the one in your
header file. (The one in the complaint looks
like the one in _my_ header file, so there
may be "an earlier declaration" somewhere
else (some local header file?) which must be
revised to match the one in the complaint.)

Or get a better GAWK kit for VMS.
Lester Dreckow
Advisor

Re: GAWK for I64

Thanks for the prompt replies. I did not think of GNV. Gawk.exe was found in the GNV kit found at ...

http://gnv.sourceforge.net/readme.html
https://sourceforge.net/project/showfiles.php?group_id=2506

Thanks also for the points regarding C.

Lester
Lester Dreckow
Advisor

Re: GAWK for I64

Limitations of Gawk from the GNV included being unable to handle VMS file specs that included device, directory, version number or wildcarded filenames. (And it also does not provide the DCL-style qualifiers.)

I noticed that some work has recently been done on GNU awk, now at version 3.1.7.
ftp://ftp.gnu.org/pub/gnu/gawk/

The VMSBUILD.COM now compiles and links cleanly on ├в ┬ж

$ cc /version
HP C V7.3-018 on OpenVMS IA64 V8.3-1H1
$
$ gawk --version
GNU Awk 3.1.7
Copyright (C) 1989, 1991-2009 Free Software Foundation.
[├в ┬ж]

labadie_1
Honored Contributor

Re: GAWK for I64

Lester

I have submitted some procedures on dcl.openvms.org using AWK on OpenVMS Alpha, that fail miserably using AWK from GNV on Itanium.

Do some people have been able to use it ?

After defining an AWK symbol, apart from the very simple
$ pipe sh sys | awk "print $1" sys$pipe
I have been unable to do some more complex things.

Yes the AWK version on Itanium is much more recent than the AWK on Alpha, but if it is not usable...
H.Becker
Honored Contributor

Re: GAWK for I64

>>>
Limitations of Gawk from the GNV included being unable to handle VMS file specs that included device, directory, version number or wildcarded filenames. (And it also does not provide the DCL-style qualifiers.)
<<<

I would not expect GNV utilities to handle VMS file specs or DCL-style qualifiers.

>>>
After defining an AWK symbol, apart from the very simple
$ pipe sh sys | awk "print $1" sys$pipe
I have been unable to do some more complex things.
<<<

$ awk --version
GNU Awk 3.1.1
Copyright (C) 1989, 1991-2002 Free Software Foundation.
...
$ pipe sh sys | awk "print $1" sys$pipe
/$8$DKA100/000000/bin/AWK: cmd. line:1: print $1
/$8$DKA100/000000/bin/AWK: cmd. line:1: ^ parse error
$
$ pipe sh sys | awk "{print $1}" sys$pipe
/$8$DKA100/000000/bin/AWK: cmd. line:2: fatal: cannot open file `sys$pipe' for r
eading (no such file or directory)
$
$ pipe sh sys | awk "{print $1}"
OpenVMS
Pid
20600401
20600405
...

and

$ ty a.awk
BEGIN {}
{ if (/(open)/) fn= $1 }
{ if (/(Hit rate)/) if ($(NF-1)<=max) printf("%-60s,%5s,%2d,n\n",fn,"--->",$(NF-
1)) }
$
$ pipe sh mem/cache=(volume=*,topqio=10) | awk -f a.awk -v "max=100" | sort /key
=(pos:68,size=3) sys$pipe sys$output
_$8$DKA0: , --->, 0,n
_$8$DKB200:[JCPAREL]LSE$WORK.TPU$WORK;1 , --->, 0,n
_$8$DKB200:[JCPAREL]COUCOU_C.TPU$JOURNAL;1 , --->, 0,n
_$8$DKA100: , --->, 0,n
_$8$DKA0: , --->,58,n
_$8$DKA100:[VMS$COMMON.SYSLIB]DECC$SHR.EXE;1 , --->,91,n
_$8$DKB200:[JCPAREL.ETC]COMMON_LSE.TPU$SECTION;1 , --->,92,n
_$8$DKA100:[VMS$COMMON.SYSEXE]DCL.EXE;1 , --->,99,n
_$8$DKA100:[VMS$COMMON.SYSEXE]SUBMIT.EXE;1 , --->,99,n
_$8$DKA100:[VMS$COMMON.SYSLIB]LIBOTS.EXE;1 , --->,99,n
_$8$DKA100:[VMS$COMMON.SYSLIB]SMGSHR.EXE;1 , --->,99,n
_$8$DKA100:[VMS$COMMON.SYSLIB]UTIL$SHARE.EXE;1 , --->,99,n
_$8$DKA100:[VMS$COMMON.SYSLIB]LIBRTL.EXE;1 , --->,99,n
_$8$DKA100:[VMS$COMMON.SYSEXE]LOGINOUT.EXE;1 , --->,99,n
_$8$DKA100:[VMS$COMMON.SYSEXE]DELETE.EXE;1 , --->,99,n
$

What fails? Which Alpha/I64 version of awk?