Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 37 Next »

This guide describes how to build Jikes RVM. The first section is an overview of the Jikes RVM build process and this is followed by your system requirements and a detailed description of the steps required to build Jikes RVM.

Note

Icon

Once you have things working, as described below, the buildit  script will provide a fast and easy way to build the system.  We recommend you get things working as described below first, so you can be sure you've met the requisite dependencies etc.

Overview

Compiling the source code

The majority of Jikes RVM is written in Java and will be compiled into class files just as with other Java applications. There is also a small portion of Jikes RVM that is written in C that must be compiled with a C compiler such as gcc.  Jikes RVM uses Ant version 1.7.0 or later as the build tool that orchestrates the build process and executes the steps required in building Jikes RVM.

Note

Icon

Jikes RVM requires a complete install of ant, including the optional tasks. These are present if you download and install ant manually. Some Linux distributions have decided to break ant into multiple packages. So if you are installing on a platform such as Debian you may need to install another package such as 'ant-optional'.

Generating source code

The build process also generates Java and C source code based on build time constants such as the selected instruction architecture, garbage collectors and compilers. The generation of the source code occurs prior to the compilation phase.

Bootstrapping the RVM

Jikes RVM compiles Java class files and produces arrays of code and data. To build itself Jikes RVM will execute on an existing Java Virtual Machine and compiles a copy of it's own class files into a boot image for the code and data using the boot image writer tool. The set of files compiled is called the Primordial Class List. The boot image runner is a small C program that loads the boot image and transfers control flow into Jikes RVM.

Class libraries

The Java class library is the mechanism by which Java programs communicate with the outside world. Jikes RVM has configurable class library support, the most mature of which is the the GNU Classpath class library. In the release version of Jikes RVM is support for the Apache Harmony class library.

For GNU Classpath, the developer can either specify a particular version of GNU Classpath to use. By default the build process will download and build GNU Classpath.

Setting the ant property classlib.provider to Harmony (see how to define ant properties) will change the build process to download and build the Apache Harmony class library.

Target Requirements

Jikes RVM is known to build and work on certain combinations of instruction architectures and operating systems. The following sections detail the supported architectures and operating systems.

Architectures 

The PowerPC (or ppc) and ia32 instruction set architectures are supported by Jikes RVM.

Intel

Intel's Instruction Set Architectures (ISAs) get known by different names:

  • IA-32 is the name used to describe processors such as 386, 486 and the Pentium processors. It is popularly called x86 or sometimes in our documentation as x86-32.
  • IA-32e is the name used to describe the extension of the IA-32 architecture to support 8 more registers and a 64-bit address space. It is popularly called x86_64 or AMD64, as AMD chips were the first to support it. It is found in processors such AMD's Opteron and Athlon 64, as well as in Intel's own Pentium 4 processors that have EM64T in their name.
  • IA-64 is the name of Intel's Itanium processor ISA.

Jikes RVM currently supports the IA-32 ISA. As IA-32e is backward compatible with IA-32, Jikes RVM can be built and run upon IA-32e processors. The IA-64 architecture supports IA-32 code through a compatibility mode or through emulation and Jikes RVM should run in this configuration.

Operating Systems

Jikes RVM is capable of running on any operating system that is supported by the GNU Classpath library, low level library support is implemented and memory layout is defined. The low level library support includes interaction with the threading and signal libraries, memory management facilities and dynamic library loading services. The memory layout must also be known, as Jikes RVM will attempt to locate the boot image code and data at specific memory locations. These memory locations must not conflict with where the native compiler places it's code and data. Operating systems that are known to work include AIX, Linux and OSX. At one stage a port to win32 was completed but it was never integrated into the main Jikes RVM codebase.

Note: Current implementation of Jikes RVM implies that system native libraries (like GTK+) have been compiled with frame pointers. Most of Linux distribution have frame pointers enabled in most of the packages, but some explicitly use -fomit-frame-pointer thus producing the library that can't be used with JikesRVM. See this issue for example.

Support Matrix

The following table details the targets that have historically been supported and the current status of the support. The target.name column is the identifier that Jikes RVM uses to identify this target.

target.name

Operating System

Instruction Architecture

Address Size

Status

ia32-linux

Linux

ia32

32 bits

OK

ia32-osx

OSX

ia32

32 bits

OK

ia32-solaris

Solaris

ia32

32 bits

OK

ia32-cygwin

Windows

ia32

32 bits

WIP

ppc32-aix

AIX

PowerPC

32 bits

OK

ppc32-linux

Linux

PowerPC

32 bits

OK

ppc32-osx

OSX

PowerPC

32 bits

OK

ppc64-aix

AIX

PowerPC

64 bits

OK

ppc64-linux

Linux

PowerPC

64 bits

OK

x86_64-linux

Linux

ia32

32 bits*

OK

Tool Requirements

Java Virtual Machine

Jikes RVM requires an existing Java Virtual Machine that conforms to Java 6.0 such as Oracle JDK 1.6 or IBM SDK 6.0. Some Java Virtual Machines are unable to cope with compiling the Java class library so it is recomended that you install one of the above mentioned JVMs if they are not already installed on your system. The remaining build instructions assume that this Java Virtual Machine on your path. You can run "java -version" to check you are using the correct JVM.

Ant

Ant version 1.7.0 or later is the tool required to orchestrate the build process. You can download and install the Ant tool from http://ant.apache.org/ if it is not already installed on your system. The remaining build instructions assume that $ANT_HOME/bin is on your path. You can run "ant -version" to check you are running the correct version of ant.

