Skip to content
Snippets Groups Projects
Forked from VTK / VTK
129 commits behind the upstream repository.
build.md 8.21 KiB

Building

This page describes how to build and install VTK. It covers building for development, on both Unix-type systems (Linux, HP-UX, Solaris, macOS), and Windows. Note that Unix-like environments such as Cygwin and MinGW are not officially supported. However, patches to fix problems with these platforms will be considered for inclusion. It is recommended that users which require VTK to work on these platforms to submit nightly testing results for them.

A full-featured build of VTK depends on several open source tools and libraries such as Python, Qt, CGNS, HDF5, etc. Some of these are included in the VTK source itself (e.g., HDF5), while others are expected to be present on the machine on which VTK is being built (e.g., Python, Qt).

VTK supports all of the common generators supported by CMake. The Ninja, Makefiles, and Visual Studio generators are the most well-tested however.

Note that VTK does not support in-source builds, so you must have a build tree that is not the source tree.

Obtaining the sources

There are two approaches:

::::{tab-set}

:::{tab-item} Release Download

  1. Download the source release VTK-X.Y.Z.tar.gz from https://vtk.org/download/.
  2. Create a folder for VTK.
  3. Extract the contents of the VTK folder in the downloaded archive to the subfolder called source :::

:::{tab-item} Git Clone To obtain VTK's sources locally, clone the VTK repository using Git.

Open Git Bash on Windows or a terminal on Linux and macOS and execute the following:

mkdir -p ~/vtk
git clone --recursive https://gitlab.kitware.com/vtk/vtk.git ~/vtk/source

:::

::::

To use the latest features being developed or to make changes and contribute to VTK, download the source using Git Clone.

Prerequisites

VTK only requires a few packages in order to build in general, however specific features may require additional packages to be provided to VTK's build configuration.

Required:

  • CMake

    • Version 3.12 or newer, however, the latest version is always recommended. If the system package management utilities do not offer cmake or if the offered version is too old Precompiled binaries available on CMake's download page.
  • Supported compiler

    • GCC 4.8 or newer
    • Clang 3.3 or newer
    • Apple Clang 7.0 (from Xcode 7.2.1) or newer
    • Microsoft Visual Studio 2015 or newer
    • Intel 14.0 or newer