Compile errors Pop!_OS/Ubuntu with Qt 5.10

I now have Slicer building and running without fiddling with LD_LIBRARY_PATH. I think the issue was with the Build-qt.sh script.

Steps:

  1. Install Qt dependencies (for QtWebEngine-specific dependencies I referred to this page QtWebEngine/How to Try - Qt Wiki )
  2. Download the Qt-build script as per GitHub - jcfr/qt-easy-build at 5.10.0
  3. Open the script in a text editor. Scroll to the configure step near the end of the file (line 365 at time of writing). Change the -no-rpath option to -rpath. I changed:

./configure $qt_install_dir_options
[stuff]
-no-rpath \

to:

./configure $qt_install_dir_options
[stuff]
-rpath \

Note: I suspect simply removing the -rpath line would have the same result as removing it completely. I am not 100% sure of this though.

  1. Run the Qt-build script. It takes a while so I just left it overnight.
  2. Download and install Slicer dependencies as indicated on build instructions page: Documentation/Nightly/Developers/Build Instructions - Slicer Wiki
  3. Download Slicer source files.
  4. Create a script that has contents like the following:

cd S4D
cmake
-DQT_QMAKE_EXECUTABLE:FILEPATH=/media/vaughan/workspace/lnx/devel/Support/qt-everywhere-build-5.10.0/bin/qmake
-DQt5_DIR=/media/vaughan/workspace/lnx/devel/Support/qt-everywhere-build-5.10.0/lib/cmake/Qt5
-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_PREFIX_PATH:PATH=/media/vaughan/workspace/lnx/devel/Support/qt-everywhere-build-5.10.0/bin/
-DSlicer_USE_PYTHONQT_WITH_TCL:BOOL=OFF
-DSlicer_USE_SimpleITK:BOOL=OFF
-DSlicer_USE_QtTesting:BOOL=OFF
-DSlicer_VTK_VERSION_MAJOR:STRING=9
-DSlicer_VTK_RENDERING_BACKEND:STRING=OpenGL2
-DSlicer_BUILD_DataStore:BOOL=OFF
…/S4
make -j7

Make sure to set your Qt directories to wherever you built it.

  1. Run script. Like Qt, this will take a while.

With any luck, Slicer should build correctly. After doing these steps I do not need to run any export LD_LIBRARY_PATH commands.

I created an issue on GitHub for discussion: Ld trying to use system install of Qt5 · Issue #42 · jcfr/qt-easy-build · GitHub