# Building Slicer on a freshly installed Ubuntu 18.04

**URL:** <https://discourse.slicer.org/t/building-slicer-on-a-freshly-installed-ubuntu-18-04/5627>\
**Category:** Development\
**Created:** [February 3, 2019, 5:18am UTC](https://discourse.slicer.org/t/building-slicer-on-a-freshly-installed-ubuntu-18-04/5627 "2019-02-03T05:18:27Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Satya\_Arjunan](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@Satya\_Arjunan](https://discourse.slicer.org/u/Satya_Arjunan)\
**Post date:** [February 3, 2019, 5:18am UTC](https://discourse.slicer.org/t/building-slicer-on-a-freshly-installed-ubuntu-18-04/5627/1 "2019-02-03T05:18:27Z")

</div>

Hi all,

I am trying to build the most recent Slicer from github on a freshly installed Ubuntu 18.04 and I am getting the following error:  
error: [/home/satya/wrk/Slicer/build/Slicer-build/bin/./SlicerApp-real] exit abnormally - Report the problem.

To debug with gdb, I used an exec-wrapper but I got the following error:  
(gdb) set exec-wrapper ./WrapSlicer4  
(gdb) exec-file ./bin/SlicerApp-real  
(gdb) run  
Starting program: /home/satya/wrk/Slicer/build/Slicer-build/bin/SlicerApp-real  
[Thread debugging using libthread\_db enabled]  
Using host libthread\_db library “/lib/x86\_64-linux-gnu/libthread\_db.so.1”.  
[New Thread 0x7fffad95e700 (LWP 3618)]  
[New Thread 0x7fffa4fc4700 (LWP 3619)]  
[New Thread 0x7fff9ffff700 (LWP 3620)]  
[New Thread 0x7fff9c87a700 (LWP 3621)]  
[New Thread 0x7fff97d5c700 (LWP 3622)]

Thread 1 “SlicerApp-real” received signal SIGSEGV, Segmentation fault.  
\_\_strcmp\_ssse3 () at …/sysdeps/x86\_64/multiarch/…/strcmp.S:173  
173 …/sysdeps/x86\_64/multiarch/…/strcmp.S: No such file or directory.  
(gdb)  
[3]+ Stopped gdb

Here are the steps I followed to build Slicer:  
sudo apt install qtcreator qtdeclarative5-dev qtmultimedia5-dev qtbase5-private-dev libqt5xmlpatterns5-dev libqt5svg5-dev libqt5webenginewidgets5 qtwebengine5-dev qtscript5-dev qttools5-dev libxt-dev libqt5x11extras5-dev  
sudo apt install git cmake  
git clone --recursive [https://github.com/Slicer/Slicer.git](https://github.com/Slicer/Slicer.git)  
cd Slicer  
mkdir build  
cd build  
cmake -DQt5\_DIR=/usr/lib/qt5 -DCMAKE\_BUILD\_TYPE:STRING=Debug -DSlicer\_USE\_PYTHONQT\_WITH\_TCL:BOOL=OFF -DSlicer\_USE\_SimpleITK:BOOL=OFF -DSlicer\_USE\_QtTesting:BOOL=OFF -DSlicer\_BUILD\_DataStore:BOOL=OFF -DSlicer\_USE\_SYSTEM\_QT:BOOL=1 …/  
make

During make, I got some errors in LibArchive and fixed them with the instructions provided here: [https://github.com/libarchive/libarchive/commit/4925fd0ba817764f30b3d6837820351c3bd556d4](https://github.com/libarchive/libarchive/commit/4925fd0ba817764f30b3d6837820351c3bd556d4)

The contents of WrapSlicer4:  
#!/bin/bash  
BASE\_DIR=/home/satya/wrk/Slicer/build  
APPLAUNCHER\_DIR=$BASE\_DIR/Slicer-build

LD\_PATHS="  
$BASE\_DIR/VTK-build/bin/  
$BASE\_DIR/CTK-build/CTK-build/bin/  
/usr/lib  
$BASE\_DIR/ITK-build/bin/  
$BASE\_DIR/SlicerExecutionModel-build/ModuleDescriptionParser/bin/  
$BASE\_DIR/teem-build/bin/  
$BASE\_DIR/LibArchive-install/lib  
$APPLAUNCHER\_DIR/bin/  
$APPLAUNCHER\_DIR/lib/Slicer-4.11/qt-loadable-modules  
$APPLAUNCHER\_DIR/lib/Slicer-4.11/cli-modules/  
$APPLAUNCHER\_DIR/lib/Slicer-4.11/qt-loadable-modules/  
$BASE\_DIR/tcl-build/lib  
$BASE\_DIR/OpenIGTLink-build  
$BASE\_DIR/OpenIGTLink-build/bin/  
$BASE\_DIR/CTK-build/PythonQt-build/  
$BASE\_DIR/python-build/lib  
$BASE\_DIR/python-build/lib/python2.7/site-packages/numpy/core  
$BASE\_DIR/python-build/lib/python2.7/site-packages/numpy/lib  
"  
for STR in LD\_PATHS; do LD\_LIBRARY\_PATH="{STR}:${LD\_LIBRARY\_PATH}"; done  
echo $LD\_LIBRARY\_PATH

QT\_PLUGIN\_PATH=$APPLAUNCHER\_DIR/bin:$BASE\_DIR/CTK-build/CTK-build/bin:/usr/lib/qt4/plugins  
SLICER\_HOME=$BASE\_DIR/Slicer-build  
PYTHONHOME=$BASE\_DIR/python-build  
PYTHONPATH=$APPLAUNCHER\_DIR:/bin:$APPLAUNCHER\_DIR:/bin/Python:$BASE\_DIR/python-build/lib/python2.7/site-packages:$APPLAUNCHER\_DIR/lib/Slicer-4.0/qt-loadable-modules/.:$APPLAUNCHER\_DIR/lib/Slicer-4.0/qt-loadable-modules/Python  
TCL\_LIBRARY=$BASE\_DIR/tcl-build/lib/tcl8.4  
TK\_LIBRARY=$BASE\_DIR/tcl-build/lib/tk8.4  
TCLLIBPATH=$BASE\_DIR/tcl-build/lib/itcl3.2:$BASE\_DIR/tcl-build/lib/itk3.2

export QTPLUGIN\_PATH=$QT\_PLUGIN\_PATH  
export SLICER\_HOME=$SLICER\_HOME  
export PYTHONHOME=$PYTHONHOME  
export PYTHONPATH=$PYTHONPATH  
export TCL\_LIBRARY=$TCL\_LIBRARY  
export TK\_LIBRARY=$TK\_LIBRARY  
export TCLLIBPATH=$TCLLIBPATH  
export LD\_LIBRARY\_PATH=$LD\_LIBRARY\_PATH

exec “$@”

What should I do next? Thank you!

Satya

---

<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, 2019, 8:12am UTC](https://discourse.slicer.org/t/building-slicer-on-a-freshly-installed-ubuntu-18-04/5627/2 "2019-02-03T08:12:04Z")

</div>

You shouldn’t need this `WrapSlicer4` script. Did you try starting with just the Slicer launcher in the Slicer-build directory?

---

<div class="post-metadata">

**Author:** ![Satya\_Arjunan](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@Satya\_Arjunan](https://discourse.slicer.org/u/Satya_Arjunan)\
**Post date:** [February 3, 2019, 9:39am UTC](https://discourse.slicer.org/t/building-slicer-on-a-freshly-installed-ubuntu-18-04/5627/3 "2019-02-03T09:39:28Z")

</div>

Thanks Steve. When I run ./Slicer in the Slicer-build directory I get:  
error: [/home/satya/wrk/Slicer/build/Slicer-build/bin/./SlicerApp-real] exit abnormally - Report the problem.

When I run ./SlicerApp-real in the Slicer-build/bin directory I get:  
Segmentation fault (core dumped)

BTW, if it helps, I was able to install and run SlicerSALT git on the same system without any problem with the following steps:  
sudo apt remove cmake  
sudo pip install --upgrade cmake (to install cmake version \>= 3.11)  
in ~/.bashrc  
export PATH=/usr/local/bin:$PATH  
sudo apt install gfortran libqtwebkit-dev qt4-default  
git clone [git@github.com](mailto:git@github.com):Kitware/slicerSALT.git  
cd slicerSALT  
mkdir build  
cd build  
cmake …/  
make -j2  
./Slicer-build/SlicerSALT

---

<div class="post-metadata">

**Author:** ![Satya\_Arjunan](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@Satya\_Arjunan](https://discourse.slicer.org/u/Satya_Arjunan)\
**Post date:** [February 3, 2019, 9:46am UTC](https://discourse.slicer.org/t/building-slicer-on-a-freshly-installed-ubuntu-18-04/5627/4 "2019-02-03T09:46:58Z")

</div>

When I run Slicer with gdb in the Slicer-build directory this is what I get:  
(gdb) exec-file Slicer  
(gdb) run  
Starting program: /home/satya/wrk/Slicer/build/Slicer-build/Slicer  
[Thread debugging using libthread\_db enabled]  
Using host libthread\_db library “/lib/x86\_64-linux-gnu/libthread\_db.so.1”.  
[New Thread 0x7ffff34af700 (LWP 24211)]  
error: [/home/satya/wrk/Slicer/build/Slicer-build/bin/./SlicerApp-real] exit abnormally - Report the problem.  
[Thread 0x7ffff34af700 (LWP 24211) exited]  
[Inferior 1 (process 24207) exited with code 01]

---

<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 5, 2019, 2:44pm UTC](https://discourse.slicer.org/t/building-slicer-on-a-freshly-installed-ubuntu-18-04/5627/5 "2019-02-05T14:44:39Z")

</div>

Hmm, not sure what that is. About the best I can think is to start with a fresh virtual machine and then write a script that exactly replicates the build steps that lead to this.

Anyone on discourse have a better idea?

---

<div class="post-metadata">

**Author:** ![Satya\_Arjunan](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@Satya\_Arjunan](https://discourse.slicer.org/u/Satya_Arjunan)\
**Post date:** [February 10, 2019, 10:02am UTC](https://discourse.slicer.org/t/building-slicer-on-a-freshly-installed-ubuntu-18-04/5627/6 "2019-02-10T10:02:27Z")

</div>

What is the best way to debug? GDB output does not give any useful information.

---

<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:** [February 10, 2019, 2:43pm UTC](https://discourse.slicer.org/t/building-slicer-on-a-freshly-installed-ubuntu-18-04/5627/7 "2019-02-10T14:43:49Z")

</div>

Build Slicer Debug or RelWithDebInfo mode to have debug symbols (see variable and method names, mapping to line numbers, etc).

---

<div class="post-metadata">

**Author:** ![Satya\_Arjunan](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@Satya\_Arjunan](https://discourse.slicer.org/u/Satya_Arjunan)\
**Post date:** [February 10, 2019, 11:15pm UTC](https://discourse.slicer.org/t/building-slicer-on-a-freshly-installed-ubuntu-18-04/5627/8 "2019-02-10T23:15:30Z")

</div>

Thanks Andras, but as I wrote in my first message, I built Slicer with the Debug option:

> [@Satya\_Arjunan](#):
>
> cmake -DQt5\_DIR=/usr/lib/qt5 -DCMAKE\_BUILD\_TYPE:STRING=Debug -

but I am not getting any useful information from GDB except:

> (gdb) exec-file Slicer  
> (gdb) run  
> Starting program: /home/satya/wrk/Slicer/build/Slicer-build/Slicer  
> [Thread debugging using libthread\_db enabled]  
> Using host libthread\_db library “/lib/x86\_64-linux-gnu/libthread\_db.so.1”.  
> [New Thread 0x7ffff34af700 (LWP 24211)]  
> error: [/home/satya/wrk/Slicer/build/Slicer-build/bin/./SlicerApp-real] exit abnormally - Report the problem.  
> [Thread 0x7ffff34af700 (LWP 24211) exited]  
> [Inferior 1 (process 24207) exited with code 01]

---

<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:** [February 11, 2019, 12:11am UTC](https://discourse.slicer.org/t/building-slicer-on-a-freshly-installed-ubuntu-18-04/5627/9 "2019-02-11T00:11:01Z")

</div>

Can you get a call stack?

---

<div class="post-metadata">

**Author:** ![Satya\_Arjunan](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@Satya\_Arjunan](https://discourse.slicer.org/u/Satya_Arjunan)\
**Post date:** [February 11, 2019, 12:56am UTC](https://discourse.slicer.org/t/building-slicer-on-a-freshly-installed-ubuntu-18-04/5627/10 "2019-02-11T00:56:14Z")

</div>

Here is what I am getting when I execute gdb with bin/SlicerApp-real:

(gdb) exec-file SlicerApp-real

(gdb) run

Starting program: /home/satya/wrk/Slicer/build/Slicer-build/bin/SlicerApp-real

[Thread debugging using libthread\_db enabled]

Using host libthread\_db library “/lib/x86\_64-linux-gnu/libthread\_db.so.1”.

[New Thread 0x7fffad95a700 (LWP 8620)]

qt5ct: using qt5ct plugin

[New Thread 0x7fffa59e1700 (LWP 8621)]

[New Thread 0x7fffa5127700 (LWP 8622)]

Thread 1 “SlicerApp-real” received signal SIGSEGV, Segmentation fault.

\_\_strcmp\_ssse3 () at …/sysdeps/x86\_64/multiarch/…/strcmp.S:173

173 …/sysdeps/x86\_64/multiarch/…/strcmp.S: No such file or directory.

(gdb) backtrace

#0 0x00007fffc8fa4d76 in \_\_strcmp\_ssse3 ()

at …/sysdeps/x86\_64/multiarch/…/strcmp.S:173

#1 0x00007fffebafcb0d in lh\_insert ()

at /home/satya/wrk/Slicer/build/OpenSSL/libcrypto.so.1.0.0

#2 0x00007fffeba45f5b in OBJ\_NAME\_add ()

at /home/satya/wrk/Slicer/build/OpenSSL/libcrypto.so.1.0.0

#3 0x00007fff9f949708 in () at /usr/lib/x86\_64-linux-gnu/libssl.so.1.1

#4 0x00007fffe358f827 in \_\_pthread\_once\_slow (once\_control=0x7fff9fb877fc, init\_routine=0x7fff9f949600) at pthread\_once.c:116

#5 0x00007fff9fd31939 in CRYPTO\_THREAD\_run\_once ()

at /usr/lib/x86\_64-linux-gnu/libcrypto.so.1.1

#6 0x00007fff9f9498eb in OPENSSL\_init\_ssl ()

at /usr/lib/x86\_64-linux-gnu/libssl.so.1.1

#7 0x00007fffeb0ac7ac in () at /usr/lib/x86\_64-linux-gnu/libQt5Network.so.5

#8 0x00007ffff5c08a0b in qSlicerCoreApplicationPrivate::init() (this=0x555555781f00)

at /home/satya/wrk/Slicer/Base/QTCore/qSlicerCoreApplication.cxx:271

#9 0x00007ffff6f0e716 in qSlicerApplicationPrivate::init() (this=0x555555781f00)

at /home/satya/wrk/Slicer/Base/QTGUI/qSlicerApplication.cxx:205

—Type to continue, or q to quit—

#10 0x00007ffff6f0f460 in qSlicerApplication::qSlicerApplication(int&, char\*\*) (this=

0x7fffffffdbb0, \_argc=@0x7fffffffdb5c: 1, \_argv=0x7fffffffdd18)

at /home/satya/wrk/Slicer/Base/QTGUI/qSlicerApplication.cxx:359

#11 0x0000555555559fc1 in ()

#12 0x00007fffffffdd18 in ()

#13 0x0000000100000000 in ()

#14 0x0000000000000000 in ()

(gdb) info frame

Stack level 0, frame at 0x7fffffffd730:

rip = 0x7fffc8fa4d76 in \_\_strcmp\_ssse3

(…/sysdeps/x86\_64/multiarch/…/strcmp.S:173); saved rip = 0x7fffebafcb0d

called by frame at 0x7fffffffd770

source language asm.

Arglist at 0x7fffffffd720, args:

Locals at 0x7fffffffd720, Previous frame’s sp is 0x7fffffffd730

Saved registers:

rip at 0x7fffffffd728

---

<div class="post-metadata">

**Author:** ![Satya\_Arjunan](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@Satya\_Arjunan](https://discourse.slicer.org/u/Satya_Arjunan)\
**Post date:** [February 11, 2019, 1:42am UTC](https://discourse.slicer.org/t/building-slicer-on-a-freshly-installed-ubuntu-18-04/5627/11 "2019-02-11T01:42:14Z")

</div>

This is probably related to using system Qt which was reported previously here: [https://issues.slicer.org/view.php?id=4617](https://issues.slicer.org/view.php?id=4617)

I will follow the workaround provided there and report back.

---

<div class="post-metadata">

**Author:** ![Satya\_Arjunan](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@Satya\_Arjunan](https://discourse.slicer.org/u/Satya_Arjunan)\
**Post date:** [February 11, 2019, 9:35am UTC](https://discourse.slicer.org/t/building-slicer-on-a-freshly-installed-ubuntu-18-04/5627/12 "2019-02-11T09:35:16Z")

</div>

I can confirm that the following steps resolved this issue:

1. sudo apt install libcurl4-openssl-dev libssl-dev
2. git clone --recursive [https://github.com/Slicer/Slicer.git](https://github.com/Slicer/Slicer.git)
3. cd Slicer && mkdir build
4. cd build
5. cmake -DQt5\_DIR=/usr/lib/qt5 -DCMAKE\_BUILD\_TYPE:STRING=Debug -DSlicer\_USE\_SYSTEM\_OpenSSL=1 -DSlicer\_USE\_SYSTEM\_curl:BOOL=1 …/
6. make -j2

Should the status on [https://issues.slicer.org/view.php?id=4617](https://issues.slicer.org/view.php?id=4617) be set to resolved? I think it is somewhat misleading.
