I’ve built Slicer and then SlicerRT from source several times in the past. I followed the online instructions.
In the same computer, I recently updated (via git pull) the Slicer and SlicerRT repositories to master, and then rebuilt from scratch.
The build of Slicer works fine, and I can start Slicer-build/Slicer without problems. The GUI shows perfectly fine, both directly within the computer as well as via ssh -X.
If I call directly /home/user/builds/build-Slicer_src-Desktop-Debug/Slicer-build/bin/SlicerApp-real that works fine, too.
The build of SlicerRt works fine, however, when I now start inner-build/SlicerWithSlicerRT, (no difference if locally or via ssh -X), I get the following error:
Note that GLX works fine, glxinfo and glxgears show the right output.
Could you let me know what can I do to debug this issue? Is there a way to get more verbose erro information? Some logfile to check? Any idea why this is happening?
If I run /home/user/builds/build-Slicer_src-Desktop-Debug/Slicer-build/bin/./SlicerApp-real --additional-module-paths /opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/qt-scripted-modules /opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/qt-loadable-modules /opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/cli-modules --no-splash --verbose-module-discovery
the GUI pops up, but with some warnings:
File "<string>", line 5, in <module>
File "<string>", line 5, in <module>
ModuleNotFoundError: No module named 'ctk'
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'getSlicerRCFileName' is not defined
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'slicer'
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'slicer'
qSlicerScriptedLoadableModuleFactory - Failed to import module "NA" python extensions
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "<frozen importlib._bootstrap_external>", line 999, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/home/user/builds/build-Slicer_src-Desktop-Debug/Slicer-build/lib/Slicer-5.9/qt-scripted-modules/AddManyMarkupsFiducialTest.py", line 3, in <module>
import ctk
....
Loading module "ExternalBeamPlanning"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/qt-scripted-modules/DoseEngines/__init__.py", line 1, in <module>
from .AbstractScriptedDoseEngine import *
File "/opt/SlicerRT_bld/inner-build/lib/Slicer-5.9/qt-scripted-modules/DoseEngines/AbstractScriptedDoseEngine.py", line 2, in <module>
import vtk, qt, ctk, slicer, logging
ModuleNotFoundError: No module named 'vtk'
....
and DICOM import and many other things are not working.
SlicerRT currently has known build errors with latest Slicer main. See SlicerPreview - Build Errors. So you may actually want to try latest Slicer Stable 5.8.1 if you are trying to find a configuration that can build SlicerRT successfully. See SlicerStable.
I’m having that on Arch Linux too, plus other encoding error messages; I’m using this brute force hack:
diff --git a/Base/Python/slicer/__init__.py b/Base/Python/slicer/__init__.py
index 1443f9b7f8..fbcb831339 100644
--- a/Base/Python/slicer/__init__.py
+++ b/Base/Python/slicer/__init__.py
@@ -183,6 +183,11 @@ except ImportError as detail:
import os
import sys
+import locale
+
+# 'ANSI_X3.4-1968' codec is being enforced since july 2025.
+# Dumb but needed. Don't use getlocale(). A literal is good also.
+locale.setlocale(locale.LC_ALL, locale.getdefaultlocale())
standalone_python = "python" in str.lower(os.path.split(sys.executable)[-1])
If you don’t want to patch the Slicer source tree, you may update __init__.py in your installed tree:
With this hack, Slicer starts but files are badly read (NRRD, DICOM…).
This fix yields a functional Slicer:
locale.setlocale(locale.LC_ALL, "C.UTF-8")
NOTE: this is just a temporary hack for my Linux build at the moment. It should not be needed at all and things should bet back to normal when the library/toolkit/infrastructure upgrade phase is over.
I just came back from vacation. I’m planning on working on SlicerRT related stuff later this week, at least fixing the build error. Please note that I’ll not be able to address Mac specific stuff, but hopefully it won’t come up.
Can you give me more information on how to reproduce the crash when entering the EBP module? Thanks!
Thanks! It may be due to loading the dependencies (especially IECTransformLogic). I have seen this, but since there is no working debug build for Slicer I cannot debug it currently.
I just run the debugger (linux) with latest Slicer and SlicerRT and I got (when loading the EBP module at startup):
(gdb) run
Starting program: /home/davide/Development/Slicer/Slicer-SuperBuild-Debug/Slicer-build/bin/SlicerApp-realPython Exception <class ‘AttributeError’>: module ‘_thread’ has no attribute ‘_set_sentinel’[Thread debugging using libthread_db enabled]Using host libthread_db library “/lib/x86_64-linux-gnu/libthread_db.so.1”.Python Exception <class ‘AttributeError’>: module ‘_thread’ has no attribute ‘_set_sentinel’could not find minimal symbol for typeinfo address 0x5555555db660
Catchpoint 1 (exception caught), Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing0x00007fffc6abfedb in __cxa_begin_catch () from /lib/x86_64-linux-gnu/libstdc++.so.6(gdb) btPython Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missingPython Exception <class ‘AttributeError’>: module ‘_thread’ has no attribute ‘_set_sentinel’#0 0x00007fffc6abfedb in __cxa_begin_catch () from /lib/x86_64-linux-gnu/libstdc++.so.6#1 0x00007fffc6e283e2 in tbb::detail::r1::gcc_rethrow_exception_broken () at /localdisk/ci/runner006/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/exception.cpp:156Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#2 0x00007fffc6e29455 in tbb::detail::r1::governor::acquire_resources () at /localdisk/ci/runner006/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/governor.cpp:72Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#3 0x00007fffc6e36423 in tbb::detail::r1::__TBB_InitOnce::add_ref () at /localdisk/ci/runner006/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/main.cpp:94Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#4 0x00007fffc6e367dd in tbb::detail::r1::__TBB_InitOnce::__TBB_InitOnce (this=0x7fffc70a3460 <_INTERNALcc7d3d25::tbb::detail::r1::__TBB_InitOnceHiddenInstance>)at /localdisk/ci/runner006/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/main.h:73Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#5 0x00007fffc6e365c6 in __sti___ZN17_INTERNALcc7d3d253tbb6detail2r128__TBB_InitOnceHiddenInstanceE ()at /localdisk/ci/runner006/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/main.cpp:70Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#6 0x00007fffc6e36593 in sti$E () at /localdisk/ci/runner006/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/main.cpp:45Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#7 0x00007ffff7fc64af in call_init (Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missingl=, argc=argc@entry=1, argv=argv@entry=0x7fffffffafe8, env=env@entry=0x7fffffffaff8) at ./elf/dl-init.c:74#8 0x00007ffff7fc65c4 in call_init (l=, argc=, argv=, env=) at ./elf/dl-init.c:120#9 _dl_init (Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missingmain_map=0x7ffff7ffe310, argc=1, argv=0x7fffffffafe8, env=0x7fffffffaff8) at ./elf/dl-init.c:121#10 0x00007ffff7fe2760 in _dl_start_user () from /lib64/ld-linux-x86-64.so.2Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#11 0x0000000000000001 in ?? ()Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#12 0x00007fffffffb5c8 in ?? ()Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing#13 0x0000000000000000 in ?? ()Python Exception <class ‘NameError’>: Installation error: gdb._execute_unwinders function is missing
It seems some conflicts with tbb, but I have no further insight
EBP module seems to link to the right tbb Slicer installation:
davide@davide-MS-7C77:~/Development/Slicer/Extensions/SlicerRT-build/inner-build/lib/Slicer-5.9/qt-loadable-modules$ ldd /home/davide/Development/Slicer/Extensions/SlicerRT-build/inner-build/lib/Slicer-5.9/qt-loadable-modules/libqSlicerExternalBeamPlanningModule.so | grep -i tbb
libtbb_debug.so.12 => /home/davide/Development/Slicer/Slicer-SuperBuild-Debug/tbb-install/lib/intel64/gcc4.8/libtbb_debug.so.12 (0x00007983ffe00000)
Sorry, one question, how do you run gdb?
I tried with gdb --args ./inner-build/SlicerWithSlicerRT --no-splash
and then run, but I did not get extra info.
(I could not figure out how to call gdb SlicerAppReal and at the same time initialize the SlicerRT part.)
for running the debbuger, you can use QtCreator as descrived in C++ debugging with Qt Creator — 3D Slicer documentation (but with latest Slicer I am having issues with both QtCreator 17 and QtCreator 14.0.2: debugger does not start)
using gdb from terminal (from the inner Slicer-build folder):
./Slicer --launch gdb ./bin/SlicerApp-real
(for extensions, you would need to add the modules path manually)
Yes, I was seeing that with QtCreator, too, which is why I was trying instead directly from gdb. Good to see I’m not the only one (I had read the Guide you linked)
Regarding extensions, do you mean adding the following flags after SlicerApp-real? Or do I need to add them in the GUI?