# Transition of nightly build to Qt5, VTK9, CMake 3.9 and C++11

**URL:** <https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918>\
**Category:** Development\
**Tags:** vtk, qt, nightlybuild\
**Created:** [January 24, 2018, 12:32am UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918 "2018-01-24T00:32:03Z")\
**Posts on this page:** 20\
**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:** [January 24, 2018, 12:32am UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/1 "2018-01-24T00:32:03Z")

</div>

Hi All,

Now that we have released Slicer 4.8.1 and also addressed a lot of issues with Qt5 and VTK9, the time has come to transition our nightly builds.

**IMPORTANT** : Time the nightly builds are stabilized, you should **expect disruption and build failures** until the end of next week.

### Transition Plan

Later this week and the following one, we will:

- Update [window nightly build script](https://github.com/Slicer/DashboardScripts/blob/4efec4e330f4e79da9d9eef3ac445a350bde4618/overload-vs2013-slicer_release_nightly.cmake) to use VS2015, Qt5 and VTK9

- Add a new [dashboard scripts](https://github.com/Slicer/DashboardScripts) to build on the more recent macOS machine:

- Disable build on the older machine [factory.kitware](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Factory#factory.kitware) that was running macOS 10.6.8.

- Update the default values in [Slicer/CMakeLists.txt](https://github.com/Slicer/Slicer/blob/09d0f4bebc51ff3794ba4045b25faf44c52f0fa6/CMakeLists.txt)

- Update minimum required version of CMake to 3.9.5. See [this topic](https://discourse.slicer.org/t/updating-minimum-required-version-of-cmake-to-3-9-5/1873) for more details.

### Important remarks

- waiting we transition Linux build from Ubuntu 10.04 VM running on `factory-south.kitware` to docker or VM based build running on [metroplex.kitware](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Factory#overload.kitware_and_metroplex.kitware) dashboard, we will **keep linux build with Qt4 and VTK7**. This will happen later.

---

<div class="post-metadata">

**Author:** ![hjmjohnson](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hjmjohnson/32/173_2.png) [@hjmjohnson](https://discourse.slicer.org/u/hjmjohnson)\
**Post date:** [January 24, 2018, 3:05am UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/2 "2018-01-24T03:05:55Z")

</div>

Very Exciting! You may want to speak with Matt McCormick regarding minimum OSX versions. He just completed an investigation into this regarding ITK and python.

---

<div class="post-metadata">

**Author:** ![JoostJM](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/joostjm/32/1091_2.png) [@JoostJM](https://discourse.slicer.org/u/JoostJM)\
**Post date:** [January 24, 2018, 10:12am UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/3 "2018-01-24T10:12:01Z")

</div>

Very exciting indeed! With the transition to VS2015, will the python version also be changed to 3.5 or will this be done at a later date?

---

<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:** [January 24, 2018, 1:49pm UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/4 "2018-01-24T13:49:47Z")

</div>

Python 3 migration is planned, too. As far as I know, most or all Slicer dependencies support Python 3 already, so the switch could probably happen later this year, once Slicer is stabilized after VTK, Qt, and compiler updates.

---

<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:** [January 24, 2018, 5:30pm UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/5 "2018-01-24T17:30:39Z")

</div>

> [@JoostJM](#):
>
> will the python version also be changed to 3.5

To complement @lassoan answer, during the past few years we worked hard to update VTK and ITK to work nicely with Python 3. Now that PythonQt also support it. The remaining part will be to update CTK and Slicer to work with Python 3.

If this is something important for your project and you have resources to allocate for this, do not hesitate to reach out to me.

---

<div class="post-metadata">

**Author:** ![JoostJM](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/joostjm/32/1091_2.png) [@JoostJM](https://discourse.slicer.org/u/JoostJM)\
**Post date:** [January 25, 2018, 8:56am UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/6 "2018-01-25T08:56:52Z")

</div>

No rush, more of a personal interest 😉

---

<div class="post-metadata">

**Author:** ![Davide\_Punzo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/davide_punzo/32/66104_2.png) [@Davide\_Punzo](https://discourse.slicer.org/u/Davide_Punzo)\
**Post date:** [January 26, 2018, 10:57am UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/7 "2018-01-26T10:57:47Z")

</div>

ok, great! waiting for the Linux transition as well 😋😄

---

<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:** [January 26, 2018, 11:13am UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/8 "2018-01-26T11:13:06Z")

</div>

> [@Davide\_Punzo](#):
>
> waiting for the Linux transition as well

That will come last but we will make sure to keep you posted of the progress.

xref [COMP: update gcc compiler linux kitware factory machine · Issue #72 · Punzo/SlicerAstro · GitHub](https://github.com/Punzo/SlicerAstro/issues/72)

---

<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:** [January 31, 2018, 2:53am UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/9 "2018-01-31T02:53:47Z")

</div>

Windows nightly build for Slicer application and extensions have been updated to use VS2015.

> <https://github.com/Slicer/DashboardScripts/commit/59b15e63b1571212e2262f390cc6e629447323cf>

Tomorrow, we will update the windows script to use Qt5 and VTK9 (as well as OpenGL2)

---

<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:** [February 1, 2018, 2:17pm UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/10 "2018-02-01T14:17:43Z")

</div>

Update:

- Windows build machine (named overload) has been updated two days ago but Slicer build failed because the dashboard script wasn’t setting `Qt5_DIR`. This was **fixed yesterday** in [Slicer/DashboardScripts@3d50b85](https://github.com/Slicer/DashboardScripts/commit/3d50b85c7659a40932d6fb75556ed710fa31b5a6).
- On that same machine, StrawberryPerl was also installed yesterday to generate archives of pre-built libraries for a recent version of OpenSSL and upload them on [GitHub - Slicer/Slicer-OpenSSL: OpenSSL sources and builds used in Slicer-based projects.](https://github.com/Slicer/Slicer-OpenSSL)
  - This caused the last nightly build to fail (see below) because the `patch.exe` provided by StrawberryPerl failed to be used to patch NUMPY.
  - This **was addressed** by removing the extra path
  - Note that corresponding CDash entry was removed, and nightly build was restarted.

Error that was reported on the dashboard:

```auto
Program: C:\StrawberryPerl-x64\c\bin\patch.exe

File: .\src\patch\2.5.9\patch-2.5.9-src\patch.c, Line 354
         
Expression: hunk

```

It was originally available at [CDash](http://slicer.cdash.org/viewBuildError.php?buildid=1190922) but corresponding entry was deleted, and build was manually restarted.

 ![Screenshot%20from%202018-02-01%2009-18-03](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/0/2036eb9718403491ba933aee18ae24c1d0312e7c.png)

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [February 1, 2018, 2:47pm UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/11 "2018-02-01T14:47:06Z")

</div>

@jcfr Will the official Qt version be 5.10.0, or it hasn’t been fixed yet?

---

<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:** [February 1, 2018, 3:13pm UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/12 "2018-02-01T15:13:43Z")

</div>

Since Qt 5.10.0 addresses issues (especially with WebEngine), I think we should go with it for the current release cycle. We could then revisit after Slicer 5.0 is out.

---

<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:** [February 1, 2018, 10:57pm UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/13 "2018-02-01T22:57:33Z")

</div>

Updates:

- Starting today, Slicer packages for windows are available for download and built against Qt5 and VTK9 with OpenGL2 enabled.
- The startup warnings related to the extension manager are already captured in [https://issues.slicer.org/view.php?id=4446](https://issues.slicer.org/view.php?id=4446) (assigned to @jcfr )
- The extra popup showing up is also captured in [https://issues.slicer.org/view.php?id=4505](https://issues.slicer.org/view.php?id=4505) (assigned to @Johan_Andruejol )
- The issue with icon size is being worked by to @Johan_Andruejol. This was captured in issue [4501](https://issues.slicer.org/view.php?id=4501) and was addressed in [r26976](http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=26976)

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [February 2, 2018, 2:08pm UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/14 "2018-02-02T14:08:55Z")

</div>

FYI the popup problem already had an issue: [https://issues.slicer.org/view.php?id=4503](https://issues.slicer.org/view.php?id=4503)

It’s great that the official Slicer at least for windows is now Qt5. Thanks for working on this!

---

<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:** [February 2, 2018, 10:00pm UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/15 "2018-02-02T22:00:21Z")

</div>

### Updates

- Thanks to @hina-shah , Slicer issue [#4503](https://issues.slicer.org/view.php?id=4503) is now fixed.

- macOS:

- windows:

### Next Steps

_Listed in no particular order_

- Fixes for the startup warnings related to the extension manager ([https://issues.slicer.org/view.php?id=4446](https://issues.slicer.org/view.php?id=4446)) should be integrated later today.
- Address remaining styling issues (thanks to @hjmjohnson ) and warnings
- Update of the wiki (Note that I already have screenshot documenting the step to install Qt 5.10.0 on Windows)
- Setup Linux build
- Tag sources and integrate changes in project like [Slicer/itkMGHImageIO](https://github.com/Slicer/itkMGHImageIO) (thanks to @hjmjohnson)
- Update minimum version of CMake to 3.9.5

### More details

#### Why Qt5 needs to build without rpath on macOS ?

This is required to work well with the current implementation of the packaging system.

The good news is that @ihnorton is working on creating a python script that will greatly speed up the packaging process and also allow _repackaging_ of Qt libraries installed using official installer.

#### Was the build of Slicer against Qt 5.10.0 and VTK9 tested on macOS ?

During the past year, a lot of people contributed to testing and stabilizing the build.

Last night, new dashboard scripts were added to support building on `factory-south-macos`:

- [factory-south-macos-slicer\_release\_nightly.cmake](https://github.com/Slicer/DashboardScripts/blob/master/factory-south-macos-slicer_release_nightly.cmake)
- [factory-south-macos-slicerextensions\_release\_nightly.cmake](https://github.com/Slicer/DashboardScripts/blob/master/factory-south-macos-slicerextensions_release_nightly.cmake)

Build of the Slicer application was manually started (with packaging disabled), it failed with an error related to Swig installation that should be fixed in [r26877](http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=26877)

Later today, the build was manually restarted and it completed. Packaging is now in progress, and I think it will succeed. If not, that will give us the opportunity to fix problem before the nightly start.

---

<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:** [February 2, 2018, 11:21pm UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/16 "2018-02-02T23:21:56Z")

</div>

### Update

- macOS packaging

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [February 2, 2018, 11:39pm UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/17 "2018-02-02T23:39:08Z")

</div>

Alas no, it crashed on startup; log below.

Process: Slicer [58842]  
Path: /private/var/folders/\*/Slicer.app/Contents/MacOS/Slicer  
Identifier: Slicer  
Version: ???  
Code Type: X86-64 (Native)  
Parent Process: ??? [1]  
Responsible: Slicer [58842]  
User ID: 501

Date/Time: 2018-02-02 18:34:05.285 -0500  
OS Version: Mac OS X 10.13.3 (17D47)  
Report Version: 12  
Anonymous UUID: AE9D173E-A1E8-E500-62F7-C31D0E540E6E

Time Awake Since Boot: 260000 seconds

System Integrity Protection: enabled

Notes: Translocated Process

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC\_CRASH (SIGABRT)  
Exception Codes: 0x0000000000000000, 0x0000000000000000  
Exception Note: EXC\_CORPSE\_NOTIFY

Application Specific Information:  
abort() called

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread  
0 libsystem\_kernel.dylib 0x00007fff6eb8ce3e \_\_pthread\_kill + 10  
1 libsystem\_pthread.dylib 0x00007fff6eccb150 pthread\_kill + 333  
2 libsystem\_c.dylib 0x00007fff6eae9312 abort + 127  
3 org.qt-project.QtCore 0x000000011999d9a9 0x119987000 + 92585  
4 org.qt-project.QtCore 0x000000011999f239 QMessageLogger::fatal(char const\*, …) const + 233  
5 org.qt-project.QtGui 0x000000011949e866 QGuiApplicationPrivate::createPlatformIntegration() + 5670  
6 org.qt-project.QtGui 0x000000011949e88b QGuiApplicationPrivate::createEventDispatcher() + 27  
7 org.qt-project.QtCore 0x0000000119b7fbd5 QCoreApplicationPrivate::init() + 2069  
8 org.qt-project.QtGui 0x000000011949a320 QGuiApplicationPrivate::init() + 64  
9 org.qt-project.QtWidgets 0x0000000118ed585a QApplicationPrivate::init() + 26  
10 libqSlicerBaseQTCore.dylib 0x000000010abec7f0 qSlicerCoreApplication::qSlicerCoreApplication(qSlicerCoreApplicationPrivate\*, int&, char\*\*) + 32  
11 libqSlicerBaseQTGUI.dylib 0x000000010a2f8188 qSlicerApplication::qSlicerApplication(int&, char\*\*) + 200  
12 0x0000000109f980f3 (anonymous namespace)::SlicerAppMain(int, char\*\*) + 803  
13 libdyld.dylib 0x00007fff6ea3d115 start + 1

Also there’s no slicer icon.

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/8/c82ee83c042f4814cd20332347175e79caa81a22.png)

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [February 3, 2018, 6:33pm UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/18 "2018-02-03T18:33:51Z")

</div>

When I try opening from the console I get this message that indicates it’s not finding the platform library in spite of it being installed by [r26882](http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=26882). Odd that it says it can’t find “cocoa” but also says that “cocoa” is available. Is it maybe the wrong version of the platform library file?

```auto
$ /Volumes/Slicer-4.9.0-2018-01-28-macosx-amd64/Slicer.app/Contents/MacOS/Slicer 
This application failed to start because it could not find or load the Qt platform plugin "cocoa"
in "".

Available platform plugins are: cocoa.

Reinstalling the application may fix this problem.
Abort trap: 6

```

---

<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:** [February 3, 2018, 7:05pm UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/19 "2018-02-03T19:05:21Z")

</div>

There a number of RPATH problems masked behind the qt plugin loader.

```auto
Slicer.app inorton$ QT_DEBUG_PLUGINS=1 ./Contents/MacOS/Slicer
QFactoryLoader::QFactoryLoader() checking directory path "/private/tmp/Slicer.app/Contents/lib/QtPlugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/private/tmp/Slicer.app/Contents/lib/QtPlugins/platforms/libqcocoa.dylib"
Found metadata in lib /private/tmp/Slicer.app/Contents/lib/QtPlugins/platforms/libqcocoa.dylib, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "cocoa"
        ]
    },
    "className": "QCocoaIntegrationPlugin",
    "debug": false,
    "version": 330240
}

Got keys from plugin meta data ("cocoa")
QFactoryLoader::QFactoryLoader() checking directory path "/private/tmp/Slicer.app/Contents/MacOS/platforms" ...
Cannot load library /private/tmp/Slicer.app/Contents/lib/QtPlugins/platforms/libqcocoa.dylib: (dlopen(/private/tmp/Slicer.app/Contents/lib/QtPlugins/platforms/libqcocoa.dylib, 133): Library not loaded: /Volumes/Dashboards/Support/qt-everywhere-build-5.10.0/lib/QtGui.framework/Versions/5/QtGui
  Referenced from: /private/tmp/Slicer.app/Contents/lib/QtPlugins/platforms/libqcocoa.dylib
  Reason: image not found)
QLibraryPrivate::loadPlugin failed on "/private/tmp/Slicer.app/Contents/lib/QtPlugins/platforms/libqcocoa.dylib" : "Cannot load library /private/tmp/Slicer.app/Contents/lib/QtPlugins/platforms/libqcocoa.dylib: (dlopen(/private/tmp/Slicer.app/Contents/lib/QtPlugins/platforms/libqcocoa.dylib, 133): Library not loaded: /Volumes/Dashboards/Support/qt-everywhere-build-5.10.0/lib/QtGui.framework/Versions/5/QtGui\n Referenced from: /private/tmp/Slicer.app/Contents/lib/QtPlugins/platforms/libqcocoa.dylib\n Reason: image not found)"
This application failed to start because it could not find or load the Qt platform plugin "cocoa"
in "".

Available platform plugins are: cocoa.

Reinstalling the application may fix this problem.
Abort trap: 6

```

---

<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:** [February 3, 2018, 7:26pm UTC](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918/20 "2018-02-03T19:26:57Z")

</div>

Could try the latest nightly for macos. I manually fixed and triggered the  
upload this morning.

[Next page](https://discourse.slicer.org/t/transition-of-nightly-build-to-qt5-vtk9-cmake-3-9-and-c-11/1918.md?page=2)
