TubeTK/Build Instructions: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
Line 24: Line 24:


* Slicer
* Slicer
** Bug in Slicer v4.4.0
***  https://github.com/Slicer/Slicer/pull/189/files
* Boost
* Boost
** Bug in Boost binaries.  You must compile from source, with -fPIC enabled
*** http://www.boost.org/


== Resolving Recommendations ==
== Resolving Recommendations ==


=== Slicer ===


Note: For Red Hat Enterprise Linux, first enable [https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F Extra Packages for Enterprise Linux (EPEL)].
Download and install the latest stable release of Slicer.  You can use either binaries or compile from source.
* Source: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Build_Instructions
* Binaries: http://download.slicer.org/


Note: For Red Hat Enterprise Linux, first enable [https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F Extra Packages for Enterprise Linux (EPEL)].
Oddities
* There is a bug in Slicer v4.4.0 that prevents it from compiling on OSX 10.9.  The simple fix is pending integration into Master.  You can apply it manually.  See https://github.com/Slicer/Slicer/pull/189/files
 
=== Boost ===
 
Download and build Boost:
* http://www.boost.org/
 
Oddities
* We do not recommend the pre-built versions of Boost on most modern platforms.  Most binary distributions don't support 64bit builds.  You should build with appropriate options, such as:
./bootstrap.sh --prefix=/usr/local/boost-1_57
sudo ./b2 address-model=64 cflags=-fPIC cxxflags="-fPIC -std=c++11" link=static install


= Download, Configure, and Build =
= Download, Configure, and Build =

Revision as of 00:24, 9 January 2015

Overview

TubeTK has been tested on Windows, OS X, and Linux.

  • Process
    • Install dependencies
    • Download source
    • Configure using CMake
    • Build

Requirements

Resolving Requirements

  • Fedora:
sudo yum install cmake git gcc-c++ jsoncpp-devel make mesa-libGL-devel
  • Red Hat Enterprise Linux:
sudo yum install cmake28 devtoolset-1.1-gcc-c++ git make mesa-libGL-devel
  • Ubuntu:
sudo apt-get install cmake git g++ libgl1-mesa-dev libjsoncpp-dev make

Recommendations

  • Slicer
  • Boost

Resolving Recommendations

Slicer

Download and install the latest stable release of Slicer. You can use either binaries or compile from source.

Oddities

Boost

Download and build Boost:

Oddities

  • We do not recommend the pre-built versions of Boost on most modern platforms. Most binary distributions don't support 64bit builds. You should build with appropriate options, such as:
./bootstrap.sh --prefix=/usr/local/boost-1_57
sudo ./b2 address-model=64 cflags=-fPIC cxxflags="-fPIC -std=c++11" link=static install

Download, Configure, and Build

You have two options:

1. Download, configure, and build manually

1a. Clone the Git repository

Windows, Linux, and OS X: Command-line Option

cd <where you want the top-level source directory to be>
git clone https://github.com/TubeTK/TubeTK TubeTK

Windows, Linux, and OS X: Using the GitHub gui

Follow the directions for cloning a repo to your machine

  • On the right side of the page, you'll find a button to "Clone in Desktop". Click this.
  • The GitHub app will open.
  • Log in if it asks you to, and specify a convenient location on your computer for the project folder.

1b. Configure

mkdir TubeTK-Release
cd TubeTK-Release
ccmake ../TubeTK

1c. Build

Windows

Microsoft Visual Studio

  • Load the TubeTK solution file
    • Select File -> Open -> Project/Solution -> open TubeTK-Release/TubeTK.sln
  • Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.
    • Right click on the "ALL_BUILD" project and select "Build".
  • Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.
    • Right click on the "TubeTK" project and select "Build".

Linux and OS X

  • Perform the initial build using your compiler at the top-level of TubeTK-Release. This will update and build the libraries that TubeTK depends on (ex. VTK, ITK), and then build TubeTK.
cd $HOME/TubeTK-Release
make
  • Subsequent builds should be initiated in the subdir TubeTK-Release/TubeTK-build to save time. This will build TubeTK only. You may have to periodically build from the top-level of TubeTK-Release to get updates to the libraries that TubeTK depends on.
cd $HOME/TubeTK-Release/TubeTK-build
make

2. Dashboard Testing


3. Have CTest do all of the work



THIS METHOD IS NOT WORKING AT THIS TIME - WE NEED TO UPDATE THE BUILD FILES MENTIONED BELOW.

SORRY FOR THE INCONVENIENCE - PLEASE USE THE MANUAL BUILD METHOD DESCRIBED ABOVE

This is the recommended approach for people who will be using and developing in TubeTK. It not only builds and tests TubeTK with minimal effort, but it also submits your build as an "experimental" on the TubeTK dashboard - this allows us to more easily help you debug errors during the build process:

  • Download a ctest configuration file for TubeTK
Linux: TubeTK_InitialBuild_Linux.cmake
OS X:TubeTK_InitialBuild_Mac.cmake
Windows: TubeTK_InitialBuild_Windows.cmake
  • Edit it to match your environment
    • Only the variables in the first portion of the file should be edited. They are clearly marked and self explanatory. Additional details are at TubeTK/Dashboard Scripts.
  • Run ctest and submit an experimental dashboard
Fedora and Ubuntu:
ctest -S TubeTK_InitialBuild_Linux.cmake
Red Hat Enterprise Linux:
ctest28 -S TubeTK_InitialBuild_Linux.cmake
OS X:
ctest -S TubeTK_InitialBuild_Mac.cmake
Windows:
ctest -S TubeTK_InitialBuild_Windows.cmake
This will download the source code, configure it, build it, test it, and then submit the results to the TubeTK Dashboard.

Advanced

Using KWStyle

For introductory information, see: http://public.kitware.com/KWStyle/.

 git clone http://public.kitware.com/KWStyle.git $HOME/KWStyle
 mkdir $HOME/KWStyle-Release
 cd $HOME/KWStyle-Release
 cmake -DCMAKE_BUILD_TYPE=Release ../KWStyle
 make
 sudo make install
 cd $HOME/TubeTK-Release
 cmake -DTubeTK_USE_KWSTYLE=ON -DKWSTYLE_EXECUTABLE=/usr/local/bin/KWStyle .
 make
 make StyleCheck

Using a pre-existing ITK, JsonCpp, or VTK installation

You can also configure CMake variables to use an existing JsonCpp installation instead of an embedded version.

cd $HOME/TubeTK-Release
cmake -DUSE_SYSTEM_JSONCPP .

You can also configure CMake variables to use an existing ITK or VTK installation instead of an embedded versions. This is not recommended, because of inter-dependencies that require specific version of these libraries, and built using specific options, to be used.

  • USE_SYSTEM_ITK: OFF
    • If "ON", then you can tell TubeTK to use an ITK build that is already present on your system (using the CMake variable ITK_DIR).
  • USE_SYSTEM_VTK: OFF
    • If "ON", then you can tell TubeTK to use a VTK build that is already present on your system (using the CMake variable VTK_DIR). See the warning below.
  • Dependency on VTK version and build options
    • Note that TubeTK relies on VTK from 3D Slicer (https://github.com/Slicer/VTK)
    • The 3D Slicer fork of VTK contains enhancements that have not yet made it into the VTK repository itself.