Software & Apps

kej715/ack: The Amsterdam Compiler Kit

This fork of the Amsterdam Compiler Kit supports the Cray X-MP supercomputer and the COS operating system platform. All other engines and platforms are blocked on this fork by commenting out its references in the LUA build scripts. Currently, this fork builds and runs successfully on MacOS and Linux.

ACK requires the following tools to be installed on MacOS and Linux before it will be successful:

For example, on Debian Linux (and derivatives), tools can be installed using aptsuch as:

sudo apt install bison flex gcc lua5.3 make

On MacOS, if you have installed Xcodeyou will have bison and flex already. A package manager like Homebrew can be used to install lua. You also need GNU gcc and
gmake. ACK will not build successfully with version gcc provided by Xcode and LLVM. use Homebrew, lua, gccand gmake let it install like:

brew install gcc lua make

Another requirement for all platforms is that the tools from the following GitHub repository are installed on your build platform. This repository provides a cross-assembler, cross-linker, and cross-library manager for the Cray X-MP. This fork of ACK uses it to create executables for the Cray X-MP and COS operating systems.

https://github.com/kej715/COS-Tools

After all the necessary tools are installed, ACK for Cray X-MP and COS can be built using the script provided in the top-level repo directory, such as:

To install ACK after building:

sudo ./cray-build.sh install

After successfully building and installing ACK, the following cross-compilers will be available, and you can use them to create executables for Cray X-MP and COS:

  • BASIC the ack The command identifies source files with the extension .bass as BASIC programs.
  • c the ack The command identifies source files with the extension .c as C programs.
  • Pascal the ack The command identifies source files with the extension .p or the extension .It such as Pascal programs.

For example, the following command will compile a c program named hello. c and create a file named hello.abs. hello.abs is a complete binary that will be executed on a Cray X-MP after it has been uploaded there (see Runs on Cray X-MPbelow).

Similarly, the following command will compile a Pascal program named hello and create a fully named binary hello.abs to be executed on a Cray X-MP.

Andras Tantos’ Cray supercomputer simulator,
cray-simsupports Cray X-MP on COS 1.17 operating system. He published a delightful account of the project in
The Cray Filesand this account includes documentation about installing and running COS 1.17 in the simulator.

Unfortunately, the copy of COS 1.17 obtained by Andras does not include any programming language interpreters, and no other working copies of COS are known to exist today. This fork of ACK helps solve the lack of tools to program a recovered copy of COS by providing cross-compilers that can create COS executables. This fork enables hobbyists to create programs for the iconic Cray X-MP supercomputer and run them in the simulator.

A significant challenge, however, is how to transfer cross-compiled executables to a simulated Cray X-MP. One solution is to install DtCyber and use its ability to run Cray Station software. DtCyber ​​is a simulator for
Control Data Corporation’s (CDC)
Cyber series of supercomputers. Installation of
NOS 2.8.7
operating system of DtCyber able to use Cray’s Cray Station software to exchange files and batch jobs between CDC and Cray supercomputers.

In addition to Cray StationThe NOS 2.8.7 operating system has a mature set of other data communication software including TCP/IP applications (eg, FTP),
Kermitand XModem. For example, it is possible to use an FTP client to upload a cross-compiled Cray binary to a CDC machine running NOS 2.8.7 and then use Cray Station to transfer the file to a Cray X-MP running COS. Likewise, Kermit or XModem can be used to upload files to a CDC machine running NOS 2.8.7.

Given this, the following log of a user session illustrates how a user can run a C program, use ACK to cross-compile it, upload the cross-compiled executable to NOS 2.8.7 using FTP, create a NOS CCL method to transfer it. on and run it on a Cray X-MP, and see the results returned.

First, show the source code, a C program that calculates and displays the first 10 Fibonacci numbers:

kej@Kevins-Air examples % cat fib.c
#include 

#define NUM_FIBS 10

int main(int argc, char *argv()) {
    int i1, i2, i3, n;

    i1 = 0;
    i2 = 1;
    for (n = 1; n <= NUM_FIBS; n++) {
      printf(" %d: %d\n", n, i2);
      i3 = i1 + i2;
      i1 = i2;
      i2 = i3;
    }

    return 0;
}

Cross-compile it:

kej@Kevins-Air examples % ack -o fib fib.c

The cross-compiler creates a relocatable object file named fib.o and an executable named
fib.abs:

