CAST Installation

Platforms and Dependencies

CAST has been installed and run successfully on a variety of plaforms, including Ubuntu, CentOS, Fedora and Mac OS X. Installing CAST from source requires the following packages. Most platforms provides these as packages. On OS X we recommend Macports for setting up a build environment. The list below includes Ubuntu and OSX packages that can be installed from the standard repositories.

It is important that the the Ice.jar and ant-ice.jar files installed by the Ice java package, and the liblog4j1.2-java file installed by log4j, are included in your classpath. You can add...

export CLASSPATH=/usr/share/java/Ice.jar:/usr/share/java/ant-ice.jar:/usr/share/java/log4j-1.2.jar:$CLASSPATH

... to your .bashrc file, or similar. If you have multiple versions of Java installed on Ubuntu you can use

sudo update-alternatives --config java

... to select the correct installation.

Installation

  1. Untar the cast-*.tar.gz file. We'll call the resulting directory $CAST_ROOT. Change into that directory.

  2. Edit $CAST_ROOT/build.properties so that the "value.install.prefix" property is the prefix where you'd like to install CAST on your system. The default is /usr/local.

  3. Compile the Java elements of CAST using ant:

    ant build 

    This should produce a directory output/classes under $CAST_ROOT which contains all the Java parts of CAST.

  4. Install the jar file:

    sudo ant install 

    This will copy the file cast.jar to <install.prefix>/share/java for later use. If there are problems with this you can do it manually:

    cp $CAST_ROOT/output/jars/cast.jar <install.prefix>/share/java
    

  5. Configure the C++ parts of CAST using cmake. Do this by creating the $CAST_ROOT/BUILD directory, changing into it, then running ccmake on the directory above. ccmake is a cross-platform tool which produces makefiles which we will later use to build CAST. The command will produce a GUI window with a number of options. The default values should be fine, unless you wish to change CMAKE_INSTALL_PREFIX to be a different install prefix. This should be the same as you've used in build.xml. To create the build files press 'c' (to configure the build files) until you are able to press 'g' (to generate the build files). If you encounter errors, follow the instructions in the error messages to fix them.

    mkdir $CAST_ROOT/BUILD
    cd $CAST_ROOT/BUILD
    ccmake ..
    

  6. Once you have configured the build with cmake you can build and install CAST. Do this by changing to $CAST_ROOT and running make install within the build directory:

    cd $CAST_ROOT
    make -C BUILD 
    sudo make -C BUILD install
    

    If this completes successfully, the file <install.prefix>/bin/cast-server should exist. If this does exist, then CAST is installed!

  7. Configure your system environment to find CAST. This means including <install.prefix>/bin in your PATH, and <install.prefix>/share/java/cast.jar in your CLASSPATH. Make sure you do this in a way the persists across sessions (e.g. by editing your .bashrc or .profile files).

Common Installation Errors

  1. If ant exits with an error like:

    BUILD FAILED
    /tmp/cogx-code/build.xml:53: The following error occurred while executing this line:
    /tmp/cogx-code/build.xml:24: The following error occurred while executing this line:
    /tmp/cogx-code/tools/cast/build.xml:12: taskdef class Slice2JavaTask cannot be found
    

    you most likely forgot to set the CLASSPATH so that it include the location of ant-ice.jar (please see top of page)

  2. If you get compilation errors like:

    compile:
        [javac] Compiling 280 source files to /tmp/cogx-code/output/classes
        [javac] /tmp/cogx-code/tools/cast/src/java/cast/CASTException.java:14: package Ice does not exist
        [javac] public class CASTException extends Ice.UserException
        [javac]                                       ^
        [javac] /tmp/cogx-code/tools/cast/src/java/cast/AlreadyExistsOnWMException.java:33: package IceInternal does not exist
        [javac]     __write(IceInternal.BasicStream __os)
        [javac]   
        ...
    

    you forgot to add the path to Ice.jar to your CLASSPATH as described above.


Generated on Mon Jun 13 15:56:05 2011 for CoSy Architecture Schema Toolkit (CAST) by  doxygen 1.5.8