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.
- g++ (part of GCC, tested with v 4.3.2).
- Sun's Java JDK, preferably version 6.
- Ubuntu: sun-java6-jdk
- OSX: already installed
- Python, tested with version 2.6.
- Ubuntu: python-2.6
- OSX: already installed
- Cmake version 2.6 or above.
- Ubuntu: cmake
- OSX (macports): cmake
- Ice version 3.3 or above for C++, Java and Python.
- Ubuntu: libzeroc-ice33-dev, libzeroc-ice-java and python-zeroc-ice
- OSX (macports): db46 +java and ice-java, ice-cpp and ice-python.
- Boost version 1.35 or above.
- Ubuntu: libboost1.35-dev
- OSX (macports): boost
- log4j and log4cxx
- Ubuntu: liblog4j1.2-java liblog4cxx10-dev
- OSX (macports): jakarta-log4j log4cxx
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...
... 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.
Untar the cast-*.tar.gz file. We'll call the resulting directory $CAST_ROOT. Change into that directory.
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.
Compile the Java elements of CAST using ant:
This should produce a directory output/classes under $CAST_ROOT which contains all the Java parts of CAST.
Install the jar file:
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
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.
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:
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!
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).
If ant exits with an error like:
/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)
If you get compilation errors like:
[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] /tmp/cogx-code/tools/cast/src/java/cast/AlreadyExistsOnWMException.java:33: package IceInternal does not exist
[javac] __write(IceInternal.BasicStream __os)
you forgot to add the path to Ice.jar to your CLASSPATH as described above.