MMTk port to SSCLI -> Documentation -> Building RMTk

Building RMTk

This document explains how to build RMTk, the Rotor version of MMTk.

GcjMMTk Source Code

Download gcjmmtk20050107.tar.gz (79.1 KiB), the source code for GcjMMTk (the gcj buildable module of MMTk).

Use the following command to unpack the archive:

tar xzf download_directory/gcjmmtk20050107.tar.gz

MMTk Source Code

The generic MMTk source code is available from the Jikes RVM CVS repository. At present RMTk is built from a 6 December snapshot of MMTk. Use the following commands to get the required snapshot:

cvs -d :pserver:anoncvs@www-124.ibm.com:/usr/cvs/jikesrvm login

The CVS password is anoncvs.

cvs -d :pserver:anoncvs@www-124.ibm.com:/usr/cvs/jikesrvm co -D '2004/12/06 22:30:00 UTC' MMTk

Rotor Source Code

Changes to the original Rotor source code are needed for RMTk. To get the Rotor source with the RMTk changes you either apply a patch to the original source or get the complete modified source.

Patch Original Source

This is the recommend method, particularly if you already have the original Rotor source code.

The original Rotor source code is available from the Shared Source SSCLI home page. Download the sscli_20021101.tgz archive (15.0 MiB) linked to at the bottom of the page. Alternatively, the sscli_22021101.tgz archive is included on the CD-ROM accompanying Shared Source CLI Essentials, in the archives directory.

Download rotor20050107.patch.gz (184 KiB), the patch for the changes to Rotor for RMTk.

Use the following commands to unpack the archive and apply the patch:

gunzip download_directory/rotor20050107.patch.gz
tar xzf download_directory/sscli_20021101.tgz
cd sscli
patch -u -p0 < download_directory/rotor20050107.patch

Complete Modified Source

The Rotor source with RMTk changes is also available. The source archive is about 15 MiB, so this method is not recommended if you already have the Rotor source and have a slow Internet connection.

Download sscli_rmtk_20050107.tar.gz (15.0 MiB), the complete modified source archive.

Use the following command to unpack the archive:

tar xzf sscli_rmtk_20050107.tar.gz

Patching MMTk

GcjMMTk requires some changes to the MMTk code in CVS. These changes are contained in the mmtk-cmtk.patch file included with the GcjMMTk. Assuming that you unpacked the GcjMMTk and MMTk source in one directory, use the following commands from that directory to apply the patch:

patch -u -p0 < gcjmmtk/mmtk-cmtk.patch

Environment variables

The RMTk build process utilises a build directory separate from the MMTk and GcjMMTk source directories. Set the JMTK_BUILD environment variable to a suitable directory name. The directory named does not have to exist, but should be empty, as the directory is removed by the build scripts. For example:

export JMTK_BUILD=~/jmtkBuild

Set the MMTKSOURCE environment variable to the src subdirectory of the MMTk directory created when checking out the MMTk source. For example:

export MMTKSOURCE=~/MMTk/src

Set the TRANSFORMJAR environment variable to the Transform.jar file for MMTk Transform. For example:

export TRANSFORMJAR=~/mmtktransform/Transform.jar

If the antlr.jar file is not in the antlr-2.7.2 subdirectory of your home directory then set the ANTLR environment variable to the directory the file is in. For example:

export ANTLR=$HOME/rmtkstuff/antlrdir

The J2SDK environment variable must be set to the installation directory for Java 2 SDK. If you installed the Blackdown Java Development Kit 1.4 as described in Requirements for RMTk the command is:

export J2SDK=/usr/local/linux-blackdown-jdk1.4.1

The ROTOR_BUILD environment variable must be set to the sscli directory of the Rotor source. For example:

export ROTOR_BUILD=~/sscli

Build

To build RMTk with the generational mark-sweep collector, change to the gcjmmtk directory of the GcjMMTK source and use the following commands:

./clean
./from_jmtk
./build genMS rmtk
./from_jmtk
./build genMS rmtk

It is sometimes necessary to run the from_jmtk / build sequence twice because the dependencies on automatically generated .h files are not completely identified on the first run.

When the from_jmtk script is run, many messages such as Java HotSpot(TM) Client VM warning: Cannot read /proc/self/stat. will appear on the console, this is normal.


Previous: Building MMTk Transform | Next: Building Rotor with RMTk

Author: Andrew Gray; Date: 7 January 2005