Monthly Archives: December 2013

A web-interface to GT.M, or Less is More

It’s taken me a while to work out a way of communicating with GTM rather than using NodeM, but I recently stumbled across a web page that offered an alternative, http://71.174.62.16/demo/TestCGI.htm.

The web page was written by a guy called Ed de Moel.

The first thing to do is to write and compile some C code.

I’ve attached some C source code that will need tweaking before you have a go at compiling it.

You’ll probably need to change the gtmdir, appdir, gtmdb variables to mirror your GTM configuration.

Copy the C source code into a directory, and then run the following command in order to compile the code.

gcc hello.c -o gtm3 (this makes an application called gtm3).

The next thing to do is to install apache2, at a terminal prompt do this,

sudo apt-get install apache2

The gtm3 application will then need copying to /usr/local/apache2/cgi-bin/.

I used the following Linux commands to do the copy,

cd /usr/lib/cgi-bin (this is the default location for cgi scripts).

sudo cp /home/vista/tmp/gtm3 gtm3

If you look at the C code it executes a MUMPS routine called TestCGI2.

One important bit of configuration was to make sure that mumps.dat permissions were set to read/write, otherwise the C code will fall over whilst trying to run the MUMPS code.

To demonstrate how cool this is, I wrote some MUMPS code to display 5,000 HTML cells – it renders fast!

http://192.168.2.15/cgi-bin/gtm3?mumps=^FRED2

TestCGI2, hello, FRED2

Thanks Ed!