Build instructions Linux - neutronimaging/imagingsuite GitHub Wiki

Prerequisites

Install the build environment and libraries described on prerequisites

Anaconda dependencies

These dependencies are needed to use the python bindings.

conda install cmake ninja pybind11

Environment variables

Set the environment variables on Linux using the ~/.bashrc file

  • WORKSPACE to the location of your git root folder e.g. ~/git
  • QTBINPATH to the bin folder of your Qt installation

These variables will be used by build and deployment scripts to find build tools for the used Qt distribution. By using this variable there is no need to locally modify the build scripts.

Building

Create folder structure

Navigate to the repos root <WORKSPACE> and create the folders needed for build and deployment.

cd <WORKSPACE>
mkdir build-imagingsuite install deployed
cd build-imagingsuite

Start the build

The imaging suite is built using cmake for the build configuration. This is a tool that can be installed separately, but here we will use the cmake provided by Qt. This has the advantage that Qt dependencies are found automatically during the build. The first step is to configure the build by referencing the CMakeLists.txt file in the root of the imagingsuite folder: ~/Qt/Tools/CMake/bin/cmake ../imagingsuite/ -DCMAKE_INSTALL_PREFIX=../install -DPYTHON_LIBRARY=<anaconda path>/anaconda3/lib/libpython3.9m.so -DPYTHON_INCLUDE_DIR=<anaconda path>/anaconda3/include/python3.9 -DPYTHON_EXECUTABLE=<anaconda path>/anaconda3/bin/python -DCMAKE_PREFIX_PATH=~/Qt/6.2.4/gcc_64 -G="Ninja"

Here, we used ninja as build tool. This is a much faster build tool than the default make.

  • You may have different python version installed. In this case you have to adapt the python version.
  • The Qt version must be updated to your version.

Once the configuration finishes successfully we are ready to start the build

cmake --build . --config Release --target install

The resulting build artifacts are now copied to the folder <WORKSPACE>/install

Deployment

The cmake-build creates the binaries for the application and they're supporting libraries, but they can't be used as built. First you have to run a deployment script that copies additional dependencies and creates the correct paths for each lib and application. The muhrec deployment script is located in

<WORKSPACE>/imagingsuite/deploy/linux/deploymuhrec_ubuntu_withQT.sh

and for the python bindings:

<WORKSPACE>/imagingsuite/deploy/linux/deploy_pythonbindings_ubuntu.sh
⚠️ **GitHub.com Fallback** ⚠️