Build and install CamiTK

Building CamiTK from source is very easy thanks to the power of CMake.

# set the installation directory (change to wherever you want)
export CAMITK_INSTALL_DIR="$(pwd)/install"
mkdir $CAMITK_INSTALL_DIR

# configure ($CAMITK_SOURCE_DIR is the CamiTK source code directory, see step 2)
cmake -S $CAMITK_SOURCE_DIR \
      -B build \
      -DCMAKE_INSTALL_PREFIX=$CAMITK_INSTALL_DIR \
      -DCEP_IMAGING=TRUE \
      -DCEP_MODELING=TRUE \
      -DCEP_TUTORIALS=TRUE \
      -DPYTHON_BINDING=TRUE 

# parallel build (with 6 parallel process, requires ~5Gb or RAM and 6+ cores)
cmake --build build --target install --parallel 6
How to fix: Could not find a package configuration file provided by 'pybind11'

On Debian 13 Trixie, Ubuntu 24.04 LTS - Noble Numbat and any Linux distributions derived from them, you need to install the following additional packages (see note “Additional packages required…” in the first step):

# Installing python binding requirements
sudo apt install libpython3-dev python3-dev python3-pip python3-venv pybind11-dev python3-pyside2.qtwidgets python3-vtk9
How to fix build freeze/out of memory during build

If you run out of memory or your system hanged during build, lower the number of parallel process.

In the line above, this can be done by replacing the 6 in --parallel 6 by an integer X, where X is a number lower that your number of CPU (with a margin) and where the amount of available RAM on your system divided by X is greater than 3 (to reserve a maximum 3Gb of RAM for each parallel process).

Check the installation

Type this in the terminal:

$CAMITK_INSTALL_DIR/bin/camitk-config --config

This should print details information about camitk version, the line Global Installation Directory is equal to $CAMITK_INSTALL_DIR (where you installed CamiTK).

Run camitk-imp

You can run camitk-imp by (double) clicking on the executable in your favorite file browser (in the bin directory) or by typing this in the terminal:

$CAMITK_INSTALL_DIR/bin/camitk-imp