Build and install CamiTK on Linux

How to build and install CamiTK on a Debian or derived distribution

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

Get the source code

You need to choose between:

Get CamiTK stable

The easiest way is to download the source code of CamiTK 5.2.0 from a terminal:

mkdir camitk-5.2.0
cd camitk-5.2.0
wget https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK/-/archive/5.2.0/CamiTK-5.2.0.tar.gz
tar xf CamiTK-5.2.0.tar.gz
export CAMITK_SOURCE_DIR=$(pwd)/CamiTK-5.2.0

Now jump directly to the build and install section.

Get CamiTK develop

To get CamiTK develop, you need to clone CamiTK from the develop branch from the git repository. The easiest way is to type the following from a bash shell:

mkdir camitk-develop
cd camitk-develop

git clone -b develop --single-branch https://gricad-gitlab.univ-grenoble-alpes.fr/CamiTK/CamiTK.git

export CAMITK_SOURCE_DIR=$(pwd)/CamiTK

Use git pull in the source $CAMITK_SOURCE_DIR directory to update this version every so often in order to get the most recent develop version. It usually provides the latest bug fixes and new features!

In case you plan to contribute to the project, we recommend to can create an account or connect to our gitlab instance, add an ssh key to your account and then use the git protocol:

git clone git@gricad-gitlab.univ-grenoble-alpes.fr:CamiTK/CamiTK.git
git checkout develop

Cloning this way makes it easier to test branches, create new collaborative branches, and submit merge requests.

Build and install

In the following commands, replace the x in the argument --parallel x by be your number of CPU minus 2.

mkdir build
cd build
cmake $CAMITK_SOURCE_DIR -DCEP_IMAGING=TRUE -DCEP_MODELING=TRUE -DCEP_TUTORIALS=TRUE -DCMAKE_INSTALL_PREFIX="/usr/local"
cmake --build . --parallel x --target install # replace x by your number of CPU minus 2
sudo make camitk-ce-global-install

CMAKE_INSTALL_PREFIX install prefix is the place where CamiTK is going to be installed. Here it is set to /usr/local, but you can change it to anywhere else (e.g. /opt/camitk).

Pro/Cons of installing in /usr/local:

  • The advantage is that it will be ready to use.
  • The disadvantage is that it will be a little bit more difficult to uninstall or remove it

Pro/Cons of installing in a specific directory such as /opt/camitk:

  • The advantage is that you will be able to uninstall / remove the version by simply removing the specific directory.
  • The disadvantage is that you will need to add the relative bin subdirectory to your PATH environment variable (e.g. PATH=$PATH:/opt/camitk/bin) and lib subdirectory to your LD_LIBRARY_PATH environment variable (e.g. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/camitk/lib).

Check the installation

Type from a shell:

camitk-config --config

This should print details information about camitk version, where camitk is looking for extensions (aka the extension repository), and the default installed extensions.

You can also run the camitk-imp the same way.

Where should I go next?

Start your development with CamiTK!