Installing OBC release 2.9

From Spivey's Corner

Jump to: navigation, search

This page contains the materials and instructions you need to install release 2.9 of the Oxford Oberon-2 Compiler and associated programs on your own computer.

  • Instructions for using the compiler are given in the user manual, which consists mainly of sections extracted from the lab manual for the Imperative Programming course.
  • There is also a page with a general description of the compiler and associated tools, including licencing information and acknowledgements.

Compared with release 2.8, this new release features a simplified and hopefully more robust garbage collector, and fixes a number of minor problems in the JIT.

Contents

Known problems

  • Programs that use SYSTEM.VAL to do unsafe type conversions between LONGREAL and LONGINT can result in bytecode that confuses the JIT's register allocator. Workaround: disable the JIT and use the bytecode interpreter.

Debian, Ubuntu and similar Linux systems

Debian.png
Ubuntu.png

The compiler and associated software is packaged as a Debian archive that is installed under /usr. You need the file obc_2.9.2_i386.deb.

Copy it to your machine, then issue the command

$ sudo dpkg -i obc_2.9.2_i386.deb

That's all there is to it!

(This package was built on an Ubuntu 10.10 system.)

Other Linux systems

Linux.png

The compiler and associated software is packaged as a binary tarball, which can be installed in a place of your choice. You need the file obc-linux-2.9.2.tar.gz. To install it under /usr/local:

$ tar xfz obc-linux-2.9.2.tar.gz
$ cd obc-linux-2.9.2
$ ./configure
$ make
$ sudo make install

The above package was linked on an Ubuntu 10.10 system. If it doesn't work because you have a different version of glibc, let me know, and I'll see if we can do something about it.

The GUI debugger depends on the GTK libraries (including gtksourceview-2.0) to display its interface, and you will need to have them installed in order to use it. If you have a recent version of the Gnome editor gedit installed, then you probably have the necessary libraries already. On x86_64 systems, you will need to build from source in order for the GUI to use the 64-bit version of the GTK libraries.

Other Unix systems

Unix.png

The source code for the compiler and associated software is packaged as a source tarball. You need the file obc-2.9.2.tar.gz. After unpacking the file, you will find instructions for compiling and installing the compiler in the file INSTALL. Building the compiler requires OCaml and TCL, both of which come as standard packages on all good Unix distributions. Building the debugger (which is selected by giving the option --enable-debugger) requires development versions of the GTK libraries.

The bytecode interpreter assumes that pointers are 32 bits wide, and won't build on architectures that have 64-bit pointers. On common 64-bit architectures, however, it is simple to build it in 32-bit compatibility mode. Just specify 'CC=gcc -m32' at the configure stage.

On x86 machines, the default runtime system includes a JIT translator. We don't have much experience yet with porting it to different Unix systems.

Windows systems

Windows.png

For all modern (read: 32-bit or 64-bit) Windows systems such as Windows 2000 and Windows XP, Windows Vista (and probably Windows 7), you need the installer obc-win-2-9-2.exe. When asked, you can choose to Run the installer, or if you prefer, save it on the desktop, then double-click it to start the installation process. The installer will ask various questions about where to install the compiler, and so on. It's OK to press the Return key and accept the default answer each time. I'm not sure, but it may be necessary to restart Windows after installing for the compiler to work; it certainly won't do any harm. The compiler can then be invoked by the command obc at the Command Prompt.

Since Windows makes a fuss about installing applications that have not been digitally signed, I'll show you some screen shots (from release 2.7) so you know what to expect. The screenshots are from Windows XP; no doubt those from Vista will be similar but more scarily worded. If you click on the link above, you will probably see a dialog box like this:

Obcsnap-1.png

It's OK to click on Run here. Next the installer will be downloaded:

Obcsnap-2.png

Now you'll get another warning:

Obcsnap-3.png

Again, you can click on Run, and the installer will start.

Obcsnap-4.png

From this point on, you can safely accept the default answer to every question.

Obcsnap-5.png

The default is to install OBC under Program Files.

Obcsnap-6.png

Ready to go.

Obcsnap-7.png

There's a README file that gives a few details. Actually, it's a bit out of date.

Obcsnap-8.png

The installer is finished; now you may have to restart Windows before using the compiler.

Macintosh systems

Apple.png

If you are running Mac OS X version 10.5 (Leopard) or 10.6 (Snow Leopard), you need the package obc-mac-2.9.2.pkg. Clicking on the link will start the Mac OS installer; just click through all the defaults to install the compiler and associated software under /usr/local. To use the compiler, you'll need to have /usr/local/bin in your path. You can set this up by including the line

export PATH=/usr/local/bin:$PATH

in the file ~/.profile.

If you are running Mac OS version 10.4 (Tiger), then you'll have to build the compiler and tools for yourself, following the instructions given above for generic unix systems, after installing the XCode tools from Apple and the Objective Caml compiler. This will work well for building the compiler and the runtime system. The GUI debugger is more difficult to build, but I have written some notes that may be helpful.

Version history

2.9.2
Fixed a bug in the garbage collector; fixed rounding error that sometimes caused Random.Roll(n) to return n; a couple of other minor bug fixes.
2.9.1
Improved code for array indexing; implemented missing LDIF and STIF instructions; added Mac OS build.
2.9.0
Baseline.
Navigation
Toolbox