Installing OBC release 2.8
From Spivey's Corner
[The current version of OBC is 2.9].
Note: the JIT runtime system in this release contains a serious bug in the management of floating point registers that can cause library functions like Math.Sin to give wrong results. A workaround is to compile programs that use floating point library routines with the -j0 flag so that they use the bytecode interpreter instead of the JIT. The bug is fixed in release 2.9.
This page contains the materials and instructions you need to install release 2.8 of the Oxford Oberon-2 Compiler and associated programs on your own computer. Release 2.8 includes a JIT translator that compiles your program into machine code just before each procedure is executed for the first time.
- 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.
Another page has instructions and links for installing release 2.7 of the compiler, which might have fewer bugs.
Contents |
Debian, Ubuntu and similar Linux systems
The compiler and associated software is packaged as a Debian
archive that is installed under /usr.
You need the file obc_2.8.3_i386.deb.
Copy it to your machine, then issue the command
$ sudo dpkg -i obc_2.8.3_i386.deb
That's all there is to it!
(This package was built on an Ubuntu 9.10 system.)
Other Linux systems
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.8.3.tar.gz.
To install it under /usr/local:
$ tar xfz obc-linux-2.8.3.tar.gz $ cd obc-linux-2.8.3 $ ./configure $ make $ sudo make install
The above package was linked on an Ubuntu 9.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
The source code for the compiler and associated software is
packaged as a source tarball. You need the file obc-2.8.3.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 GUI debugger (which is selected by giving the option --enable-debugger-gui) 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
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-8-3.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:
It's OK to click on Run here. Next the installer will be downloaded:
Now you'll get another warning:
Again, you can click on Run, and the installer will start.
From this point on, you can safely accept the default answer to every question.
The default is to install OBC under Program Files.
Ready to go.
There's a README file that gives a few details. Actually, it's a bit out of date.
The installer is finished; now you may have to restart Windows before using the compiler.
Macintosh systems
If you are running Mac OS X version 10.5 (Leopard) or 10.6 (Snow Leopard), you need the package obc-mac-2.8.4.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.
(Earlier releases of OBC required you to install the GTK libraries as a framework in order to use the debugger. As of release 2.8.4, this is no longer necessary, as the OBC package includes its own copy of these libraries.)
This Macintosh port is brand new, and I would appreciate any field reports, good or bad. Please add a note on the talk page with your experiences. The port was built on a MacBook running Snow Leopard using the SDK for Leopard, so it ought run on either.
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.8.4
- Improved Mac OS/X build; correct display of runtime error messages in the debugger.
- 2.8.3
- Bug fixes; Mac OS/X build.
- 2.8.2
- Minor usability improvements to debugger gui.
- 2.8.1
- Bug fixes; Improvements to debugger gui; Removed text-mode debugger; more conventional stack layout for JIT on i386.
- 2.8.0
- Baseline with gui debugger and JIT translator.












