Discussion:
gawk on Windows
(too old to reply)
Igenlode Wordsmith
2022-07-24 22:47:26 UTC
Permalink
I've been trying to share a gawk script for doing some processing on a
Web page with a friend - it is theoretically cross-platform portable,
but she runs Windows and I don't. (I don't even know which version of
Windows she has; presumably the latest, whichever that is?)

She is having trouble in installing gawk on her computer. It looks as if
she needs to download GnuWin32 (or Cygwin?), but the downloads linked at
https://downloads.sourceforge.net/project/gnuwin32/gawk/3.1.6-1/gawk-3.1.6-1-setup.exe
and
https://downloads.sourceforge.net/project/ezwinports/gdb-12.1-w32-bin.zip
simply fail (and failed for me too when I tested them).

How does one set about running gawk under Windows nowadays? All the
references at http://gnuwin32.sourceforge.net/install.html look
worryingly ancient, and I know next to nothing about Windows software
installation myself, while she is a self-admitted 'tech novice'.
--
Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

* Usenet: Warning, may contain Nuts *
Manuel Collado
2022-07-27 09:05:58 UTC
Permalink
Post by Igenlode Wordsmith
How does one set about running gawk under Windows nowadays? All the
references at http://gnuwin32.sourceforge.net/install.html look
worryingly ancient, and I know next to nothing about Windows software
installation myself, while she is a self-admitted 'tech novice'.
I have my own 32bit Windows port of gawk-5.1.0. Ready to be used by
anybody else. Available at

http://mcollado.z15.es/xgawk/win32/

Just download gawk-5.1.0-win32-bin.zip, unpack it on c:\gnu, and put
c:\gnu\bin in the path. That's all.

The distribution archive contains all the required DLL libraries as well
as full documentation in HTML and PDF formats.

HTH.
--
Manuel Collado - http://mcollado.z15.es
Igenlode Wordsmith
2022-07-27 21:11:11 UTC
Permalink
Post by Manuel Collado
Post by Igenlode Wordsmith
How does one set about running gawk under Windows nowadays? All the
references at http://gnuwin32.sourceforge.net/install.html look
worryingly ancient, and I know next to nothing about Windows software
installation myself, while she is a self-admitted 'tech novice'.
I have my own 32bit Windows port of gawk-5.1.0. Ready to be used by
anybody else. Available at
http://mcollado.z15.es/xgawk/win32/
Just download gawk-5.1.0-win32-bin.zip, unpack it on c:\gnu, and put
c:\gnu\bin in the path. That's all.
The distribution archive contains all the required DLL libraries as well
as full documentation in HTML and PDF formats.
Thanks -- that sounds like exactly what I was originally hoping to
find. I've forwarded her the link, and we'll have another go at gawk
over the weekend, with Busybox as a fallback alternative.

(Inevitably, I've managed to find another bug in the script
meanwhile...)
--
Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