C Tool Chain

Jikes RVM assumes that the GNU C Tool Chain is present on the system or a tool chain that is reasonably compatible. Most modern *nix environments satisfy this requirement.

Bison

As part of the build process, Jikes RVM uses the bison tool which should be present on most modern *nix environments.

Perl

Perl is trivially used as part of the build process but this requirement may be removed in future releases of Jikes RVM. Perl is also used as part of the regression and performance testing framework.

Awk

GNU Awk is required as part of the regression and performance testing framework but is not required when building Jikes RVM.

Extra tools recommended for Solaris

pkg-get will greatly simplify installing GNU packages on Solaris. Our patches require that GNU patch is picked up in preference to Sun's, to achieve this, for example, you can create a symbolic link to /usr/bin/gpatch from /opt/csw/bin/patch and make sure /opt/csw/bin is in your path before /usr/bin.

Instructions

Defining Ant properties

There are a number of ant properties that are used to control the build process of Jikes RVM. These properties may either be specified on the command line by "-Dproperty=variable" or they may be specified in a file named ".ant.properties" in the base directory of the jikesrvm source tree. The ".ant.properties" file is a standard Java proeprty file with each line containing a "property=variable" and comments starting with a # and finishing at the end of the line. The following table describes some properties that are commonly specified.

Property

Description

Default

host.name

The name of the host environment used for building Jikes RVM. The name should match one of the files located in the build/hosts/ directory minus the '.properties' extension.

None

target.name

The name of the target environment for Jikes RVM. The name should match one of the files located in the build/targets/ directory minus the '.properties' extension. This should only be specified when cross compiling the Jikes RVM. See Cross-Platform Building for a detailed description of cross compilation.

${host.name}

config.name

The name of the configuration used when building Jikes RVM. The name should match one of the files located in the build/configs/ directory minus the '.properties' extension. This setting is further described in the section Configuring the RVM.

None

patch.name

An identifier for the current patch applied to the source tree. See Building Patched Versions for a description of how this fits into the standard usage patterns of Jikes RVM.

""

components.dir

The directory where Ant looks for external components when building the RVM.

${jikesrvm.dir}/components

dist.dir

The directory where Ant stores the final Jikes RVM runtime.

${jikesrvm.dir}/dist

build.dir

The directory where Ant stores the intermediate artifacts generated when building the Jikes RVM.

${jikesrvm.dir}/target

protect.config-files

Define this property if you do not want the build process to update configuration files when auto downloading components.

(Undefined)

components.cache.dir

The directory where Ant caches downloaded components.  If you explicitly download a component, place it in this directory.

(Undefined, forcing download)

At a minimum it is recommended that the user specify the host.name property in the ".ant.properties" file.

The configuration files in "build/targets/" and "build/hosts/" are designed to work with a typical install but it may be necessary to overide specific properties. The easiest way to achieve this is to specify the properties to override in the ".ant.properties" file.

Selecting a Configuration

A "configuration" in terms of Jikes RVM is the combination of build time parameters and component selection used for a particular Jikes RVM image. The Configuring the RVM section describes the details of how to define a configuration. Typical configuration names include;

  • production: This configuration defines a fully optimized version of the Jikes RVM.
  • development: This configuration is the same as production but with debug options enabled. The debug options perform internal verification of Jikes RVM which means that it builds and executes more slowly.
  • prototype: This configuration is compiled using an unoptimized compiler and includes minimal components which means it has the fastest build time.
  • prototype-opt: This configuration is compiled using an unoptimized compiler but it includes the adaptive system and optimizing compiler. This configuration has a reasonably fast build time.

If a user is working on a particular configuration most of the time they may specify the config.name ant property in ".ant.properties" otherwise it should be passed in on the command line "-Dconfig.name=...".

Fetching Dependencies

The Jikes RVM has a build time dependency on the GNU Classpath class library and depending on the configuration may have a dependency on GCSpy. The build system will attempt to download and build these dependencies if they are not present or are the wrong version.

To just download and install the GNU Classpath class library you can run the command "ant -f build/components/classpath.xml". After this command has completed running it should have downloaded and built the GNU Classpath class library for the current host. See the Using GCSpy page for directions on building configurations with GCSpy support.

If you wish to manually download components (for example you need to define a proxy, so ant is not correctly downloading), you can do so and identify the directory containing the downloads using "-Dcomponents.cache.dir=<download directory>" when you build with ant.

Building the RVM

The next step in building Jikes RVM is to run the ant command "ant" or "ant -Dconfig.name=...". This should build a complete RVM runtime in the directory "${dist.dir}/${config.name}_${target.name}". The following table describes some of the ant targets that can be executed. A complete list of documented targets can be listed by executing the command "ant -projecthelp"

Target

Description

check-properties

Check that all the required properties are defined.

compile-mmtk

Compile MMTk toolkit.

prepare-source

Generate configuration independent source code if required or force.generation property is set.

prepare-config-source

Generate source code for the current configuration if required or force.generation property is set.

main or runtime

Build a runtime image.

clean

Remove the build and image directory for the current configuration.

very-clean

As with clean but also remove Java files generated by scripts.

real-clean

As with very-clean but remove all compiled images.

profiled-image

Compile a baseline version of the RVM for profiling then use the profile information to recompile the given config.name image.

Running the RVM

Jikes RVM can be executed in a similar way to most Java Virtual Machines. The difference is that the command is "rvm" and resides in the runtime directory (i.e. "${dist.dir}/${config.name}_${target.name}"). See Running the RVM for a complete list of command line options.

  • No labels