Slicer for Ubuntu arm64

Problem: CTK fails to build
Issue:

  • QtOpenGLTimeMonitor is not available under GL ES2 (at least in 5.10.0)

PythonQt version under Slicer does not support OpenGL ES build.

Solution:
Workaround by manually removing non-OpenGL ES classes. Future fix upgrade PythonQt version.

Once I built Slicer on arm32. Please see here. I 'm surprised it 's so hard for arm64. Unfortunately, I don 't have any arm64 machine and can 't join in this effort. Good luck.

With OpenGL (ES) hardware acceleration?

I doubt it, didn 't even pay attention to that. The build was not usable in practice, VTK GPU rendering did not work, even the slices were not shown in the views. I 'll try a new build paying attention to OpenGL ES some weekend.

Yeah, that’s the kicker. I’m looking to produce a usable Slicer, hopefully.

For VTK, enable VTK_USE_SYSTEM_PNG, otherwise VTK builds libpng with NEON enabled.

Problem: libarchive fails to build
Solution: Add #include <sys/sysmacros.h> to <SlicerBuild>/LibArchive/libarchive/archive_pack_dev.c

Problem: zlib relocation errors
Solution: where present, use system zlib (via CMAKE_USE_SYSTEM_ZLIB, USE_BUILTIN_ZLIB, Slicer_USE_SYSTEM_zlib depending on project)

Problem: python-setuptools fails

/opt/dev/S4R/python-install/bin/PythonSlicer: 5: /opt/dev/S4R/python-install/bin/PythonSlicer: Syntax error: Unterminated quoted string

CMake Error at /opt/dev/S4/CMake/ExternalProjectForNonCMakeProject.cmake:104 (message):
  python-setuptools: bootstrap step failed with exit code '2'.

Solution: Just another effect of CTKAppLauncher being the wrong architecture. See solution for CTKAPPLAUNCHER is a download of amd64

Problem : CTK fails to build
Issue:
PythonQt version under Slicer does not support OpenGL ES build.

  • QtOpenGLTimeMonitor is not available under GL ES2 (at least in 5.10.0)

Solution :
In CTK/CMakeExternals/PythonQt.cmake:34, remove gui from the list of wrapped modules

Hint:
Set OpenGL_GL_PREFERENCE:STRING="GLVND" in PythonQt project

Notes:
My setup did not have Qt Designer built, so I disabled designer plugins in CTK.

Problem
SimpleITK compilation crashes (NanoPC-T4, 4GB ram, gcc 7.3)

Solution:
Disable SimpleITK
Possibly cross-compile if it’s a memory issue?

Disable all designer plugins for Slicer if designer is not available. -DSlicer_BUILD_QT_DESIGNER_PLUGINS:BOOL=OFF

Slicer wants vtkGUISupportQtOpenGL, see if workaround vtkGUISupportQt is enough

Just for information

I rebuilt Slicer on Odroid XU4 with a 32-bit ARM CPU. A clean build succeeded with this cmake config line :

#! Setting -DADDITIONAL_CXX_FLAGS -DCMAKE_C_FLAGS -DCMAKE_CXX_FLAGS is not sufficient.
#! export is required for python to build here
export CFLAGS=-I/usr/include/tirpc
export CXXFLAGS=-I/usr/include/tirpc; cmake -DSlicer_VTK_VERSION_MAJOR:INT=8 -DQt5_DIR:PATH=/usr/lib/cmake/Qt5 -DSlicer_USE_PYTHONQT_WITH_OPENSSL:BOOL=0 -DBUILD_TESTING:BOOL=0 -DCMAKE_BUILD_TYPE:STRING=Release -DSlicer_USE_SimpleITK:BOOL=0 …/Slicer

With a quick test, only one functionality is missing : viewing slices in 2D slice views ! With or without mali drivers. Volume rendering, segmention models show up. Slice data is visible in the 3D view, in the zoom preview (bottom left) but not in the RYG views. Would it really be an OpenGL ES problem ? I won’t insist of course, was just an experiment.

slicer_odroid_xu4

Does that machine/setup have OpenGL drivers for the Mali? If so, that simplifies things tremendously. Otherwise your setup is doing Mesa (software) rendering.

Looks like no, OpenGL ES 3.1. Would you check your VTK build to see if VTK_USE_OPENGL_ES is ON?

This Arch Linux for ARM (gcc 8.2) setup provides the following mali drivers :

libEGL.so.1.4, libGLESv1_CM.so.1.1, libGLESv2.so.2.0, libOpenCL.so.1.1, libmali.so

They are installed, nevertheless, the 2D views remain black. Didn’t find any OpenGL ES 3.x driver.

I tried to specify VTK_OPENGL_HAS_EGL, but VTK-build/CMakeCache.txt reported :

//The OpenGL library being used supports EGL
VTK_OPENGL_HAS_EGL:BOOL=OFF

So I just removed that flag during configure.

Perhaps this system is missing some library during build or at runtime.

Compiled! Trying to run, and the install for libs is <prefix>/lib/Slicer-4.11/libXYZ.so. If I configure <prefix>/lib (I have other programs installed in that prefix) under /etc/ld.so.conf.d/myconf.conf, it doesn’t seem to pickup subdirectories. Do I have to add Slicer-4.11 as a folder in my ld config?

And CTK libs are not installed… @jcfr to install Slicer from build tree is it simply make install from <SlicerSuperBuild>\Slicer-build ?