- I don't want to 'fit in' any more... - That makes two of us!
Igenlode Wordsmith
2022-07-31 15:42:05 UTC
Permalink
Oops, sorry -- I meant to send this to the newsgroup, not directly to
Manuel (not least because my email is currently broken...)
Post by Manuel Collado
I have my own 32bit Windows port of gawk-5.1.0. Ready to be used by
anybody else. Available at
http://mcollado.z15.es/xgawk/win32/
Just download gawk-5.1.0-win32-bin.zip, unpack it on c:\gnu, and put
c:\gnu\bin in the path. That's all.
The distribution archive contains all the required DLL libraries as well
as full documentation in HTML and PDF formats.
She tried this, and got the error "The code execution cannot proceed
because libgmp-10.dll was not found" -- and indeed I can't find any such
file within the archive, so presumably it's a dependency that was
unintentionally compiled into the distribution? :-(
--
Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

-Yes, it hurts. The trick is not *minding* that it hurts.
Kenny McCormack
2022-07-31 16:52:19 UTC
Permalink
In article <***@fleegle.mixmin.net>,
Igenlode Wordsmith <Use-Author-Supplied-Address-Header@[127.1]> wrote:
...
Post by Igenlode Wordsmith
She tried this, and got the error "The code execution cannot proceed
because libgmp-10.dll was not found" -- and indeed I can't find any such
file within the archive, so presumably it's a dependency that was
unintentionally compiled into the distribution? :-(
I know nothing of Manuel's "personal" version of gawk, but it sounds, from
the above text, that it is a Cygwin compile. (CMIIAW)

Assuming it is, you should just follow my earlier advice. Get Cygwin (full
install) installed on your machine (it isn't hard) and then use it to
package up your own ZIP file containing GAWK and all of its dependencies.

As I mentioned earlier, I'm guessing that the undertone here is that you
don't have a Windows machine upon which to set this up and test. My
general sense if that is indeed the case, you'll never be able to
accomplish your goal with confidence; you'll never be able to get your
remote user up and running without having been able to set it up and test
it yourself.

It should not be that hard to get some old version of Windows up and
running in a VM (I use VirtualBox for this). It's really the only way to
be able to do with confidence.
--
Modern Christian: Someone who can take time out from using Leviticus
to defend homophobia and Exodus to plaster the Ten Commandments on
every school and courthouse to claim that the Old Testament is merely
"ancient laws" that "only applies to Jews".
Igenlode Wordsmith
2022-08-01 09:48:02 UTC
Permalink
On 31 Jul 2022 Kenny McCormack wrote:

[snip]
Get Cygwin (full install) installed on your machine (it isn't hard) and
then use it to package up your own ZIP file containing GAWK and all of
its dependencies.
My system doesn't have enough oomph to run Windows natively, let alone
via an emulator layer. (And in consequence I wouldn't have the foggiest
idea how to package up a ZIP file containing dependencies -- I fear you
under-estimate the degree of blissful ignorance of Windows in which it
is possible to exist..! I didn't even know that Windows used the
backslash as a directory separator until she sent me a screenshot of her
error message.)
As I mentioned earlier, I'm guessing that the undertone here is that you
don't have a Windows machine upon which to set this up and test. My
general sense if that is indeed the case, you'll never be able to
accomplish your goal with confidence; you'll never be able to get your
remote user up and running without having been able to set it up and test
it yourself.
Tell me about it!

This whole process is like trying to debug a program by dictating the
contents of a set of punched cards by telephone across the continent,
then waiting a week for the next allocated session of computer time
before you have any feedback on what went wrong this time... We shan't
be able to have another go until next weekend, and I don't have any sort
of real-time contact with her; all I can do is send detailed
instructions and try to make them as fool-proof as possible.

I'm having to look all the syntax up from first principles, while
fielding questions like 'what is a path' and 'do I open a script file
with gnu' from someone who has *zero* experience of anything
command-line-related and needs to be able to click on things to make
them work.
--
Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

The Yellow God forever gazes down
Janis Papanagnou
2022-08-01 13:17:19 UTC
Permalink
[...] I fear you
under-estimate the degree of blissful ignorance of Windows in which it
is possible to exist..!
:-)
This whole process is like trying to debug a program by dictating the
contents of a set of punched cards by telephone across the continent,
then waiting a week for the next allocated session of computer time
before you have any feedback on what went wrong this time... [...]
Not far from how we worked back in the 1980's. ;-)

You know punch-cards; that lets me make a guess about your engagement
time range with computers. - How did you manage to completely ignore
or avoid WinDOS since decades? - I'm really curious, since management
sooner or later very often seems to force their folks to use it. It's
hard to avoid even if you're on the holy war path of an Unix apologist
or evangelist.

Since it's about Windows I haven't followed this thread too closely.
From what I've seen you probably want a solution with an GNU Awk that
is either statically linked or has just the executable with the two
(or was it three) necessary libraries from the Cygwin package. I went
the second path (quite some time ago), and Bruce seems to have shown
a way for the former path. WRT to the question about the size of the
executable; that's hard to say without knowing details. A huge file
may indicate a statically linked executable (with a library layer to
access the Unix or POSIX functions), or a file that is not stripped
from the list of names used for debugging. A small executable might
dynamically access the required libraries. Maybe this Unix subsystem
thing that you may get with newer Windows versions already contains
these libraries? (Just speculating.)

Janis
Igenlode Wordsmith
2022-08-03 22:47:36 UTC
Permalink
Post by Janis Papanagnou
[...] I fear you
under-estimate the degree of blissful ignorance of Windows in which it
is possible to exist..!
:-)
This whole process is like trying to debug a program by dictating the
contents of a set of punched cards by telephone across the continent,
then waiting a week for the next allocated session of computer time
before you have any feedback on what went wrong this time... [...]
Not far from how we worked back in the 1980's. ;-)
You know punch-cards; that lets me make a guess about your engagement
time range with computers. -
Not quite! It was more the complete lack of interactivity or any
real-time feedback that brought that particular comparison to mind.
Post by Janis Papanagnou
How did you manage to completely ignore or avoid WinDOS since decades?
- I'm really curious, since management sooner or later very often
seems to force their folks to use it. It's hard to avoid even if you're
on the holy war path of an Unix apologist or evangelist.
Years of unemployment helps :-p

But I've used the Windows deskop - by analogy - when accessing library
catalogues and so on. Ironically I even managed to get a bit of a name
as a 'computer guru' who could help the people whose job it was to use
Microsoft software simply because I *hadn't* been taught how to use it
rote-fashion, and could therefore poke around looking for the various
options that I assumed ought to be possible from my knowledge of how to
use multiple different applications rather than a single monolithic True
Way.

I've never been near any Windows machine where common or garden users
were allowed to 'install' anything on it, though, let alone touch the
command line (wherever that is located). They have always been strictly
Phone Technical Support and No User-Serviceable Parts.
--
Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

** I 'grew up' once. Didn't like it, so I gave it up. **
Manuel Collado
2022-08-03 07:01:14 UTC
Permalink
Post by Kenny McCormack
...
Post by Igenlode Wordsmith
She tried this, and got the error "The code execution cannot proceed
because libgmp-10.dll was not found" -- and indeed I can't find any such
file within the archive, so presumably it's a dependency that was
unintentionally compiled into the distribution? :-(
I know nothing of Manuel's "personal" version of gawk, but it sounds, from
the above text, that it is a Cygwin compile. (CMIIAW)
NO. It has been built with MinGW.

Will try to fix the issue.
--
Manuel Collado - http://mcollado.z15.es
Kenny McCormack
2022-08-03 12:18:39 UTC
Permalink
Post by Manuel Collado
Post by Kenny McCormack
...
Post by Igenlode Wordsmith
She tried this, and got the error "The code execution cannot proceed
because libgmp-10.dll was not found" -- and indeed I can't find any such
file within the archive, so presumably it's a dependency that was
unintentionally compiled into the distribution? :-(
I know nothing of Manuel's "personal" version of gawk, but it sounds, from
the above text, that it is a Cygwin compile. (CMIIAW)
NO. It has been built with MinGW.
To me, MinGW and Cygwin are pretty similar/more-or-less-the-same-thing.
Different flavors of ice cream...

(Yes, I am perfectly aware that they aren't the same thing, but I hope you
are savvy enough to get what I mean)

And anyway, I'm a big fan of Cygwin, so this is not meant as any sort of
criticism.
Post by Manuel Collado
Will try to fix the issue.
I am sure OP will be happy to hear this.
--
If you don't have faith, it's because you are reading the Bible with an
honest, truthful, real-answer seeking heart.

- Rick C Hodgin -
Bruce Horrocks
2022-07-31 20:32:20 UTC
Permalink
Post by Igenlode Wordsmith
Oops, sorry -- I meant to send this to the newsgroup, not directly to
Manuel (not least because my email is currently broken...)
Post by Manuel Collado
I have my own 32bit Windows port of gawk-5.1.0. Ready to be used by
anybody else. Available at
http://mcollado.z15.es/xgawk/win32/
Just download gawk-5.1.0-win32-bin.zip, unpack it on c:\gnu, and put
c:\gnu\bin in the path. That's all.
The distribution archive contains all the required DLL libraries as well
as full documentation in HTML and PDF formats.
She tried this, and got the error "The code execution cannot proceed
because libgmp-10.dll was not found" -- and indeed I can't find any such
file within the archive, so presumably it's a dependency that was
unintentionally compiled into the distribution? :-(
I went to [1] and downloaded [2]. Unzipped [2], started a Windows
command shell, CD'd into the directory containing gawk.exe and ran the
command

.\gawk.exe --version

which worked first time. This was Windows 10.

[1] http://vkiefel.de/compiled-SW.html

[2] http://vkiefel.de/gawk-5.1.0-win32.zip
--
Bruce Horrocks
Surrey, England
Igenlode Wordsmith
2022-08-01 09:11:29 UTC
Permalink
Post by Bruce Horrocks
I went to [1] and downloaded [2]. Unzipped [2], started a Windows
command shell, CD'd into the directory containing gawk.exe and ran the
command
.\gawk.exe --version
which worked first time. This was Windows 10.
[1] http://vkiefel.de/compiled-SW.html
[2] http://vkiefel.de/gawk-5.1.0-win32.zip
Thanks for the suggestion, which I have (again!) forwarded onwards.

I'm a bit surprised by the small size of the 'gawk.exe' file here, since
the one in the other archive was 6 Mb -- would that be because it
*doesn't* have the Cygwin stuff compiled in with it, or is it an
indication that it expects to link to external libraries?
--
Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

* Ain't never gonna stop the rain by complainin'... *
Bruce Horrocks
2022-08-01 16:27:13 UTC
Permalink
Post by Igenlode Wordsmith
Post by Bruce Horrocks
I went to [1] and downloaded [2]. Unzipped [2], started a Windows
command shell, CD'd into the directory containing gawk.exe and ran the
command
.\gawk.exe --version
which worked first time. This was Windows 10.
[1] http://vkiefel.de/compiled-SW.html
[2] http://vkiefel.de/gawk-5.1.0-win32.zip
Thanks for the suggestion, which I have (again!) forwarded onwards.
I'm a bit surprised by the small size of the 'gawk.exe' file here, since
the one in the other archive was 6 Mb -- would that be because it
*doesn't* have the Cygwin stuff compiled in with it, or is it an
indication that it expects to link to external libraries?
Despite its small size it is self-contained so nothing further to install.

I've no idea why the Cygwin one is so big, tbh.
--
Bruce Horrocks
Surrey, England
Kenny McCormack
2022-08-01 19:41:27 UTC
Permalink
In article <b336bd42-7e88-c560-f176-***@scorecrow.com>,
Bruce Horrocks <***@scorecrow.com> wrote:
...
Post by Bruce Horrocks
Despite its small size it is self-contained so nothing further to install.
Do you know what that version is? What compiler/development system, etc?
That would explain why it is smaller than expected...

(If it doesn't require any DLLs, is it "statically linked" ?)
Post by Bruce Horrocks
I've no idea why the Cygwin one is so big, tbh.
I just checked my Cygwin gawk.exe file; it is 640,000 bytes long (yeah,
exactly 640K - heh heh). I didn't compile this; I installed it from the
repo(s), using the usual Cygwin installer.

So, I'd imagine that that Cygwin gawk (the one OP references, that is 6M
size) was statically linked - that is, it includes all the DLLs that would
normally be kept as separate files. The main cygwin dll (cygwin1.dll) is
3.5M, the MPFR one is 2.5M, the rest are trivially small, so the total size
should come to about 7M. Of course, it you compile without MPFR support
(which OP probably doesn't need), it could be substantially smaller.

Maybe, just to help OP and to put this thread to rest, someone should take
the time and effort to compile up a statically linked (and thus standalone)
version of gawk.exe and make it available to OP on some web site.
--
The randomly chosen signature file that would have appeared here is more than 4
lines long. As such, it violates one or more Usenet RFCs. In order to remain
in compliance with said RFCs, the actual sig can be found at the following URL:
http://user.xmission.com/~gazelle/Sigs/CLCtopics
Bruce Horrocks
2022-08-01 22:39:53 UTC
Permalink
Post by Kenny McCormack
...
Post by Bruce Horrocks
Despite its small size it is self-contained so nothing further to install.
Do you know what that version is? What compiler/development system, etc?
The original website I linked to just states MinGW, so presumably the
latest prior to gawk v5.1.0 being released.
<http://vkiefel.de/compiled-SW.html>
Post by Kenny McCormack
That would explain why it is smaller than expected...
Personally I don't think it's smaller than expected at all. It's the
Cygwin one that I find to be much larger than I would expect. :-)
Post by Kenny McCormack
(If it doesn't require any DLLs, is it "statically linked" ?)
I suspect it is dynamically linked against the POSIX compatibility
libraries provided by Windows - but I would have to pull it apart to
check that and I no longer have those kinds of tools to hand.
Post by Kenny McCormack
Post by Bruce Horrocks
I've no idea why the Cygwin one is so big, tbh.
I just checked my Cygwin gawk.exe file; it is 640,000 bytes long (yeah,
exactly 640K - heh heh). I didn't compile this; I installed it from the
repo(s), using the usual Cygwin installer.
So, I'd imagine that that Cygwin gawk (the one OP references, that is 6M
size) was statically linked - that is, it includes all the DLLs that would
normally be kept as separate files. The main cygwin dll (cygwin1.dll) is
3.5M, the MPFR one is 2.5M, the rest are trivially small, so the total size
should come to about 7M. Of course, it you compile without MPFR support
(which OP probably doesn't need), it could be substantially smaller. >
Maybe, just to help OP and to put this thread to rest, someone should take
the time and effort to compile up a statically linked (and thus standalone)
version of gawk.exe and make it available to OP on some web site.
--
Bruce Horrocks
Surrey, England
Igenlode Wordsmith
2022-08-02 11:12:25 UTC
Permalink
On 1 Aug 2022 Kenny McCormack wrote:

[snip]
Post by Kenny McCormack
I just checked my Cygwin gawk.exe file; it is 640,000 bytes long (yeah,
exactly 640K - heh heh). I didn't compile this; I installed it from the
repo(s), using the usual Cygwin installer.
So, I'd imagine that that Cygwin gawk (the one OP references, that is 6M
size) was statically linked - that is, it includes all the DLLs that would
normally be kept as separate files. The main cygwin dll (cygwin1.dll) is
3.5M, the MPFR one is 2.5M, the rest are trivially small, so the total size
should come to about 7M. Of course, it you compile without MPFR support
(which OP probably doesn't need), it could be substantially smaller.
No, I'm not using floating-point arithmetic -- nothing more complicated
than "title[workname]+=1" :-)
Post by Kenny McCormack
Maybe, just to help OP and to put this thread to rest, someone should take
the time and effort to compile up a statically linked (and thus standalone)
version of gawk.exe and make it available to OP on some web site.
I'm hoping that's what Bruce has located. (None of these versions
showed up during my initial attempts at searching for "Windows 32-bit
gawk" or "gawk for Windows" - everything I could find on the Web points
to the GnuWin32 and ezwinports pages.)

My main concern is that it may turn out to rely on the existence of
resources that are taken for granted on a programmer's machine but are
not present by default on a 'clueless' user's laptop; I don't even know
what version of Windows she is using. I did ask, but I think the
question rather got lost amid the other issues...

However, we shall find out, or may find out, *next* weekend. I have to
say that if I'd had any idea getting a 'portable' 7Kb script to run
under Windows would be this difficult I should never have suggested it -
it just occurred to me that this was one piece of software I'd written
that she *might* be able to use, since she was complaining about the
same problem that I'd written it to solve :-(
--
Igenlode Visit the Ivory Tower http://ivory.ueuo.com/Tower/

its: belonging to it - it's: "it is" (contraction )
Loading...