Note: The mercurial server is disabled at the moment while I investigate whether it can run with an acceptably low CPU load – Mike.
Installing OBC release 3.1
This page contains the materials and instructions you need to install release 3.1 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 3.0, this new release extends JIT support to the amd64 architecture in addition to x86 and ARM, and adds the ability under Linux to use libffi
in place of hand-written wrappers to call library functions. The 64-bit runtime executes the same bytecode program as the existing 32-bit runtime, and Oberon pointers and other addresses are represented in 32 bits; the storage manager is designed to allocate storage in the bottom 2GB of the address space to make this possible. Arithmetic on 64-bit integers is supported natively on amd64 instead of using library calls as on other architectures.
Compared with release 2, the release adds support for the Oberon-07 dialect of the language.
Source code and previous versions of the binary packages linked below are available from the releases page of the compiler's GitHub repository, where there is also an issue tracker. The current version is release 3.1.2.
Release 3.1 is likely to be the last (or nearly the last) release of OBC, as the author no longer has a need for an Oberon compiler for use in teaching. He plans to keep it available for the foreseeable future, with bug-fixes but without further enhancements.
Debian, Ubuntu and similar x86 or amd64 Linux systems
The compiler and associated software is packaged as a Debian archive that is installed under /usr
.
You need either the file
obc_3.1.2_i386.deb (32 bits) or the file
obc_3.1.2_amd64.deb (64 bits).
Copy it to your machine, then issue the command
$ sudo dpkg -i obc_3.1.2_i386.deb
(or the equivalent for amd64). Doing this may produce a message about unmet dependencies, and you can resolve them with the command
$ sudo apt-get -f install
(This package was built on an Debian Buster system, but should work on other Debian-based systems.)
Raspberry Pi under Raspbian
Installation on the Raspberry Pi (any model) is the same as on other Debian-based systems, except that you need the file obc_3.1.2_armhf.deb for the ARM architecture.
Copy the file to your machine, then issue the command
$ sudo dpkg -i obc_3.1.2_armhf.deb
If you get a message unmet dependencies, you can resolve them with the command
$ sudo apt-get -f install
This package was built under the Raspbian version that is based on Debian Buster.
Other Unix systems
The source code for the compiler and associated software is available on GitHub:
$ git clone https://github.com/Spivoxity/obc-3.git -b rel-3.1.2
After cloning the repository, you will find instructions for compiling and installing the compiler in the file README
. 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, including gtksourceview2.0.
Note: development of the compiler is managed with Mercurial rather than Git, and the GitHub URL above leads to a Git repository exported from Mercurial that is updated whenever there is a fresh release or bugfix. For more up-to-date information, you can use Mercurial to clone directly the repository on Mike's server:
$ hg clone https://spivey.oriel.ox.ac.uk/hg/obc-3 -u rel-3.1.2
The runtime system uses pointers are 32 bits wide, and has been made to work on amd64 by forcing memory to be allocated in the bottom 2GB of the address space. On x86, amd64 and ARM machines, the default runtime system includes a JIT translator; other architectures fall back to an interpreter for the bytecode, which is also used on all architectures to support profiling and debugging.
Windows systems
For all modern Windows systems (from Windows 2000 onwards), you need the installer
obc-win64-3-1-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.
It's also possible to build OBC for 32-bit Windows systems, but these are rare enough now that I've chosen to stop including a 32-bit binary in the release. Let me know if you have a desperate need and I will see what I can do.
Since Windows makes a fuss about installing applications that have not been digitally signed, I'll show you some screen shots so you know what to expect. The screenshots are from Windows 7 and a previous version of OBC; no doubt those from later versions of Windows will be similar but more scarily worded. If you download the installer, then double-click on the downloaded file, you will see this warning:
It's OK to click on Run here. Next you will see another warning:
You can safely click on Yes, 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.
Installation almost complete.
There's a README file that gives a few details.
The installer is finished; now you may have to restart Windows before using the compiler.
Macintosh systems
You need the package
obc-mac-3.1.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
.
Version history
- 3.1.2
- Various minor fixes, including Windows debugger.
- 3.1.1
- Fixed problem with literal tables in JIT translator for ARM.
- 3.1.0
- Initial release.
Known problems
- The JIT translator will not work under SELinux, because it depends on allocating memory that is both writable and executable. The source contains an option to avoid this, but it is untested.