TubeTK/Build Instructions: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
Line 21: Line 21:
** Subsequent builds should be initiated in the subdir tubetk-Release/TubeTK-Build to save time
** Subsequent builds should be initiated in the subdir tubetk-Release/TubeTK-Build to save time


= Alternative (more complex) Procedure =
= Inside TubeTK =


These instructions assume expertise in CMake, ITK, and software compilation in general.
* As noted above, TubeTK uses CMake's Superbuild include other libraries, as needed for the options selected.
 
* Libraries that may be automatically downloaded and included by TubeTK include:
== Install pre-requisites  ==  
** ITK
 
** VTK
=== ITK ===
** Select tools from the NA-MIC Kit:
 
*** TCLAP, GenerateCLP, ModuleDescriptionParser, RegisterImages
* Build ITKv3.20.0 using the following cmake vars
* Libraries that must be externally installed if you want to use them with TubeTK
** You MUST checkout the v3.20.0 tag of ITK.  ITKv4 will not work.
** CMake (2.8.2 or greater - REQUIRED)
 
** Qt (4.6.2 or greater - OPTIONAL)= Alternative (more complex) Procedure =
BUILD_SHARED_LIBS = OFF (or ON, but libs are VERY small in ITK because of templates)
* You can manually install the above toolkits and then configure TubeTK to use those installations instead of building its own copies of those toolkits, BUT we don't recommend heading down that road.
ITK_USE_LIBXML2 = ON
** Requires CMake expertise
ITK_USE_REVIEW = ON
** Requires making sure each of the toolkits is correctly configured (via their own cmake configuration processes) for use with TubeTK.
ITK_USE_OPTIMIZED_REGISTRATION_METHODS = ON
** If you still want to try this complex, manual approach, the following steps will help somewhat:
ITK_USE_TRANSFORM_IO_FACTORIES = ON
**# Build ITK v3.20.0 using the following cmake vars
CMAKE_CXX_FLAGS = -fPIC
**#* BUILD_SHARED_LIBS = OFF (or ON, but libs are VERY small in ITK because of templates)
CMAKE_C_FLAGS = -fPIC
**#* ITK_USE_LIBXML2 = ON
 
**#* ITK_USE_REVIEW = ON
The last two (adding -fPIC to both c and cxx flags) can be ignored if you build with shared libs ON.
**#* ITK_USE_OPTIMIZED_REGISTRATION_METHODS = ON
 
**#* ITK_USE_TRANSFORM_IO_FACTORIES = ON
=== Qt 4.6 ===
**#* CMAKE_CXX_FLAGS = -fPIC
 
**#* CMAKE_C_FLAGS = -fPIC
* Tips for installing Open Source Qt to run with Visual Studio
**#** adding -fPIC to both c and cxx flags can be ignored if you build with shared libs ON.
*# Open a visual studio command shell.
**# Build Qt 4.6.2 or greater
*# Go to the Qt source directory and run "configure -platform win32-msvc2005". This will tell Qt to prepare itself for being compiled by the Visual Studio compiler. If you use another version of VS than 2005, replace win32-msvc-2005 with the appropriate one.
**#* Tips for installing Open Source Qt to run with Visual Studio
*# Type "nmake" and take a break when it compiles.
**#*# Open a visual studio command shell.
*# Add QMAKESPEC=win32-msvc2005 as a system environment variable and add QTDIR=your_dir into the system path. It is done.
**#*# Go to the Qt source directory and run "configure -platform win32-msvc2005". This will tell Qt to prepare itself for being compiled by the Visual Studio compiler. If you use another version of VS than 2005, replace win32-msvc-2005 with the appropriate one.
* Tips for installing Qt on Linux
**#*# Type "nmake" and take a break when it compiles.
*# apt-get qt4
**#*# Add QMAKESPEC=win32-msvc2005 as a system environment variable and add QTDIR=your_dir into the system path. It is done.
 
**#* Tips for installing Qt on Linux
=== VTK (future requirement) ===
**#*# apt-get qt4
 