-rw-r--r--@ 1 kej  staff  48232 Mar 20 10:01 fib.abs
-rw-r--r--@ 1 kej  staff    268 Mar 20 09:57 fib.c
-rw-r--r--@ 1 kej  staff    600 Mar 20 10:01 fib.o

Use FTP to upload it to the NOS 2.8.7 system (kevins-max.local) as an indirect access permanent file named FIB, in binary mode:

kej@Kevins-Air examples % ftp kevins-max.local
Trying 192.168.1.238:21 ...
Connected to kevins-max.local.
220 SERVICE READY FOR NEW USER.
Name (kevins-max.local:kej): guest
331 USER NAME OKAY, NEED PASSWORD.
Password:
230 USER LOGGED IN, PROCEED.
Remote system type is NOS.
ftp> bin
200 COMMAND OKAY.
ftp> put fib.abs fib/ia
local: fib.abs remote: fib/ia
227 ENTERING PASSIVE MODE (192,168,1,238,30,7)
150 FILE STATUS OKAY; ABOUT TO OPEN DATA CONNECTION.
100% |*****************************************************************************************************************************************| 48232       32.55 MiB/s    00:00 ETA
226 CLOSING DATA CONNECTION.
48232 bytes sent in 00:01 (31.57 KiB/s)
ftp> quit
221 SERVICE CLOSING CONTROL CONNECTION. LOGGED OUT.

Use Telnet to log into the NOS 2.8.7 system:

kej@Kevins-Air examples % telnet kevins-max.local
Trying 192.168.1.238...
Connected to kevins-max.local.
Escape character is '^)'.

Connecting to host - please wait ...
Connected

WELCOME TO THE NOS SOFTWARE SYSTEM.
COPYRIGHT CONTROL DATA SYSTEMS INC. 1994.
24/03/20. 10.11.34. TE04P06
NCCMAX - CYBER 875.                     NOS 2.8.7 871/871.
FAMILY:
USER NAME: guest
PASSWORD:

JSN: ABXC, NAMIAF
/

Create and save a CCL procedure file that contains a procedure named RUN. This method will use the Cray Station interface to submit a batch job to the Cray X-MP supercomputer. When the job starts running on the Cray X-MP, it uses the Cray Station interface to extract a file containing a COS executable from the NOS 2.8.7 system. After getting the file, it will run it. When the job is complete, the Cray Station interface will return the log and any output produced by the executable to the NOS system, and it will appear as a file in the queue waiting for the user.

This process file only needs to be created and saved once and can be used again and again later, either to run the original executable again, or to run another one.

/new,cray
/text
 ENTER TEXT MODE.

.PROC,RUN*I,F=(*F,*N=CRAYBIN).
.IF,FILE(F,AS),LOCAL.
  REWIND,F.
.ELSE,LOCAL.
  GET,F.
.ENDIF,LOCAL.
COPYBF,F,ZZZCBIN.
REPLACE,ZZZCBIN=F.
CSUBMIT,CRAYJOB,TO.
REVERT,NOLIST.
.DATA,CRAYJOB.
JOB,JN=CRAYRUN,T=60.
ACCOUNT,AC=CRAY,APW=XYZZY,UPW=QUASAR.
ECHO,ON=ALL.
OPTION,STAT=ON.
FETCH,DN=F,MF=FE,DF=TR,^
TEXT='USER,GUEST,GUEST.GET,F.CTASK.'.
F.

 EXIT TEXT MODE.
/save,cray

Note that Control-T pressed to exit TEXT mode.

The CATLIST command displays all of the user’s permanent files. This confirms that the cross-compiled executable, FIB, that was uploaded earlier and the procedure file, CRAY, that was recently created are stored as indirect access files as expected.

/catlist
 CATALOG OF  GUEST            FM/CYBER   24/03/20. 10.29.45.



 INDIRECT ACCESS FILES

  CRAY      FIB       FTPPRLG   LOGIN     MAILBOX

 DIRECT ACCESS FILES

  GAMFILE   LIBRARY   RELFILE

         5 INDIRECT ACCESS FILES ON DISK.  TOTAL PRUS =       110.
         3 DIRECT ACCESS FILES ON DISK.    TOTAL PRUS =        72.

Use the BEGIN command to execute a procedure named RUN in a procedure file named CRAY and pass the name of the file containing the cross-compiled executable as a parameter:

Use the STATUS command to monitor progress. First, batch jobs for the Cray X-MP can appear in the NOS system’s INPUT queue.

