Building Slicer on a freshly installed Ubuntu 18.04


(Satya Arjunan) #1

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
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

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


(Steve Pieper) #2

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


(Satya Arjunan) #3

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:Kitware/slicerSALT.git
cd slicerSALT
mkdir build
cd build
cmake …/
make -j2
./Slicer-build/SlicerSALT


(Satya Arjunan) #4

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]


(Steve Pieper) #5

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?


(Satya Arjunan) #6

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


(Andras Lasso) #7

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


(Satya Arjunan) #8

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

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]


(Andras Lasso) #9

Can you get a call stack?


(Satya Arjunan) #10

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


(Satya Arjunan) #11

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

I will follow the workaround provided there and report back.


(Satya Arjunan) #12

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
  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 be set to resolved? I think it is somewhat misleading.