Installing OBC release 3.1

From Spivey's Corner
Jump to: navigation, search

Note: Links on this page will be broken until the release is finalised, but you can access a beta version directly from the Bitbucket download page.

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 downloads page of the compiler's BitBucket repository, where there is also an issue tracker. The current version is 3.1.0.

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. Possibly a student project this year will result in a nice JIT backend for the MIPS processor on the Onion Omega, but that will be about all.

Debian, Ubuntu and similar x86 or amd64 Linux systems

Debian.png
Ubuntu.png

The compiler and associated software is packaged as a Debian archive that is installed under /usr. You need either the file obc_3.1.0_i386.deb (32 bits) or the file obc_3.1.0_amd64.deb (64 bits).

Copy it to your machine, then issue the command

$ sudo dpkg -i obc_3.1.0_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 Stretch system, but should work on other Debian-based systems.)

Raspberry Pi under Raspbian

RPi.png

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.0_armhf.deb for the ARM architecture.

Copy the file to your machine, then issue the command

$ sudo dpkg -i obc_3.1.0_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 Stretch.

Other Unix systems

Unix.png

The source code for the compiler and associated software is available on BitBucket:

$ hg clone http://bitbucket.org/Spivey/obc-3 -u rel-3.1.0

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.

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 translatorA compiler that is embedded in the execution environment for a virtual machine, and translates code for the virtual machine into native machine code just before each procedure is called. After translation, the native code remains in memory and can be used if the same procedure is called again, but the code is thrown away when the program terminates. Either each procedure (or some other fragment of the program) is translated when it is called for the first time, or an interpreter and a translator co-exist, and procedures are translated if they have been called more than a few times.; other architectures fall back to an interpreter for the bytecode, which is also used on all architectures to support profiling and debugging.

Windows systems

Windows.png

For all modern (read: 32-bit or 64-bit) Windows systems such as Windows 2000 and Windows XP, Windows Vista, Windows 7 (and probably Windows 8 (and very likely Windows 10)), you need the installer obc-win-3-1-0.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 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:

Obcsnap-1.png

It's OK to click on Run here. Next you will see another warning:

Obcsnap-2.png

You can safely click on Yes, and the installer will start.

Obcsnap-3.png

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

Obcsnap-4.png

The default is to install OBC under Program Files.

Obcsnap-5.png

Ready to go.

Obcsnap-6.png

Installation almost complete.

Obcsnap-7.png

There's a README file that gives a few details.

Obcsnap-8.png

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

Macintosh systems

Apple.png

You need the package obc-mac-3.1.0.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.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.
Personal tools

Variants
Actions
Navigation
Tools