/status,jsn

 JSN SC CS DS LID STATUS                JSN SC CS DS LID STATUS

 ABXL.B.  .BC.XMP.INPUT QUEUE           ABXC.T.ON.BC.   .EXECUTING

Then, it seems to disappear. While running on the Cray X-MP, it does not appear on the NOS system.

/status,jsn

 JSN SC CS DS LID STATUS                JSN SC CS DS LID STATUS

 ABXC.T.ON.BC.   .EXECUTING

However, the Cray Station interface will submit a batch job to the NOS system to participate in the transfer of the cross-compiled executable from NOS to COS, so you can get a short execution of that job.

/status,jsn

 JSN SC CS DS LID STATUS                JSN SC CS DS LID STATUS

 ABXC.T.ON.BC.   .EXECUTING             ABXM.B.NI.BC.   .EXECUTING

When a batch job is finished on the Cray X-MP side, its log and output are returned to the NOS 2.8.7 WAIT queue.

/status,jsn

 JSN SC CS DS LID STATUS                JSN SC CS DS LID STATUS

 ABXC.T.ON.BC.   .EXECUTING             ABXO.S.  .BC.MAX.WAIT QUEUE

Use the QGET command to get JSN’s output from the WAIT queue, and then display it with the LIST command:

/qget,abxo
 QGET COMPLETE.
/list,f=abxo
 1: 1
 2: 1
 3: 2
 4: 3
 5: 5
 6: 8
 7: 13
 8: 21
 9: 34
 10: 55
1
  09:40:43.4062       0.0007    CSP             CRAY XMP-14 SN 302      LEADING EDGE TECHNOLOGIES       03/20/84
  09:40:43.4091       0.0008    CSP
  09:40:43.4126       0.0010    CSP             CRAY OPERATING SYSTEM           COS 1.17  ASSEMBLY DATE 02/28/89
  09:40:43.4154       0.0011    CSP
  09:40:43.4178       0.0011    CSP
  09:40:43.4442       0.0013    CSP     JOB,JN=CRAYRUN,T=60.
  09:40:43.5433       0.0105    CSP     ACCOUNT,AC=,APW=,UPW=.
  09:40:43.5473       0.0109    CSP
  09:40:43.5500       0.0110    CSP     .......................................................................
  09:40:43.5528       0.0111    CSP
  09:40:43.5963       0.0122    CSP     ECHO,ON=ALL.
  09:40:43.6057       0.0128    CSP     OPTION,STAT=ON.
  09:40:43.6196       0.0158    CSP     FETCH,DN=FIB,MF=FE,DF=TR,^
  09:40:43.6256       0.0181    CSP     TEXT=.
  09:40:47.9952       0.0184    SCP     ABXW 11.05.17.USER,GUEST,.
  09:40:47.9972       0.0184    SCP     ABXW 11.05.17.CHARGE,   *                  ,
  09:40:47.9990       0.0184    SCP     ABXW 11.05.19. TRO - PF AND TAPE TRANSPARENT OUTPUT.
  09:40:48.0009       0.0184    SCP     ABXW 11.05.20.TRO: DATASET FIB    ,      14440B WORDS,     0.465
  09:40:48.3294       0.0184    SCP     SS004 - DATASET RECEIVED FROM FRONT END
  09:40:49.7924       0.0200    CSP     FIB.
  09:40:49.9634       0.0466    CSP     END OF JOB
  09:40:49.9682       0.0469    EXP     SY005 - FIB          6144 WRDS,    2 IOS,      2 REQ,      12 STRS,     .060 SEC
  09:40:49.9725       0.0469    EXP           - 29-1-32A       18 STRS   READ:         3 REQ,      12 STRS,     .099 SEC
  09:40:49.9780       0.0470    CSP
  09:40:49.9804       0.0471    CSP
  09:40:49.9866       0.0474    CSP     CHARGES
  09:40:49.9895       0.0475    CSP     CS032 - DATASET NOT LOCAL:
  09:40:49.9925       0.0476    ABORT   AB025 - USER PROGRAM REQUESTED ABORT
  09:40:49.9947       0.0476    ABORT         - P=00001417B   TASK-ID=0001
  09:40:49.9969       0.0476    ABORT         - BASE=00775000 LIMIT=01153000 CPU-NUMBER=00
  09:40:49.9990       0.0476    ABORT         - JOB STEP ABORTED.

https://opengraph.githubassets.com/6262f5566405152997bc783f7dee3f435572bd92b5aed035fcf1b5b9c6a8e795/kej715/ack

2025-01-26 23:17:00

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button