# Qt5 build recompiles on Linux?

**URL:** <https://discourse.slicer.org/t/qt5-build-recompiles-on-linux/1542>\
**Category:** Development\
**Tags:** qt\
**Created:** [November 27, 2017, 6:26pm UTC](https://discourse.slicer.org/t/qt5-build-recompiles-on-linux/1542 "2017-11-27T18:26:44Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [November 27, 2017, 6:26pm UTC](https://discourse.slicer.org/t/qt5-build-recompiles-on-linux/1542/1 "2017-11-27T18:26:44Z")

</div>

[split from [Nightly binaries Qt5/VTK9?](https://discourse.slicer.org/t/nightly-binaries-qt5-vtk9/1531)]

* * *

How would Qt5 library version be managed on Linux ? From 5.9.2 to 5.9.3, I had to recompile, Qt says ‘mismatch version’ otherwise. This was not a problem for no longer developed Qt4.

---

<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 28, 2017, 3:24am UTC](https://discourse.slicer.org/t/qt5-build-recompiles-on-linux/1542/2 "2017-11-28T03:24:55Z")

</div>

> [@Nightly binaries Qt5/VTK9?](https://discourse.slicer.org/t/nightly-binaries-qt5-vtk9/1531/2):
>
> How would Qt5 library version be managed on Linux ? From 5.9.2 to 5.9.3, I had to recompile,

What do you mean?  
What did you have to recompile?

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [November 28, 2017, 11:20am UTC](https://discourse.slicer.org/t/qt5-build-recompiles-on-linux/1542/3 "2017-11-28T11:20:00Z")

</div>

> [@Nightly binaries Qt5/VTK9?](https://discourse.slicer.org/t/nightly-binaries-qt5-vtk9/1531/4):
>
> What did you have to recompile?

On switching from Qt 5.9.1 to 5.9.2, and from 5.9.2 to 5.9.3 through system upgrade on Arch Linux, I had to recompile Slicer. Slicer compiled with one version of Qt won’t run with the next version. AFAICT, Slicer does not ship Qt binaries, but relies on system Qt libraries on Linux. The Qt4 libraries have been stable for years, Qt5 is ongoing development. It seems to me that Slicer may have to include Qt binaries against which it was compiled. I don’t know if there are special configuration switches that would allow cross-version application execution.

---

<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 28, 2017, 12:23pm UTC](https://discourse.slicer.org/t/qt5-build-recompiles-on-linux/1542/4 "2017-11-28T12:23:52Z")

</div>

Slicer install package includes Qt libraries. You only need to rebuild Slicer if you’ve built it yourself and chose to use system Qt for the build.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [November 28, 2017, 1:40pm UTC](https://discourse.slicer.org/t/qt5-build-recompiles-on-linux/1542/5 "2017-11-28T13:40:18Z")

</div>

> [@Nightly binaries Qt5/VTK9?](https://discourse.slicer.org/t/nightly-binaries-qt5-vtk9/1531/6):
>
> Slicer install package includes Qt libraries.

OK. Just found they are in lib/Slicer-4.9/ from the downloaded package, and also in the self compiled one. Just added a working LD\_LIBRARY\_PATH in my startup script. Nice hint, thanks.

---

<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 28, 2017, 1:53pm UTC](https://discourse.slicer.org/t/qt5-build-recompiles-on-linux/1542/6 "2017-11-28T13:53:04Z")

</div>

If you start the application with the Slicer executable (the “launcher”) then it should set up LD\_LIBRARY\_PATH to include all necessary folders and then it starts SlicerApp-real executable.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [November 28, 2017, 2:25pm UTC](https://discourse.slicer.org/t/qt5-build-recompiles-on-linux/1542/7 "2017-11-28T14:25:26Z")

</div>

> [@Nightly binaries Qt5/VTK9?](https://discourse.slicer.org/t/nightly-binaries-qt5-vtk9/1531/8):
>
> start the application with the Slicer executable (the “launcher”)

That’s what I do since years :

> export LC\_NUMERIC=C  
> $HOME/bin/Slicer4/Slicer

where Slicer4 is a symlink.

I booted on a partition with Qt5 5.9.1 and Failed to run Slicer built with 5.9.3 :

> #[user@vasc2 ~][0]$ export LC\_NUMERIC=C  
> #[user@vasc2 ~][0]$ bin/Slicer4/Slicer  
> An OpenGL Core Profile was requested, but it is not supported on the current platform. Falling back to a non-Core profile. Note that this might cause rendering issues.  
> Qt WebEngine ICU data not found at /usr/share/qt/resources. Trying parent directory…  
> Qt WebEngine ICU data not found at /usr/share/qt. Trying application directory…  
> Qt WebEngine ICU data not found at /home/user/bin/Slicer-4.9.0-2017-11-23-linux-amd64/bin. Trying fallback directory… The application MAY NOT work.  
> Path override failed for key base::DIR\_QT\_LIBRARY\_DATA and path ‘/home/user/.Slicer’  
> [1128/151322.965258:ERROR:icu\_util.cc(178)] Invalid file descriptor to ICU data received.  
> error: [/home/user/bin/Slicer4/bin/SlicerApp-real] exit abnormally - Report the problem.  
> #[user@vasc2 ~][1]$ export LD\_LIBRARY\_PATH=/home/user/bin/Slicer4/lib/Slicer-4.9  
> #[user@vasc2 ~][0]$ bin/Slicer4/Slicer  
> An OpenGL Core Profile was requested, but it is not supported on the current platform. Falling back to a non-Core profile. Note that this might cause rendering issues.  
> Qt WebEngine ICU data not found at /usr/share/qt/resources. Trying parent directory…  
> Qt WebEngine ICU data not found at /usr/share/qt. Trying application directory…  
> Qt WebEngine ICU data not found at /home/user/bin/Slicer-4.9.0-2017-11-23-linux-amd64/bin. Trying fallback directory… The application MAY NOT work.  
> Path override failed for key base::DIR\_QT\_LIBRARY\_DATA and path ‘/home/user/.Slicer’  
> [1128/151443.117284:ERROR:icu\_util.cc(178)] Invalid file descriptor to ICU data received.  
> error: [/home/user/bin/Slicer4/bin/SlicerApp-real] exit abnormally - Report the problem.

---

<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 28, 2017, 8:53pm UTC](https://discourse.slicer.org/t/qt5-build-recompiles-on-linux/1542/8 "2017-11-28T20:53:08Z")

</div>

If you build Slicer using system Qt then you need to rebuild Slicer if you update system Qt (maybe not needed for some small patch updates). If you build using your own Qt or use a pre-built binary package then upgrading system Qt has no effect on your Slicer builds. If you find that you build your own Qt and Slicer still uses system Qt then it’s probably a launcher configuration error and it will be addressed when Slicer nightly will switch to Qt5 (in a few weeks).
