Difference between revisions of "TubeTK/Build Instructions"

From KitwarePublic
Jump to navigationJump to search
Line 28: Line 28:
 
** http://msysgit.github.io/
 
** http://msysgit.github.io/
 
* Linux
 
* Linux
<em> sudo apt-get install git </em>
+
** > <code> sudo apt-get install git </code>
  
 
=== Boost ===
 
=== Boost ===
Line 37: Line 37:
 
Oddities
 
Oddities
 
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries.  Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.
 
* Linux: TubeTK creates dynamic libraries that have static links to Boost libraries.  Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.
<em> ./bootstrap.sh </em>
+
<code>  
<em> ./b2 cflags=-fPIC cxxflags=-fPIC link=static  </em>
+
./bootstrap.sh
<em> ./bjam cflags=-fPIC cxxflags=-fPIC </em>
+
./b2 cflags=-fPIC cxxflags=-fPIC link=static  
 +
  ./bjam cflags=-fPIC cxxflags=-fPIC
 +
</code>
  
 
=== Slicer (Required for Slicer-Dependent Build) ===
 
=== Slicer (Required for Slicer-Dependent Build) ===

Revision as of 20:56, 8 January 2015

Stand-Alone or Slicer-Dependent Builds

There are two ways in which TubeTK can be used:

  1. "Stand-Alone"
    • TubeTK can be built to produce a set of libraries and command-line programs that can be used to build other applications.
  2. "Slicer-Dependent"
    • TubeTK is built using an existing Slicer build, so that TubeTK's methods can be used from within Slicer.

Both build types are tested nightly on Windows, OS X, and Linux machines.

Both build process consists of the following steps

  • Install requirements and options
  • Download source
  • Configure using CMake
  • Build

Install Requirements and Options

CMake (Requirement)

Install the latest stable release.

GIT (Requirement)

Install the latest stable release.

Boost

Download and build Boost:

Oddities

  • Linux: TubeTK creates dynamic libraries that have static links to Boost libraries. Since Boost static libraries on Linux are not compiled with fPIC, you must compile Boost from source to use it with TubeTK.

./bootstrap.sh
./b2 cflags=-fPIC cxxflags=-fPIC link=static 
./bjam cflags=-fPIC cxxflags=-fPIC

Slicer (Required for Slicer-Dependent Build)

If you are building the Stand-Alone version of TubeTK, you should not build Slicer.

If you are building the Slicer-Dependent version of TubeTK, download and install the latest stable release of Slicer. You can use either binaries or compile from source.

Oddities

Download Source

Download the source via git

git clone https://github.com/KitwareMedical/TubeTK TubeTK

Configure

Create a directory, outside of the source directory, to hold the compilation

mkdir TubeTK-Release
cd TubeTK-Release

Within that compilation directory, run ccmake and point it to where the source is located

ccmake ../TubeTK

If you want to create the Slicer-Dependent version of TubeTK, set the following CMake variables

  • Build_TYPE = <same build type as Slicer installation: Debug or Release>
  • TubeTK_USE_SLICER = On
  • Slicer_DIR = <Path to your Slicer build directory>

Build

Windows

Load the TubeTK solution file in Visual Studio

  • 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

Build Using Slicer