This chapter describes how to install and use the Tom system.
Tom is a Java application written with JDK 1.5. Tom is platform independent and runs on various systems. It has been used successfully on many platforms, including Linux (Debian, Mandrake, Ubuntu), FreeBSD, NetBSD, MacOS X, and Windows XP.
The only requirement to run Tom is to have a recent Java Runtime Environment installed (version 1.5 or newer) and/or the Eclipse platform (3.2 or newer). In addition, Ant can be useful to compile the system and the examples:
The binary distribution of Tom consists of the following directory layout:
tom +--- bin // contains launcher scripts +--- lib // contains Tom jars and necessary dependencies | +--- runtime (BSD Licence) | +--- tom (GPL Licence) | +--- tools | +--- share +--- contrib +--- man +--- tom // contains predefined mapping +--- adt +--- c +--- caml +--- java
To install Tom, choose a directory and copy the distribution files there. This directory will be designed in the following by TOM_HOME.
JDK 1.5 or newer is required.
For a painless process, please use the install kit provided. This will automatically update the environment as needed.
Anyway, if for any reason you want to do it all manually, here is the procedure you need to follow:
We assume that Tom is installed in c:\tom. The following steps are needed for setting up the environment:
For a detailed description of setting environment variables in
Windows, please refer to Windows documentation. For Windows XP, some
information can be found here:
http://support.microsoft.com/default.aspx?scid=kb;en-us;310519&sd=tech
If you installed Tom using the install kit, the installation is complete. If you want to install it manually (not recommended), please use the following instructions.
We assume that Tom is installed in c:\tom\. Please issue the following for setting up Tom:
export TOM_HOME=/cygdrive/c/tom export PATH=${PATH}:${TOM_HOME}/bin
We also suggest you to define a TOM_LIB variable and update your CLASSPATH accordingly:
for i in "${TOM_HOME}"/lib/runtime/*.jar do TOM_LIB="$TOM_LIB:$i" done export CLASSPATH=${TOM_LIB}:${CLASSPATH}
Assuming Tom is installed in /usr/local/tom. The following sets up the environment:
(bash) export TOM_HOME=/usr/local/tom export PATH=${PATH}:${TOM_HOME}/bin (csh) setenv TOM_HOME /usr/local/tom set path=( $path ${TOM_HOME}/bin )
We also suggest you to define a TOM_LIB variable and update your CLASSPATH accordingly:
(bash) for i in "${TOM_HOME}"/lib/runtime/*.jar do TOM_LIB="$TOM_LIB:$i" done export CLASSPATH=${TOM_LIB}:${CLASSPATH} (csh) set TOM_LIB=`echo ${TOM_HOME}/lib/runtime/*.jar | tr ' ' ':'` setenv CLASSPATH ${TOM_LIB}:${CLASSPATH}
The Tom eclipse plugin is available directly from the Eclipse
platform via the update link:
http://tom.loria.fr/plugin.php
From the Help menu, choose Help Content and look at the Tom Section. You will find there everything to use Tom in a very simple way.
Many examples have been written to test or illustrate some particular behaviors. This collection of examples is available at the http://tom.loria.fr/download.php page.
The Tom and Gom compilers are written in Tom itself. The compiler is certainly the most complex program written in Tom. Most of the constructs provided by Tom are used and tested in the project itself.
The Tom and Gom sources are available through anonymous cvs(1). To get them, use the commands:
cvs -d :pserver:anonymous@scm.gforge.inria.fr:/cvsroot/tom login cvs -d :pserver:anonymous@scm.gforge.inria.fr:/cvsroot/tom checkout -P jtom
Developer access is possible via ssh. See Gforge for detailed instructions.
The cvs checkout will get a new repertory in your current working directory, called jtom. We will call this directory ${TOM_BASE}.
First of all, please read ${TOM_BASE}/INSTALL. Even if the current guide should be enough, this file may contain useful information.
The Tom build process uses apache ant to automate the all parts of the process. This build process is specified by the ${TOM_BASE}/build.xml file. You will need to install apache ant and Java 1.5 in order to compile Tom.
The build process requires apache ant 1.7 or more, and a Java environment compatible with Java 1.5.
Optionally, to customize the build environment, you will have to copy the template configuration file ${TOM_BASE}/local.properties_template to ${TOM_BASE}/local.properties, and edit the latter it to reflect your setup. The most common is to set build.compiler=jikes to use the jikes Java compiler, and build.compiler.emacs=true to get errors in a format the emacs editor can handle.
To compile the stable distribution of Tom, you have to use the ${TOM_BASE}/build.sh script. To use it, first make sure to cd(1) to ${TOM_BASE}. Then you can build the stable distribution.
$ ./build.sh stable
This creates the stable distribution in the directory ${TOM_BASE}/stable/dist.
To build and install the source distribution, you have to do the following:
$ ./build.sh stable $ ./build.sh src.dist
This creates the src distribution in the directory ${TOM_BASE}/src/dist.
To list all the available targets for the build:
$ ./build.sh -projecthelp
To setup Tom after a source build, you can simply follow the configuration instructions for the binary distribution found in Section 14, using either ${TOM_BASE}/stable/dist or ${TOM_BASE}/src/dist for value for the TOM_HOME environment variable.