TubeTK/Build Instructions: Difference between revisions
From KitwarePublic
< TubeTK
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
= | = Recommended Build Procedure = | ||
== | * Install CMake | ||
** http://cmake.org | |||
* Download TubeTK via git | |||
** git clone git://gitorious.org/tubetk/tubetk.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 <b>ITK_DIR</b> | |||
*** 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 | |||
= Alternative (more complex) Procedure = | |||
These instructions assume expertise in CMake, ITK, and software compilation in general. | |||
== Install pre-requisites == | |||
=== ITK === | === ITK === | ||
* Build ITKv3.20.0 using the following cmake vars | |||
** You MUST checkout the v3.20.0 tag of ITK. ITKv4 will not work. | |||
BUILD_SHARED_LIBS = OFF (or ON, but libs are VERY small in ITK because of templates) | BUILD_SHARED_LIBS = OFF (or ON, but libs are VERY small in ITK because of templates) | ||
Line 16: | Line 41: | ||
The last two (adding -fPIC to both c and cxx flags) can be ignored if you build with shared libs ON. | The last two (adding -fPIC to both c and cxx flags) can be ignored if you build with shared libs ON. | ||
=== Qt 4.6 === | === Qt 4.6 === | ||
Line 29: | Line 52: | ||
*# apt-get qt4 | *# apt-get qt4 | ||
=== VTK === | === VTK (future requirement) === | ||
BUILD_SHARED_LIBS = ON | BUILD_SHARED_LIBS = ON | ||
VTK_USE_GUISupport = ON | VTK_USE_GUISupport = ON | ||
VTK_USE_QVTK | VTK_USE_QVTK | ||
= | = Recommended Compilation Options = | ||
* For Linux developers (and Linux dashboard machines) we recommend: | * For Linux developers (and Linux dashboard machines) we recommend: | ||
** CMAKE_CXX_FLAGS:STRING=-W -Wall -Wextra -Wshadow -Wno-system-headers -Wwrite-strings -Wno-deprecated -Woverloaded-virtual -Weffc++ | ** CMAKE_CXX_FLAGS:STRING=-W -Wall -Wextra -Wshadow -Wno-system-headers -Wwrite-strings -Wno-deprecated -Woverloaded-virtual -Weffc++ | ||
*** The -Weffc++ option might be over-kill, but I'd like to try it at first... | *** The -Weffc++ option might be over-kill, but I'd like to try it at first... | ||
** CMAKE_C_FLAGS:STRING=-W -Wall -Wextra -Wshadow -Wno-system-headers -Wwrite-strings | ** CMAKE_C_FLAGS:STRING=-W -Wall -Wextra -Wshadow -Wno-system-headers -Wwrite-strings | ||
* A summary of warning options for gcc and g++ are given at: | |||
** http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html | |||
** http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/C_002b_002b-Dialect-Options.html | |||
= References = | = References = | ||
* Superbuild and EXTERNAL_PROJECTS | * Superbuild and EXTERNAL_PROJECTS | ||
** Dave Cole's article in the October Kitware Source [http://www.kitware.com/products/archive/kitware_quarterly1009.pdf] | ** Dave Cole's article in the October Kitware Source [http://www.kitware.com/products/archive/kitware_quarterly1009.pdf] | ||
Revision as of 16:43, 2 September 2010
Recommended Build Procedure
- Install CMake
- Download TubeTK via git
- git clone git://gitorious.org/tubetk/tubetk.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.
- TubeTK_USE_SUPERBUILD should be 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
Alternative (more complex) Procedure
These instructions assume expertise in CMake, ITK, and software compilation in general.
Install pre-requisites
ITK
- Build ITKv3.20.0 using the following cmake vars
- You MUST checkout the v3.20.0 tag of ITK. ITKv4 will not work.
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
The last two (adding -fPIC to both c and cxx flags) can be ignored if you build with shared libs ON.
Qt 4.6
- Tips for installing Open Source Qt to run with Visual Studio
- Open a visual studio command shell.
- 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.
- Type "nmake" and take a break when it compiles.
- 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
- apt-get qt4
VTK (future requirement)
BUILD_SHARED_LIBS = ON VTK_USE_GUISupport = ON VTK_USE_QVTK
Recommended Compilation Options
- For Linux developers (and Linux dashboard machines) we recommend:
- CMAKE_CXX_FLAGS:STRING=-W -Wall -Wextra -Wshadow -Wno-system-headers -Wwrite-strings -Wno-deprecated -Woverloaded-virtual -Weffc++
- The -Weffc++ option might be over-kill, but I'd like to try it at first...
- CMAKE_C_FLAGS:STRING=-W -Wall -Wextra -Wshadow -Wno-system-headers -Wwrite-strings
- CMAKE_CXX_FLAGS:STRING=-W -Wall -Wextra -Wshadow -Wno-system-headers -Wwrite-strings -Wno-deprecated -Woverloaded-virtual -Weffc++
- A summary of warning options for gcc and g++ are given at:
References
- Superbuild and EXTERNAL_PROJECTS
- Dave Cole's article in the October Kitware Source [1]