VTK/Configure and Build: Difference between revisions
No edit summary |
No edit summary |
||
Line 38: | Line 38: | ||
</pre> | </pre> | ||
* Now you have the directory '''$HOME/software/cmake-2.8. | * Now you have the directory '''$HOME/software/cmake-2.8.12.2-Linux-i386/bin''', and inside there are executables '''cmake''' and '''ccmake'''. | ||
* You can also install CMake in the '''/usr/local''' or '''/opt''' by | * You can also install CMake in the '''/usr/local''' or '''/opt''' by untarring and copying sub-directories. The rest of the instructions will assume the executables are in your '''$PATH'''. | ||
</div> | </div> | ||
Line 174: | Line 174: | ||
** If it is a string, it will become an editable string. | ** If it is a string, it will become an editable string. | ||
</div> | </div> | ||
|} | |||
===VTK Settings=== | |||
{| border="0" cellpadding="4" cellspacing="4" | |||
|- | |||
| bgcolor="#abcdef" height="8" | '''Variable''' | |||
| bgcolor="#abcdef" height="8" | '''Description''' | |||
|- | |||
| BUILD_SHARED_LIBS || If ON, use shared libraries. This way executables are smaller, but you have to make sure the shared libraries are on every system on the cluster. This option should be set to ON if you plan on using plugins for ParaView (there ways to use plugins in static builds of ParaView for advanced users). | |||
|- | |||
| BUILD_DOCUMENTATION || If ON, build the documentation target, DoxygenDoc | |||
|- | |||
| BUILD_TESTING || If ON, build the tests for submission to dashboards, or just run them locally with ctest -A | |||
|- | |||
| CMAKE_BUILD_TYPE || Should be Release or Debug. If Debug, build with debug symbols. This will run more slowly, but will be more useful if you plan to use a debugger. | |||
|- | |||
| CMAKE_INSTALL_PREFIX || Specifies where make should put the libraries when the make install command is run. | |||
|- | |||
| TODO || Put the rest of the prominent variables here | |||
|- | |||
| QT_QMAKE_EXECUTABLE || Path to Qt's qmake executable (such as /usr/local/bin/qmake). CMake uses this to locate the rest of the required Qt executables, headers and libraries. | |||
|} | |} |
Revision as of 19:13, 30 April 2014
Introduction
Hello! Welcome to the wiki.
This page is applicable for VTK 6.0 and above. For earlier versions, refer to a deprecated version of this document.
This page describes how to configure and build VTK, with several popular options turned on.
Prerequisites
- The VTK build process requires CMake version 2.8.8 or higher and a working compiler. On Unix-like operating systems, it also requires Make, while on Windows it requires Visual Studio (8 or later).
- Building VTK with Qt is a common use case for the creation of nice user interfaces. Using Qt 4.8.* is recommended, but earlier versions and Qt 5.* are in various stages of support. Visit the Qt download page to get a copy of the source code or installer. Either the LGPL or commercial versions of Qt may be used.
Download And Install CMake
CMake is a tool that makes cross-platform building simple. If CMake does not exist on the system, and there are no pre-compiled binaries, use the instructions below on how to build it. Use the most recent source or binary version of CMake from the CMake web site.
Using Binaries
There are several precompiled binaries available at the CMake download page.
On Unix-like operating systemsLet's say on Linux, download the appropriate version and follow these instructions: cd $HOME wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2-Linux-i386.tar.gz mkdir software cd software tar xvfz ../cmake-2.8.12.2-Linux-i386.tar.gz
|
On Windows
On Windows, if you are not administrator
|
Build Your Own CMake
On Unix-like operating systemsDownload the source code: http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz cd $HOME wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz tar xzf cmake-2.8.12.2.tar.gz cd cmake-2.8.12.2 ./configure --prefix=$HOME/software make make install
|
On WindowsTo build CMake on windows, a previous version of CMake is required. This can be downloaded from the Cmake download page: [1]. |
Download VTK Source code
Download a Release
Download a VTK release from the VTK Downloads page.
Checkout the VTK Repository with Git
If you want the nightly updates of VTK, this is your best bet. Checking out from source control also greatly facilitates the process of contributing back. Note that you may need to download and install a git client, here: [2]
On Unix-like operating systemsPrepare directory for download # mkdir $HOME/projects # cd $HOME/projects To download the source code # git clone git://vtk.org/VTK.git # cd VTK To update the code # git fetch origin # git rebase origin/master |
On WindowsWe recommend msysgit. msysgit provides an msys shell that has the appropriate environment set up for using git and its tools. |
Configure VTK with CMake
- Always use a separate build directory. Do not build in the source directory.
On Unix-like systems
mkdir $HOME/projects/VTK-build cd $HOME/projects/VTK-build ccmake $HOME/projects/VTK About CCMake (Curses CMake GUI)
|
On Windows
About CMake GUI
|
VTK Settings
Variable | Description |
BUILD_SHARED_LIBS | If ON, use shared libraries. This way executables are smaller, but you have to make sure the shared libraries are on every system on the cluster. This option should be set to ON if you plan on using plugins for ParaView (there ways to use plugins in static builds of ParaView for advanced users). |
BUILD_DOCUMENTATION | If ON, build the documentation target, DoxygenDoc |
BUILD_TESTING | If ON, build the tests for submission to dashboards, or just run them locally with ctest -A |
CMAKE_BUILD_TYPE | Should be Release or Debug. If Debug, build with debug symbols. This will run more slowly, but will be more useful if you plan to use a debugger. |
CMAKE_INSTALL_PREFIX | Specifies where make should put the libraries when the make install command is run. |
TODO | Put the rest of the prominent variables here |
QT_QMAKE_EXECUTABLE | Path to Qt's qmake executable (such as /usr/local/bin/qmake). CMake uses this to locate the rest of the required Qt executables, headers and libraries. |