The Mocka compiler
The Mocka compiler is a product of Karlsruhe university's Mathematics department. It is available for just
about any UNIX system. Also for Linux and FreeBSD. All Mocka compilers are somewhat commercial, but the
versions for Linux and FreeBSD are GPL style FREE.
I used to run version 9903, but it had a drawback: it used the same name as the Midnight Commander: mc. So a
lot of work-arounds were required to get both executables working reliably on the same system.
As I told: I used to run 9903. In June 2006 I switched to 9905m. And in August I switched once more: to 0608m. This is a full mocka compiler, partly rewritten by Dr Maurer of the FU Berlin. It differs from standard Mocka as follows:.
Setting up the Mocka 0608m compiler.
This is a lot simpler than getting 9903 or 0605 to run. Dr Maurer did a good job here. Just download some packages from the FU Berlin servers, run some scripts and that's it. Below I will explain what I did to get my system installed. I am running Mocka 0608m on my Beryllium system (Intel P4 operating with Slackware 12.2) and many other computers.
Step 1: get the compiler
All files can be downloaded from the webservers of the FU Berlin. The URL of the Mocka section on FU Berlin
is:
http://lwb.mi.fu-berlin.de/inf/mocka/installation.shtml
(Mocka is a tool to get
Murus
into existence). This page is in German, so if you don't speak the language keep an eye on my webpages. I am
planning to translate as much of it's content as possible.
You can read some more about the Mocka compiler on the webpage
http://lwb.mi.fu-berlin.de/inf/mocka/arbeit.shtml
and again: this page is in German. The essence of this page is: Mocka is a good and free compiler for Linux
and BSD users. In the bottom of this page (just below 'Herunterladen', which is german for 'Download'), you
find links to download the three important files:
Step 2: install mocka 0608m
cd /usr/local
tar xfz mocka.tgz
export MOCKA=/usr/local/mockato the end of your '/etc/profile' script.
cd /usr/local/mocka/man1 gzip mc.1 cp mc.1.gz /usr/local/mocka/man1/mocka.1.gz
cd /usr/local/mocka/lib ./machen ./makemockabin
Mocka 0608m is started with the command $MOCKA/sys/m2. The standard Mocka libraries are now in the directory $MOCKA/lib. You can shorten this command-name with a set of symlinks from /usr/local/bin:
ln -s /usr/local/mocka/sys/m2 /usr/local/bin/mocka ln -s /usr/local/mocka/sys/m2 /usr/local/bin/m2
Notes:
Step 3: change the editor
Mocka invokes the editor not by a direct call. Instead, it issues the command '$MOCKA/sys/edit %1' which enables the user to choose the editor of his choice. I prefer the jed editor which is fast and friendly. The contents of my $MOCKA/sys/edit file are as follows:
jed $1But that's not all. The editor is also invoked from within the error correction routine, controlled by '$MOCKA/sys/list' so we need to change this as well:
#!/bin/sh # # (c) GMD Karlsruhe LIST=/tmp/$1.$$ SRC=$1 ERROR=$2 trap "rm -f $LIST; exit 5" 3 $MOCKA/sys/Lister $SRC $ERROR $LIST jed $LIST $MOCKA/sys/Unlister $SRC $LIST rm -f $LIST $ERROR
Step 4: make a link for m2
After the mockainit script has finished, the actual mocka IDE is called 'm2' and it is located in '$MOCKA/sys/m2'. This is not a very convenient way to start a compiler session. So I added a symlink called 'mocka' in '/usr/local/bin' as follows:
ln -s /usr/local/mocka/sys/m2 /usr/local/bin/mockaas can be seen here:
jan@beryllium:~/internet/fruttenboel/mocka$ ls -lh /usr/local/bin/ lrwxrwxrwx 1 root staff 23 2006-08-20 22:18 m2 -> /usr/local/mocka/sys/m2 lrwxrwxrwx 1 root staff 23 2006-08-20 22:02 mocka -> /usr/local/mocka/sys/m2
Step 5: make a purge file
In order to remove jed backup files and errorfiles generated by Mocka, it can be convenient to have a script that reoves those files only. Together with my friend Jan Wagemakers I developed the following file, called 'purge':
#! /bin/sh if (! rm *~ 2> /dev/null 1> /dev/null) then echo No 'jed' backup files found. fiIt is a lot safer than running 'rm *~' each and every time. Forget the tilde one time, and you loose a lot of work.
Page created 3 June 2006,
Page equipped with FroogleBuster technology