Getting Started: Building and Running VMKit
This page gives you the shortest path to checking out vmkit and demos a few options. This should get you up and running with the minimum of muss and fuss. If you like what you see, please consider getting involved with the vmkit community.
A word of warning
While this work aims to provide a fully functional JVM, it is still early work and is under heavy development.
Some of the common missing pieces in vmkit/llvm are:
- Mixed interpretation/compilation.
- Adaptive optimization.
Building vmkit / working with the code
If you would like to check out and build the project, the current scheme is:
- Checkout LLVM and Clang from SVN head.
- svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
- cd llvm/tools
- svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
- cd ../..
- ./configure; make ENABLE_OPTIMIZED=1
- Download GNU Classpath 0.97.2:
- tar zxvf classpath-0.97.2.tar.gz
- cd classpath-0.97.2
- ./configure --disable-plugin --disable-examples --disable-Werror; make
- cd lib
- If you are running on Linux:
- ln -s ../native/jni/gtk-peer/.libs/libgtkpeer.so;
- ln -s ../native/jni/gconf-peer/.libs/libgconfpeer.so;
- ln -s ../native/jni/java-io/.libs/libjavaio.so;
- ln -s ../native/jni/java-lang/.libs/libjavalangreflect.so;
- ln -s ../native/jni/java-lang/.libs/libjavalang.so;
- ln -s ../native/jni/java-net/.libs/libjavanet.so;
- ln -s ../native/jni/java-nio/.libs/libjavanio.so;
- ln -s ../native/jni/java-util/.libs/libjavautil.so;
- If you are running on MacOS:
- ln -s ../native/jni/gtk-peer/.libs/libgtkpeer.dylib;
- ln -s ../native/jni/gconf-peer/.libs/libgconfpeer.dylib;
- ln -s ../native/jni/java-io/.libs/libjavaio.dylib;
- ln -s ../native/jni/java-lang/.libs/libjavalangreflect.dylib;
- ln -s ../native/jni/java-lang/.libs/libjavalang.dylib;
- ln -s ../native/jni/java-net/.libs/libjavanet.dylib;
- ln -s ../native/jni/java-nio/.libs/libjavanio.dylib;
- ln -s ../native/jni/java-util/.libs/libjavautil.dylib;
- Checkout vmkit:
- svn co http://llvm.org/svn/llvm-project/vmkit/trunk vmkit
- Configure vmkit:
- ./configure
- --with-llvmsrc=<directory>
- Tell vmkit where the LLVM source tree is located.
--with-llvmobj=<directory>- Tell vmkit where the LLVM object tree is located.
--with-gnu-classpath-glibj=<file or directory>- Tell vmkit where GNU Classpath glibj.zip is located.
--with-gnu-classpath-libs=<directory>- Tell vmkit where GNU Classpath libs are located.
--with-mmtk-plan=-
- org.mmtk.plan.marksweep.MS (default)
- org.mmtk.plan.copyms.CopyMS
- org.mmtk.plan.semispace.SS
- org.mmtk.plan.immix.Immix
- org.mmtk.plan.generational.marksweep.GenMS
- org.mmtk.plan.generational.copying.GenCopy
- org.mmtk.plan.generational.immix.GenImmix
- Build vmkit:
- cd vmkit
- make ENABLE_OPTIMIZED=1 (this will give you a release build)
- Try it out: (assuming vmkit/Release+Asserts/bin is in your path)
- j3 --help
- j3 HelloWorld