Last tested: OpenJDK@c76b64be MMTk@e02d62d6 2018-07-14 by Felix Friedlander
GCC 7.3 should already be installed, but it will not be the default. When
running configure
, we will need to pass CC
and CXX
explicitly.
OpenJDK 8 is installed, but we want a newer boot JDK. Download OpenJDK 10 from java.net and extract it:
$ curl -O https://download.java.net/java/GA/jdk10/10.0.2/19aef61b38124481863b1413dce1855f/13/openjdk-10.0.2_linux-x64_bin.tar.gz
$ tar -xf openjdk-10.0.2_linux-x64_bin.tar.gz
An appropriate version of Rust should already be installed. You can check this
using rustup
:
$ rustup show
<DEBUG_LEVEL>
can be one of release
, fastdebug
, slowdebug
and optimized
.
cd openjdk
# Build MMTk
cd mmtk
cargo +nightly build
cd ..
# Build OpenJDK
bash configure --disable-warnings-as-errors --with-debug-level=<DEBUG_LEVEL>
CONF=linux-x86_64-normal-server-<DEBUG_LEVEL> make
# JDK is at `build/linux-x86_64-normal-server-<DEBUG_LEVEL>/jdk`
cd openjdk
# Build MMTk
cd mmtk
cargo +nightly build --release
cd ..
# Build OpenJDK
bash configure --disable-warnings-as-errors
CONF=linux-x86_64-normal-server-release make
# JDK is at `build/linux-x86_64-normal-server-release/jdk`
java
binary is atbuild/linux-x86_64-normal-server-<DEBUG_LEVEL>/jdk/bin/java
.- Set env
LD_LIBRARY_PATH
to include$PWD/mmtk/vmbindings/openjdk/target/debug
(or$PWD/mmtk/vmbindings/openjdk/target/release
if openjdk is built with debug levelrelease
). - To enable MMTk, pass
-XX:+UseMMTk -XX:-UseCompressedOops
tojava
.
e.g.:
- If
DEBUG_LEVEL
=fastdebug
,slowdebug
oroptimized
:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/mmtk/vmbindings/openjdk/target/debug
build/linux-x86_64-normal-server-fastdebug/jdk/bin/java -XX:+UseMMTk -XX:-UseCompressedOops HelloWorld
- If
DEBUG_LEVEL
=release
:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/mmtk/vmbindings/openjdk/target/release
build/linux-x86_64-normal-server-release/jdk/bin/java -XX:+UseMMTk -XX:-UseCompressedOops HelloWorld
Original instructions by Abdullah Al Mamun and Tanveer Hannan
Updated Sep 2018 by Felix Friedlander
Updated Feb 2020 by Wenyu Zhao