# Transition to VTK 8.0

**URL:** <https://discourse.slicer.org/t/transition-to-vtk-8-0/379>\
**Category:** Development\
**Tags:** build, vtk, qt\
**Created:** [May 24, 2017, 7:44pm UTC](https://discourse.slicer.org/t/transition-to-vtk-8-0/379 "2017-05-24T19:44:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [May 24, 2017, 7:44pm UTC](https://discourse.slicer.org/t/transition-to-vtk-8-0/379/1 "2017-05-24T19:44:17Z")

</div>

Hi All,

Just to let you know we are working on updating the version of VTK used in Slicer to use the latest VTK version. As soon as a branch is ready for testing, I will follow up here.

It will include the follow steps:

- create branch for testing VTK build

- document breaking change on [https://www.slicer.org/wiki/Documentation/Labs/VTK7](https://www.slicer.org/wiki/Documentation/Labs/VTK7) (we will probably create a VTK8 page)

- transition MacOSX build from [factory.kitware](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Factory#Software) (MacOSX 10.6.8) to [factory-south.kitware](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Factory#factory.kitware) (MacOSX 10.11.6). Deployment target for Slicer official package will be changed from `10.6` to `10.7` (the minimum required by newer VTK)

- transition Linux build from Ubuntu 10.04 VM running on `factory-south.kitware` to docker based build running on [metroplex.kitware](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Factory#overload.kitware_and_metroplex.kitware) dashboard. (It will most likely use [dockcross/manylinux-x64](https://github.com/dockcross/dockcross#readme) (or similar image)

> **[VTK 8.0.0-rc1 ready for testing - Kitware Blog](https://blog.kitware.com/vtk-8-0-0-rc1-ready-for-testing/)**
>
> The VTK maintenance team is happy to announce that VTK 8.0 has entered the release candidate stage! You can find the source, data and documentation ... Read More

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [May 24, 2017, 8:24pm UTC](https://discourse.slicer.org/t/transition-to-vtk-8-0/379/2 "2017-05-24T20:24:09Z")

</div>

It would give more time for testing and extension developers for updating if we temporarily make Slicer and extensions compatible with both VTK7 and VTK8 with (using #ifdefs, similarly how we did it for VTK5-\>VTK6 transition).

---

<div class="post-metadata">

**Author:** ![fedorov](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fedorov/32/14_2.png) [@fedorov](https://discourse.slicer.org/u/fedorov)\
**Post date:** [May 24, 2017, 9:08pm UTC](https://discourse.slicer.org/t/transition-to-vtk-8-0/379/3 "2017-05-24T21:08:07Z")

</div>

“This also means, beginning version 8.0.0, VTK requires a C++11 capable compiler to compile”

@jcfr can you please comment whether C++11 will be enabled for VTK compiled with Slicer?

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [May 24, 2017, 9:19pm UTC](https://discourse.slicer.org/t/transition-to-vtk-8-0/379/4 "2017-05-24T21:19:53Z")

</div>

> [@lassoan](#):
>
> compatible with both VTK7 and VTK8 with (using #ifdefs, similarly how we did it for VTK5-\>VTK6 transition).

Look like we will have a CMake option to choose one or the other.

> [@fedorov](#):
>
> can you please comment whether C++11 will be enabled for VTK compiled with Slicer?

Will comment later. Depending on what require c++11, we may add this requirement at a later time and patch Slicer/VTK fork.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [September 22, 2017, 7:24pm UTC](https://discourse.slicer.org/t/transition-to-vtk-8-0/379/5 "2017-09-22T19:24:17Z")

</div>

> [@jcfr](#):
>
> Will comment later. Depending on what require c++11, we may add this requirement at a later time and patch Slicer/VTK fork.

Here is an update:

- when building Slicer against Qt4, VTK 7.1 is used and C++98 is selected

- when building Slicer against Qt5, VTK 8 is used and C++11 is selected

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [November 4, 2017, 3:16pm UTC](https://discourse.slicer.org/t/transition-to-vtk-8-0/379/6 "2017-11-04T15:16:26Z")

</div>

Regarding

> [@Load DSI Studio (\*.trk.gz) or TrackVis (\*.trk) tracks in Slicer](https://discourse.slicer.org/t/load-dsi-studio-trk-gz-or-trackvis-trk-tracks-in-slicer/1356/3):
>
> @jcfr When do we plan to switch to c++11? I have trouble building Cleaver on Linux and Mac without c++11, too.

Actually, it wouldn’t be completely crazy to go straight to C++14…

- Windows: in the past, Visual Studio was always lagging, but we will be requiring MSVC19 (Visual Studio 2015) anyway, [which supports](http://en.cppreference.com/w/cpp/compiler_support) everything in C++14.

- Mac: Clang has supported everything in C++14 for more than two major releases.

- Linux is the wildcard, because of old clusters. However, they are not any worse off than will be with C++11 – they have to use devtoolset or the equivalent anyway.

@pieper @lassoan

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 4, 2017, 4:26pm UTC](https://discourse.slicer.org/t/transition-to-vtk-8-0/379/7 "2017-11-04T16:26:26Z")

</div>

I would try to be as close to VTK as possible and switch to c++14 shortly after VTK switches.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [November 4, 2017, 8:20pm UTC](https://discourse.slicer.org/t/transition-to-vtk-8-0/379/8 "2017-11-04T20:20:51Z")

</div>

I’m wondering if we should create a Slicer 4.8.1 patch release based on the latest trunk version (maybe excluding a few risky changes, if there were any), just before we switch to VTK8. There have been a couple of fixes and improvements that would be good to have in the stable version.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [December 12, 2017, 11:48pm UTC](https://discourse.slicer.org/t/transition-to-vtk-8-0/379/9 "2017-12-12T23:48:20Z")

</div>

Hi Slicers,

To streamline the maintenance, support for `Slicer_VTK_VERSION_MAJOR=8` has been removed in [r26710](http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=26710)

### What does this mean for existing build tree ?

Three cases:

- **Qt4** : if you are building against Qt4: **no action required.**

- **Qt5** : if you have done a clean build since November 15 (when [r26634](http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=26634) was integrated), you are all set.

- **Qt5** : if you have NOT done a clean build, now is the time to do so. Otherwise, you will get an error message like ``.
