# Build and package SlicerCAT on manylinux

**URL:** <https://discourse.slicer.org/t/build-and-package-slicercat-on-manylinux/23443>\
**Category:** Development\
**Created:** [May 16, 2022, 3:01pm UTC](https://discourse.slicer.org/t/build-and-package-slicercat-on-manylinux/23443 "2022-05-16T15:01:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)\
**Post date:** [May 16, 2022, 3:01pm UTC](https://discourse.slicer.org/t/build-and-package-slicercat-on-manylinux/23443/1 "2022-05-16T15:01:30Z")

</div>

Hi,

How can I build and package SlicerCAT (C++17) so it was available on many linux distributions?  
For now all Linux staff I do on Ubuntu 20.04

---

<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 17, 2022, 12:06am UTC](https://discourse.slicer.org/t/build-and-package-slicercat-on-manylinux/23443/2 "2022-05-17T00:06:47Z")

</div>

I don’t think you need to do anything special, just build Slicer as usual and follow the [installation instructions](https://slicer.readthedocs.io/en/latest/user_guide/getting_started.html#linux). Maybe @RafaelPalomar can give you some more details.

---

<div class="post-metadata">

**Author:** ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)\
**Post date:** [May 17, 2022, 12:40am UTC](https://discourse.slicer.org/t/build-and-package-slicercat-on-manylinux/23443/3 "2022-05-17T00:40:39Z")

</div>

You should be right

I just experienced a little problem:  
I compiled and packaged SlicerCAT on my Ubuntu 20.04 and tried to run it on clean Debian 11.  
While I can run it on clean Ubuntu 20.4 and 22.04 (I use virtual machines) I was unable to run it on Debian 11: linking error something like `Unable to link to libjpeg8.so`

I guess some of my dependencies linked to Ubuntu’s libjpeg8.so but Debian doesn’t have it. It is just my assumption.

Worth to try to compile and package it on clean Debian 11 rather than on Ubuntu.

---

<div class="post-metadata">

**Author:** ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)\
**Post date:** [May 19, 2022, 8:27pm UTC](https://discourse.slicer.org/t/build-and-package-slicercat-on-manylinux/23443/4 "2022-05-19T20:27:22Z")

</div>

Some succes

The goal is to build SlicerCAT for Linux for many distributions and many releases.

My steps:

1. install CentOS 7
2. install [latest devtoolset 11](https://stackoverflow.com/a/39731134/11747958) (more recent GCC instead of the default 4.8.5)
3. install qt (I prefer Qt installer), cmake, git
4. to avoid following errors:  
**Could NOT find Patch (missing: Patch\_EXECUTABLE) (it means GNU PATCH)**  
**Failed to find “GL/gl.h” in “/usr/include/libdrm”.**  
**Could NOT find LibUUID (missing: LibUUID\_LIBRARY LibUUID\_INCLUDE\_DIR)**  
install the following packages (can be found in Slicer doc)  
`sudo yum install patch mesa-libGL-devel libuuid-devel`
5. build and pack

After packaging I succeded to run on fresh:  
**Debian 10.12**  
**Debian 11.3**  
**Ubuntu 18.04**  
**Ubuntu 20.04**  
**Ubuntu 22.04**  
**Fedora 34**

+install the `xinerama` [following Slicer installation instruction](https://slicer.readthedocs.io/en/latest/user_guide/getting_started.html#linux)  
even though **Debian 10.12** also needed [sudo ln -s /usr/lib/x86\_64-linux-gnu/libxcb-util.so /usr/lib/x86\_64-linux-gnu/libxcb-util.so.1](https://forum.qt.io/topic/93247/qt-qpa-plugin-could-not-load-the-qt-platform-plugin-xcb-in-even-though-it-was-found/81#:~:text=Simple%20solution%3A-,sudo%20ln%20%2Ds%20/usr/lib/x86_64%2Dlinux%2Dgnu/libxcb%2Dutil.so%20/usr/lib/x86_64%2Dlinux%2Dgnu/libxcb%2Dutil.so.1,-All%20work%2C%20folks) to solve the error:

```auto
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb.

```

simply installing `sudo apt-get install --reinstall libxcb-xinerama0` is not enough in this case.

I also tried to build/package SlicerCAT on Debian 11, Ubuntu 20.04, Fedora 34 but when trying to run the packaged app I discovered that on some platform I was unable to run it.

---

<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:** [June 13, 2022, 2:11pm UTC](https://discourse.slicer.org/t/build-and-package-slicercat-on-manylinux/23443/5 "2022-06-13T14:11:11Z")

</div>

Thank you for sharing this. Would you mind submitting a pull request with any necessary changes/additions for the [Slicer installation instructions] ([Getting Started — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/user_guide/getting_started.html#installing-3d-slicer))?

---

<div class="post-metadata">

**Author:** ![keri](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/keri/32/11618_2.png) [@keri](https://discourse.slicer.org/u/keri)\
**Post date:** [June 14, 2022, 12:05am UTC](https://discourse.slicer.org/t/build-and-package-slicercat-on-manylinux/23443/6 "2022-06-14T00:05:18Z")

</div>

[PR is ready](https://github.com/Slicer/Slicer/pull/6427)
