Running REXX using Cygwin in windows

Submitted by Dickens A S on Sun, 08/23/2020 - 06:24
Run REXX in windows

This article explains, how to compile and install REXX in MSYS2 with GCC compiler installation

Step 1: Install Cygwin 

Additionally install regina-rexx which shipped with cygwin

Cygwin rexx

Step 2: Check GCC version

$ gcc --version
gcc (GCC) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Step 3: Download Regina

Download 3.9.3 Version from URL https://excellmedia.dl.sourceforge.net/project/regina-rexx/regina-rexx/3.9.3/regina-rexx-3.9.3.tar.gz

Step 4: Unzip and configure Regina

$ ./configure --prefix=/usr
configure: creating ./config.status
config.status: creating Makefile
config.status: creating regina-config
config.status: creating rxstack.init.d
config.status: creating libregina.pc
config.status: creating config.h

Regina has now been configured with the following options:

         Dynamic Loading Support: supported. Extra components: cygregina.dll regina.exe cygregutil.dll cygrxtest1.dll cygrxtest2.dll
                   Build options: 64BIT GCI
   binaries will be installed in: ${exec_prefix}/bin
  libraries will be installed in: /usr/lib
     addons will be installed in: /usr/lib/regina-rexx/addons
                        {prefix}: /usr
                   {exec_prefix}: ${prefix}
                      RPM topdir:

To build the Regina binaries, and dynamically loadable libraries, type 'make'
To install Regina in the above directories, type 'make install'

Please note it detected the existing regina DLL files within cygwin

Step 5: Make

$ make
./rexx.exe ./checkmts.rexx .
de.mts is clean
es.mts is clean
no.mts is clean
pl.mts is clean
pt.mts is clean
sv.mts is clean
tr.mts is clean

Step 6: Install

$ make install
chmod 755 /usr/share/regina-rexx/examples/regutil.rexx
./install-sh -s -m 755 -c ./cygregina.dll /usr/bin/cygregina.dll
./install-sh -s -m 755 -c ./cygregutil.dll /usr/lib/regina-rexx/addons/regutil.dll
./install-sh -s -m 755 -c ./cygrxtest1.dll /usr/lib/regina-rexx/addons/rxtest1.dll
./install-sh -s -m 755 -c ./cygrxtest2.dll /usr/lib/regina-rexx/addons/rxtest2.dll
dlltool --def ./regina_w32_dll.def --dllname cygregina.dll --output-lib /usr/lib/libregina.a

Please note libregina.a is created, this is very important to use regina with other languages like COBOL, C etc..,

Example REXX code "text.rexx"

Parse Arg rowcount
col=0
ll=''
Do j=rowcount*(rowcount-1)/2+1 to rowcount*(rowcount+1)/2
  col=col+1
  ll=ll " *"
  len.col=length(j)
  End
Do i=1 To rowcount-1
  ol=''
  col=0
  Do j=i*(i-1)/2+1 to i*(i+1)/2
    col=col+1
    ol=ol right("*",len.col)
    end
  Say ol
  end
Say ll

Run the code

You will the pyramid shape output as shown below

$ rexx test.rexx 10
  *
  *  *
  *  *  *
  *  *  *  *
  *  *  *  *  *
  *  *  *  *  *  *
  *  *  *  *  *  *  *
  *  *  *  *  *  *  *  *
  *  *  *  *  *  *  *  *  *
  *  *  *  *  *  *  *  *  *  *

 

End of Article

 

Add new comment