Build Heimdali in development mode

Development mode means building Heimdali from its source code, typically the develop branch of heimdali Git repository.

Working in development mode consists in iterating in the cycle:

  • Modify source code.
  • Build.
  • Run the test.

without having to run the make install step.

Note

You may want to use ccache to speed-up compilation.

Install dependencies

Create a conda enviromnent named heimdali-dev containing all dependencies:

conda config --add channels http://conda.binstar.org/heimdali
conda create -n heimdali-dev h5unixpipe itk-heimdali-dbg libinrimage-dbg tclap cmake pip

Note

As cmake executable is in the conda environment, it will automatically find dependant libraries provided by the conda environment . So using -DCMAKE_PREFIX_PATH=/path/to/conda/env is not required.

Warning

Do not install the heimdali package in the heimdali-dev environment, as it would conflicts with sources files (from your heimdali git repository) you are building.

Activate the conda environment:

source activate heimdali-dev
hash -r

Install lettuce:

pip install lettuce

Get test datas

Get Heimdali data files:

git clone https://github.com/heimdali/heimdali-data

Define directories

For convenience, define these 3 directories:

Variable Description
HEIMDALI_SRC_DIR
Heimdali sources (git repo), containing the
main CMakeLists.txt
HEIMDALI_DATA_DIR
Heimdali data directory (heimdali-data git repo
cloned above)
HEIMDALI_WORK_DIR
Directory for temporary files (building sources,
building examples, running tests).

For example:

cd heimdali
export HEIMDALI_SRC_DIR=$PWD

cd heimdali-data
export HEIMDALI_DATA_DIR=$PWD

export HEIMDALI_WORK_DIR=/path/to/<heimdali-work-dir>

Note

It may be useful to have HEIMDALI_SRC_DIR and HEIMDALI_WORK_DIR if different locations. A typical example is having HEIMDALI_SRC_DIR on a backed-up NAS file system, while HEIMDALI_WORK_DIR on a local hard disk for speed read/write operations.

Warning

The conda environment must be activated and these 3 variables must be defined for the sections bellow.

Build Heimdali

On Mac OS X your will need to install /Developer/SDKs/MacOSX10.6, and use it:

export MACOSX_DEPLOYMENT_TARGET=10.6

Build heidmali:

mkdir -p $HEIMDALI_WORK_DIR/build_debug/src
cd $HEIMDALI_WORK_DIR/build_debug/src
cmake -DCMAKE_BUILD_TYPE=Debug $HEIMDALI_SRC_DIR
make -j 4

Configure examples

Heimdali has been built in HEIMDALI_WORK_DIR/build_debug/src and is not installed (development mode), we need to specified Heimdali path to cmake.

for example in create_input_image inrimage_read inrimage_write
do
    mkdir -p $HEIMDALI_WORK_DIR/build_debug/$example
    cd $HEIMDALI_WORK_DIR/build_debug/$example
    cmake \
        -DCMAKE_BUILD_TYPE=Debug \
        -DHEIMDALI_DIR=$HEIMDALI_WORK_DIR/build_debug/src \
        $HEIMDALI_SRC_DIR/example/$example
done

Example are built latter by lettuce.

Run functional tests

Add path to the built executables:

export PATH=$HEIMDALI_WORK_DIR/build_debug/src/cmd:$PATH

Run the functional tests:

cd $HEIMDALI_SRC_DIR/tests
lettuce

Other CMake usefull variables

Variable Description
CMAKE_PREFIX_PATH
Where CMake will search for dependent
libraries.
CMAKE_INSTALL_PREFIX
Where CMake will install things during
make install.

Dependencies

Here is a summary of Heimdali dependencies, if you want to apply modifications on it:

sources or homepage conda recipe
heimdali heimdali recipe
itk-heimdali itk-heimdali recipe
tclap tclap recipe
h5unixpipe h5unixpipe recipe
libinrimage libinrimage recipe

Conda packages are hosted on binstar heimdali channel.