**# Build VTK v5.X using the following cmake vars
BUILD_SHARED_LIBS = ON
**#* BUILD_SHARED_LIBS = ON
VTK_USE_GUISupport = ON
**#* VTK_USE_GUISupport = ON
VTK_USE_QVTK
**#* VTK_USE_QVTK


= Optional (rigorous) Compilation Options =
= Optional (rigorous) Compilation Options =

Revision as of 20:35, 7 November 2010

Recommended Build Procedure

  • Install CMake
  • Download TubeTK via git
  • Configure the build using CMake
    • mkdir tubetk-Release
    • cd tubetk-Release
    • ccmake ../tubetk
    • Confirm the following CMake variables
      • TubeTK_USE_SUPERBUILD should be ON
        • If "ON", then cmake will fetch and compile TCLAP, ModuleDescriptionParser, and GenerateCLP from the Slicer3 svn repository.
      • TubeTK_SUPERBUILD_ITK should be ON
        • If "ON", then cmake will fetch and compile ITK as part of the build process.
        • If "OFF", then you will need to specify the path to ITK-Release in the CMake var ITK_DIR
      • TubeTK_USE_QT should be OFF
        • If you have Qt 4.6.3 or greater installed, you can turn it on.
    • Generate the build files by pressing "generate" in cmake
    • Perform initial build using your compiler at the top-level of tubetk-Release
    • Subsequent builds should be initiated in the subdir tubetk-Release/TubeTK-Build to save time

Inside TubeTK

  • As noted above, TubeTK uses CMake's Superbuild include other libraries, as needed for the options selected.
  • Libraries that may be automatically downloaded and included by TubeTK include:
    • ITK
    • VTK
    • Select tools from the NA-MIC Kit:
      • TCLAP, GenerateCLP, ModuleDescriptionParser, RegisterImages
  • Libraries that must be externally installed if you want to use them with TubeTK
    • CMake (2.8.2 or greater - REQUIRED)
    • Qt (4.6.2 or greater - OPTIONAL)= Alternative (more complex) Procedure =
  • You can manually install the above toolkits and then configure TubeTK to use those installations instead of building its own copies of those toolkits, BUT we don't recommend heading down that road.
    • Requires CMake expertise
    • Requires making sure each of the toolkits is correctly configured (via their own cmake configuration processes) for use with TubeTK.
    • If you still want to try this complex, manual approach, the following steps will help somewhat:
      1. Build ITK v3.20.0 using the following cmake vars
        • BUILD_SHARED_LIBS = OFF (or ON, but libs are VERY small in ITK because of templates)
        • ITK_USE_LIBXML2 = ON
        • ITK_USE_REVIEW = ON
        • ITK_USE_OPTIMIZED_REGISTRATION_METHODS = ON
        • ITK_USE_TRANSFORM_IO_FACTORIES = ON
        • CMAKE_CXX_FLAGS = -fPIC
        • CMAKE_C_FLAGS = -fPIC
          • adding -fPIC to both c and cxx flags can be ignored if you build with shared libs ON.
      2. Build Qt 4.6.2 or greater
        • Tips for installing Open Source Qt to run with Visual Studio
          1. Open a visual studio command shell.
          2. Go to the Qt source directory and run "configure -platform win32-msvc2005". This will tell Qt to prepare itself for being compiled by the Visual Studio compiler. If you use another version of VS than 2005, replace win32-msvc-2005 with the appropriate one.
          3. Type "nmake" and take a break when it compiles.
          4. Add QMAKESPEC=win32-msvc2005 as a system environment variable and add QTDIR=your_dir into the system path. It is done.
        • Tips for installing Qt on Linux
          1. apt-get qt4
      3. Build VTK v5.X using the following cmake vars
        • BUILD_SHARED_LIBS = ON
        • VTK_USE_GUISupport = ON
        • VTK_USE_QVTK

Optional (rigorous) Compilation Options

References

  • Superbuild and EXTERNAL_PROJECTS
    • Dave Cole's article in the October Kitware Source [1]