Documentation:Installation

From Tom

(Difference between revisions)
Jump to: navigation, search
(Getting some examples)
m (Windows (simple install))
Line 13: Line 13:
== Windows (simple install) ==
== Windows (simple install) ==
-
For a painless process, run the <tt>[http://gforge.inria.fr/frs/download.php/22338/tom-2.7_setup.exe tom-2.7_setup.exe]</tt> kit provided ([http://gforge.inria.fr/frs/?group_id=78 downloads]). This will automatically update the environment as needed.
+
For a painless process, run the <tt>[http://gforge.inria.fr/frs/download.php/22345/tom-2.7_setup.exe tom-2.7_setup.exe]</tt> kit provided ([http://gforge.inria.fr/frs/?group_id=78 downloads]). This will automatically update the environment as needed.
== Windows (manual install) ==
== Windows (manual install) ==

Revision as of 09:13, 26 May 2009

Doc : Tools

Installation  > Compiling from sources  > Using Tom  > Using Gom  > Configuring your environment  > Tom Server  > EMF Mapping Generator

Contents

Installing Tom

Requirements

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 Windows XP, MacOS X, Linux (Debian, Mandrake, Ubuntu, Gentoo), FreeBSD, and NetBSD.

The only requirement to run and compile Tom programs is to have a recent Java Development Kit installed (version 1.5 or newer):

Windows (simple install)

For a painless process, run the tom-2.7_setup.exe kit provided (downloads). This will automatically update the environment as needed.

Windows (manual install)

If for any reason you prefer to install Tom manually, here is the procedure to follow:

We assume that Tom is installed in C:\tom (any other directory may be chosen). The following steps are needed for setting up the user variables of your environment:

  • set JAVA_HOME to where Java JDK is installed (for instance: C:\Program Files\Java\jdk1.6.0_13)
  • set TOM_HOME to C:\tom
  • set CLASSPATH to .;%TOM_HOME%\lib\tom-runtime-full.jar
  • set PATH to %Path%;%TOM_HOME%\bin;%JAVA_HOME%\bin

For a detailed description of setting environment variables in Windows, please refer to Windows documentation. For Windows XP, some information can be found here

Windows (with Cygwin)

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
  export CLASSPATH=${TOM_HOME}/lib/tom-runtime-full.jar:${CLASSPATH}

Note: we recommend to add current directory . in your CLASSPATH.

Unix

To install Tom, choose a directory (${HOME}/tom for instance) and copy the distribution files there. This directory will be called TOM_HOME in the following.

The following sets up the environment, for Bourne shell (sh) and C shell (csh) families:

(sh)
  export TOM_HOME=${HOME}/tom
  export PATH=${PATH}:${TOM_HOME}/bin
  export CLASSPATH=${TOM_HOME}/lib/tom-runtime-full.jar:${CLASSPATH}
(csh)
  setenv TOM_HOME ${HOME}/tom
  set path=( $path ${TOM_HOME}/bin )
  setenv CLASSPATH ${TOM_HOME}/lib/tom-runtime-full.jar:${CLASSPATH}

Note: we recommend to add current directory . in your CLASSPATH.

Getting some examples

Many examples have been written to test or illustrate some particular behaviors. This collection of examples is available: tom-examples-2.7.zip (see also downloads).

Unzip the archive and use the tool Ant to compile the examples:

Note: for Debian users, the ant package does not include the ant-optional java package, Debian (and Debian-based distributions like Ubuntu) users also need to install the ant-optional Debian package.

Using Eclipse IDE

The Eclipse platform (3.2 or newer) can be used to edit, compile, and run with Tom program. Eclipse is available for download at www.eclipse.org.

Installation

Tom has to be installed using one of the previously described methods:

  • simple Windows install: run tom-2.7_setup.exe
  • manual install (Windows or Unix)

Use Ant to compile an example

  • import the examples as a project (create a Java projet and use the File->Import->General->Archive File)
  • Window->Open Perspective->Other->Java (default)
  • expand examples/addressbook
  • Window->Show View->Other->Ant
  • move the build.xml file to the Ant view
  • click on the build target

To run an example

  • in the package explorer: right-click->refresh (or press F5)
  • open the "Run Dialog" box (Run->Run Configurations)
  • select Java Application
  • enter addressbook.AddressBookGom as Main class
  • in the "Classpath" tab, select "User Entries"
    • click Add External JARs, and select the JAR <TOM_HOME>/lib/tom-runtime-full
    • click on the Advanced button, add examples/build using Add Folder

Configure the editor

  • use Preferences->General->Editors->File Associations to associate a Java Editor to *.t files

Eclipse plugin (deprecated)

The last version of the Eclipse plugin corresponds to Tom version 2.6. The plugin is available directly from the Eclipse platform via the update link:
http://tom.loria.fr/plugin.php

However, the last version Tom can be used directly under eclipse (without using the specific Tom plugin). See Documentation:Using_Tom_under_eclipse for more information.

Contents

The binary distribution of Tom consists of one of the following directory layout:

 tom
  +--- bin (BSD Licence)
  |
  +--- lib 
  |     +--- tom-runtime-full (BSD Licence)
  |     |
  |     +--- tom-compiler-full (GPL Licence)                                                                                  
  |     
  +--- share (BSD Licence)
        +--- contrib
        |
        +--- tom 
        |     +--- adt
        |     +--- c
        |     +--- caml
        |     +--- java
        |
        +--- man

or (version with separate jars):

 tom
  +--- bin (BSD Licence)
  |
  +--- lib 
  |     +--- runtime (BSD Licence)
  |     |     +--- shared-objects     // Factory of shared objects
  |     |     +--- jjtraveler         // Visitable interface
  |     |     +--- aterm              // ATerm library
  |     |     +--- tom-runtime        // support for strategies, bytecode, viewer, and xml 
  |     |     +--- Bytecode           // ADT for ASM Bytecode library
  |     |     +--- TNode              // ADT for XML
  |     |
  |     +--- tom (GPL Licence)                                                                                  
  |     |     +--- tom                // Tom compiler
  |     |     +--- gom                // Gom compiler
  |     |     +--- GomADT             // ADT for Gom 
  |     |     +--- TomSignature       // ADT for Tom
  |     |     +--- plugin-platform    // plugin platform
  |     |     +--- PlatformAlert      // platform error messages
  |     |     +--- PlatformOption     // platform options
  |     |
  |     +--- tools (not needed by the runtime, unless you use bytecode, term viewer, or xml supports)
  |     |     +--- ant                // to compile the project
  |     |     +--- ant-antlr          // ant task for antlr
  |     |     +--- antlr-2.7.7        // to compile the Tom parser
  |     |     +--- antlr-3.1.3        // to compile the Gom parser
  |     |     +--- antlr3             // ant plugin 
  |     |     +--- asm-3.0            // to manipulate bytecode
  |     |     +--- grappa1_2          // to visualize terms
  |     |     +--- junit              // to test the system
  |     |     +--- xercesImpl         // for XML
  |     |     +--- xml-apis           // for XML
  |     |     +--- args4j-2.0.10      // for command line parsing
  |     
  +--- share (BSD Licence)
        +--- contrib
        |
        +--- tom 
        |     +--- adt
        |     +--- c
        |     +--- caml
        |     +--- java
        |
        +--- man


Tools

Installation  > Compiling from sources  > Using Tom  > Using Gom  > Configuring your environment  > Tom Server  > EMF Mapping Generator

Tom Documentation
Guided Tour :: Tutorial :: Language Reference :: Tools
Personal tools
Create a book