} ContributingBuilds
ITK-SNAP Logo

Latest News:
04/22/24: ITK-SNAP 4.2.0 has been released!

Contributing Builds to the ITK-SNAP Dashboard

If you build ITK-SNAP, we urge you to contribute your build results to the ITK-SNAP dashboard. It is easy to do using the scripts that we provide in the Git module cdash.

Getting started

Whichever platform you are using, you will need to have CMake, and a working build of ITK, VTK and FLTK (or Qt for ITK-SNAP 3.x). See the build documentation for information on which versions of these packages you need. You will also need Git for your platform. On Windows systems, you may want to install Cygwin.

CTest Scripts

The script for initiating a nightly or experimental build is build_robot.cmake. This script is invoked with the CMake command ctest, with five command-line arguments, as described below.

# This script is used to automate building of nightly and experimental ITK-SNAP
# binaries on various platforms. The script must be invoked with ctest (from CMake)
# with parameters specifying the build machine, the build configuration, and the 
# git branch of ITK-SNAP to be executed.
#
# Example Usage:
#
# ctest -V -S build_robot.cmake,itksnap,master,Nightly,paulyimac_MacOS,gcc64rel
#
# Explanation of parameters:
#
#    itksnap          The name of the product to build (typically itksnap)
#    master           The name of the GIT branch to build on
#    Nightly          Type of Dashboard build to perform (Nightly,Experimental)
#    paulyimac_MacOS  The name of the site where the build is being run. The
#                     site can be a computer or a virtual machine on a computer.
#                     The sites directory must contain a corresponding script
#                     (e.g., paulyimac_MacOS.cmake) with site-specific config.
#    gcc64rel         The build configuration (compiler, 32 or 64 bits, release
#                     or debug, etc.). This can be machine specific and is used
#                     to tell the build script what to do.
#
# What the script will do
# 
#    The script will create a source directory and a build directory. It will check
#    out (or update) code in the source directory, and configure CMake and build in
#    the build directory. It will send the results of the build to the ITK-SNAP
#    Dashboard, located at itksnap.org/cdash

You will need to make a copy of one of the scripts in the sites directory and edit it to reflect the locations of the different tools and packages on your system. Here we take a look at one of these files, picslbuild.cmake, which is used on one of our 64 bit CentOS machines. Let us go through the script step by step.

SET(ROOT "/mnt/build/pauly/buildbot")

Here we specify the root directory on the build machine where the nightly and experimental builds will take place. Running the script build-robot.cmake will generate subdirectories in this root directory.

SET(CTEST_SITE "picslbuild")
SET(CTEST_BUILD_NAME "CentOS-5.3-${IN_CONFIG}")

Here we set the name of the build machine (as it will appear in the Dashboard) and the name of the build. Notice that the build name uses the variable IN_CONFIG, which is the build configuration argument passed to the parent script build-robot.cmake.

SET(GIT_BINARY /usr/local/bin/git)
SET(GIT_UID pyushkevich)

This configures Git. If you are not a ITK-SNAP developer, you will need to set GIT_UID to blank. If you are a developer, set it to your sourceforge.net username.

SET(TKDIR "/mnt/build/pauly")

Here we specify the parent directory for ITK, VTK, and FLTK libraries. This is helpful because on our system these libraries are all in one parent folder. This variable is not needed by the parent script so you don't have to define it.

IF(${IN_CONFIG} MATCHES gcc64rel)

  SET(FLTK13 "${TKDIR}/fltk13/install_gcc64/lib/libfltk.a")
  SET(CFLAGS "-fno-strict-aliasing")

ELSEIF(${IN_CONFIG} MATCHES icc64rel)

  SET(FLTK13 "${TKDIR}/fltk13/install_icc64/lib/libfltk.a")
  SET(CFLAGS "-wd1268 -wd1224 -wd858")

  ENV_ADD(CC "/opt/intel/cce/10.1.018/bin/icc")
  ENV_ADD(CXX "/opt/intel/cce/10.1.018/bin/icpc")
  ENV_ADD(LD_LIBRARY_PATH "/opt/intel/cce/10.1.018/lib")

ELSE(${IN_CONFIG} MATCHES gcc64rel)

  MESSAGE(FATAL_ERROR "Unknown configuration ${IN_CONFIG}")

ENDIF(${IN_CONFIG} MATCHES gcc64rel)

Here we set some configuration-specific options and environment variables. On this machine, there are two possible configurations: gcc64rel (GCC compiler, 64 bit, release mode) and icc64rel (Intel compiler, 64 bit, release mode). Notice the ENV_ADD macro (defined in include/macros.cmake). It adds variables to the environment in which cmake will be run.

CACHE_ADD("MAKECOMMAND:STRING=/usr/bin/make -i -j 6")
CACHE_ADD("CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make")
CACHE_ADD("CMAKE_BUILD_TYPE:STRING=Release")
CACHE_ADD("CMAKE_C_FLAGS:STRING=${CFLAGS}")
CACHE_ADD("CMAKE_CXX_FLAGS:STRING=${CFLAGS}")
CACHE_ADD("ITK_DIR:PATH=${TKDIR}/itk320/${IN_CONFIG}")
CACHE_ADD("VTK_DIR:PATH=${TKDIR}/vtk580/${IN_CONFIG}" BRANCH "qtsnap.*")
CACHE_ADD("VTK_DIR:PATH=${TKDIR}/vtk561/${IN_CONFIG}" BRANCH "master")
CACHE_ADD("QT_QMAKE_EXECUTABLE:FILEPATH=${TK_DIR}/Qt/qt-everywhere-opensource-src-4.7.4/bin/qmake" BRANCH "qtsnap.*")
CACHE_ADD("FLTK_BASE_LIBRARY:FILEPATH=${FLTK13}" BRANCH "master")
#CACHE_ADD("SNAP_USE_FLTK_PNG:BOOL=ON" BRANCH "master")
#CACHE_ADD("SNAP_USE_FLTK_JPEG:BOOL=ON" BRANCH "master")

Finally, we configure the initial cache for the ITK-SNAP build. This is done using the 'CACHE_ADD macro. Notice that the macro can be used to specify that a string is only added to the cache under certain conditions (e.g., if the Git branch is master). This conditional syntax is useful to reduce the number of IF/ELSE statements in the script.

Note - For Windows

  • Please install NSIS (Nullsoft Scriptable Install System) from
http://sourceforge.net/projects/nsis/files/latest/download?source=files
Page last modified on October 04, 2012, at 11:33 AM

    SourceForge.net Logo   Valid XHTML 1.0 Transitional