Can't start Slicer on Linux on one machine

with the very same ( i think) environment, i tried to repeat the success in an adjacent folder, just to make sure I really got it right. But this time the building stopped in the middle due to the python site module problem.

And i just realized that even for the “success build” i have, it actually is not so right: the numpy is not loaded:

Traceback (most recent call last):
File “”, line 1, in
File “/media/pv/data/pv/usr/work/namic/rls20191029/Slicer-sb/python-install/lib/python3.6/imp.py”, line 170, in load_source
module = _exec(spec, sys.modules[name])
File “”, line 618, in _exec
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/media/pv/data/pv/usr/work/namic/rls20191029/Slicer-sb/Slicer-build/lib/Slicer-4.11/qt-scripted-modules/DICOMScalarVolumePlugin.py”, line 1, in
import numpy
ModuleNotFoundError: No module named ‘numpy’
Traceback (most recent call last):
File “”, line 1, in
File “/media/pv/data/pv/usr/work/namic/rls20191029/Slicer-sb/python-install/lib/python3.6/imp.py”, line 170, in load_source
module = _exec(spec, sys.modules[name])
File “”, line 618, in _exec
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/media/pv/data/pv/usr/work/namic/rls20191029/Slicer-sb/Slicer-build/lib/Slicer-4.11/qt-scripted-modules/Editor.py”, line 4, in
import EditorLib
File “/media/pv/data/pv/usr/work/namic/rls20191029/Slicer-sb/Slicer-build/lib/Slicer-4.11/qt-scripted-modules/EditorLib/init.py”, line 37, in
exec(“from .{0} import {0}Options, {0}Tool, {0}Logic, {0}”.format(effectName))
File “”, line 1, in
File “/media/pv/data/pv/usr/work/namic/rls20191029/Slicer-sb/Slicer-build/lib/Slicer-4.11/qt-scripted-modules/EditorLib/PaintEffect.py”, line 10, in
import numpy
ModuleNotFoundError: No module named ‘numpy’
Traceback (most recent call last):
File “”, line 1, in
File “/media/pv/data/pv/usr/work/namic/rls20191029/Slicer-sb/python-install/lib/python3.6/imp.py”, line 170, in load_source
module = _exec(spec, sys.modules[name])
File “”, line 618, in _exec
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/media/pv/data/pv/usr/work/namic/rls20191029/Slicer-sb/Slicer-build/lib/Slicer-4.11/qt-scripted-modules/MultiVolumeImporterPlugin.py”, line 5, in
import vtk.util.numpy_support
File “/media/pv/data/pv/usr/work/namic/rls20191029/Slicer-sb/VTK-build/lib/python3.6/site-packages/vtkmodules/util/numpy_support.py”, line 31, in
import numpy
ModuleNotFoundError: No module named ‘numpy’
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘numpy’ is not defined

I’m investigating and will report back

I quickly run through this topic and I see that people build Slicer on their linux computer.
My question is ‘Why?’

I also run Slicer on a linux machine (LinuxMint 19.1) and I have never build it on that!
Just downloaded the linux package from the site, unpacked it in a folder called ‘Slicer’ and then run the executable ‘slicer’.
That’s it!

You have probably not used it long enough to say ‘Ooops! what’s happening ? Where is Slicer ?’. That happened twice to me, building it was the only way in these situations.

It is quite likely that the same Slicer binaries don’t work correctly on all Linux flavours and configurations, but I guess most Linux users chose the platform because they prefer to have more control over their systems and got used to building components on their own.

Yes, and those same Linux systems tend to have variability in compiler versions and directory layouts, so some build issues can be expected from time to time. It’s actually kind of remarkable that some much works well most of the time.

Ever thought about distributing Slicer as a Flatpak? :wink:
https://flatpak.org/

Other software packages also use this (check it out for yourself).

coz i’m developing based on Slicer. that needs building from source.

Yes, and there’s also https://snapcraft.io/. Could be handy if anyone wants to take it on.

But realistically it hasn’t come up that often - the linux binaries we build seem to be pretty compatible with the distributions I use anyway.

by usnig strace SlicerApp-real, it seems that slicer is searching for libssl.so.1.1 in many places, with no luck.

However, in the entire superbuilld dir, i found ssl lib in:
./OpenSSL/libssl.so.1.0.0

Also in cmake, the default ssl version is 1.0.2n

I’m trying to see where in the process the 1.1 is requested…

Hi Steve, Hi Andras, @pieper @lassoan

I believed the problem on my machine was that python needs openssl 1.1.0 and up. I then upgraded openssl super build version to 1.1.1d. It then requires curl to be upgraded to 7.66, which I did, and it worked.

I believe this may be related with several recent issues:

Now I have a freshly built Slicer…

It is great that you were able to figure out all these and thank you very much for sharing the results.

@jcfr @Sam_Horvath Can you make the necessary changes in Slicer’s build system?

@gaoyi.cn Yes, nice work Yi! Is there a chance you could make a pull request with the needed changes?

Oops, I see you already made a PR https://github.com/Slicer/Slicer/pull/1245/files

@gaoyi.cn are these the right fixes? I’m curious why you closed it.

Hi Steve,

I recently did many test builds on different machines under different internet connection conditions. I believe the proposed changes does solve my problem. So I put them together and create a new pull request. Please advice.

Thanks!
yi

1 Like

Hi Yi -

Were you doing a debug build or a release build? For me (debug build on mac), with the new curl the library had an extra -d in the filename and I could only link if I renamed the file.

See: https://github.com/Slicer/Slicer/pull/1260

-Steve

HI Steve,

I did release build before. Let me try a Debug build on linux.

Previously, the configuration for building a static curl was by " -DCURL_STATICLIB:BOOL=ON" in the SuperBuild/External_curl.cmake file.

After changing to the newer version, this flag was not recognized. Changing to
-DBUILD_SHARED_LIBS:BOOL=OFF
solved my problem in release build on LInux.

Let me try debug and report back.

yi

1 Like

Hi Steve,

Yes I reproduced your building error in Debug mode.

Moreover, in the debug mode, the libArchive has to be changed following your suggestion in
https://issues.slicer.org/view.php?id=4616

I’m investigating the libcurl-d.a the “-d” problem and will report back.

–yi

I’ve updated Slicer’s LibArchive version a few days ago. Manual patching should not be necessary anymore.

Hi Steve,

The curl lib is modified (slightly) so the debug build does not post-fix the “-d”. I’ll create another pull request.

Now it builds on both debug and release modes.

Best,
yi

1 Like

Hello, I faced the same errors as @gaoyi.cn, on Linux Mint 19, latest git commit, Debug version. But my problem resulted from using system Qt libraries (5.9.5). Change to 5.11.3 from https://download.qt.io/archive/qt/ solved the problem.

I just mention it, if anyone else would fall into this issue.

1 Like