Do you really need to build cath-tools, or can you just use the 64-bit Linux executables from DOWNLOADS? Remember to chmod them to be executable (eg chmod +x cath-ssap). If you need cath-tools on a different platform (Windows? Mac?), please consider creating a new GitHub issue; maybe we can work together to set up an automated build.


You'll need a fairly good (ie recent) C++ compiler (eg on Ubuntu: sudo apt-get install g++). The code is currently being developed against GCC v4.9.2 and Clang v3.6.0.

git clone

There are three further dependencies/prerequisites...

Boost ( v1.57.0 / v1.58.0 )

This is used heavily throughout the code. Both headers and compiled library files are needed.

$ sudo apt-get install libboost-all-dev

CMake ( ≥ v2.8.8 )

This is used to build the software.

$ sudo apt-get install cmake

NOTE for UCL SMB users: If running cmake gives you errors like:

cmake: error while loading shared libraries: cannot open shared object file: No such file or directory

You probably mixing local/network binaries and libraries so try explicitly running /usr/bin/cmake.


The GNU Scientific Library is used for its Singular Value Decomposition function (gsl_linalg_SV_decomp()).

apt-get install gsl-bin libgsl2:amd64 libgsl-dbg:amd64 libgsl-dev

Building the Code

Once the dependencies are in place, the code can be built with:

$ make

NOTE: If you have multiple cores, you can make compiling faster by specifying that it may compile up to N sources simultaneously by appending -j [N] to the end of the make command.

With default Ubuntu config, this will build with GCC against GCC's standard library (libstdc++). If you instead want to build with Clang against Clang's standard C++ library (libc++), you'll need a version of Boost built with Clang and libc++. If you have one, then you can build with Clang by adding -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ to the CMake command and build against libc++ by adding -DBOOST_ROOT=ROOT_DIR_OF_YOUR_CLANG_BUILD_OF_BOOST and -DCMAKE_CXX_FLAGS="-stdlib=libc++".

To build against Clang's C++ library (libc++) rather than GCC's (libstdc++), you'll need a version of Boost built with Clang and libc++. If you have one, you can use a cmake command like:

$ cmake -DCMAKE_BUILD_TYPE=RELEASE -DBOOST_ROOT=/opt/boost_1_58_0_clang_build -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_CXX_FLAGS="-stdlib=libc++" ..

Running the Build Tests

Once you've built the binaries, run the build tests to sanity check the build. From the root directory of the project, run build-test and confirm that all tests pass.

(if you mistakenly run build-test from elsewhere, you'll get lots of check_required_files_exist errors).

If your machine has Perl, you can also try running the Perl tests (which includes a run of build-test as one of the tests):

  • Set the environment variable CATH_TOOLS_BIN_DIR to the location of the built binaries
  • From the root directory of the project, run prove -l -v t

Building on CentOS 7 Machines

Install these packages as root:

yum install bzip2-devel cmake git
yum install centos-release-scl-rh
yum install devtoolset-3-gcc devtoolset-3-gcc-c++

Then ssh to the build machine as yourself, find some working directory with at least a few Gb of free space, and then substitute it in for WHATEVER_YOU_HAVE_CHOSEN_AS_YOUR_BUILD_ROOT_DIRECTORY in these commands:


scl enable devtoolset-3 bash

Build Boost:

mkdir -p ${BUILD_ROOT_DIR}/boost_1_58_0_build/{include,lib}
wget ""
tar -zxvf boost_1_58_0.tar.gz
cd ${BUILD_ROOT_DIR}/boost_1_58_0/
./ --prefix=${BUILD_ROOT_DIR}/boost_1_58_0_build
./b2 -j2         --layout=tagged variant=release
./b2 -j2 install --layout=tagged variant=release

Build cath-tools:

git clone --recursive

mkdir -p ${BUILD_ROOT_DIR}/cath-tools/gcc_relwithdebinfo/
cd       ${BUILD_ROOT_DIR}/cath-tools/gcc_relwithdebinfo/
/usr/bin/cmake -DCMAKE_BUILD_TYPE=RELEASE -DBOOST_ROOT=${BUILD_ROOT_DIR}/boost_1_58_0_build ..
cd       ${BUILD_ROOT_DIR}/cath-tools/
make -C gcc_relwithdebinfo -k -j2
ls -l ${BUILD_ROOT_DIR}/cath-tools/gcc_relwithdebinfo/

For advance building options, see Developers.