Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D Slicer build fails on Ubuntu 22.04 due to qt tools path resolution #8110

Open
RafaelPalomar opened this issue Dec 21, 2024 · 0 comments · May be fixed by #8111
Open

3D Slicer build fails on Ubuntu 22.04 due to qt tools path resolution #8110

RafaelPalomar opened this issue Dec 21, 2024 · 0 comments · May be fixed by #8111

Comments

@RafaelPalomar
Copy link
Contributor

Summary

When building 3D Slicer, the qt_root_dir resolution in CMake is incorrect on Ubuntu 22.04 LTS due to the presence of the architecture-specific subdirectory x86_64-linux-gnu. This causes issues when building Slicer, as Qt tools like lconvert are not found in the expected location.

Steps to reproduce

  1. Attempt to build Slicer on Ubuntu 22.04 LTS with the Qt distributed by the package manager.

  2. Observe the following error during the CMake configuration step:

    CMake Error at CMake/SlicerBlockInstallQtTools.cmake:62 (message):
      Qt tool lconvert not found: /usr/lib/x86_64-linux-gnu/../bin/lconvert
    Call Stack (most recent call first):
      CMake/SlicerCPack.cmake:31 (include)
      CMake/LastConfigureStep/CMakeLists.txt:44 (include)
    
  3. The error occurs because the qt_root_dir is incorrectly resolved as /usr/lib/../, leading to an invalid path for lconvert. The actual path can be found as follows:

find /usr -name lconvert
/usr/bin/lconvert
/usr/lib/qt5/bin/lconvert
/usr/lib/x86_64-linux-gnu/qt5/bin/lconvert

Actual behavior

The qt_root_dir resolves to /usr/lib/../ on Ubuntu 22.04 LTS, which evaluates to /usr/lib/ instead of /usr. As a result, the path to Qt tools such as lconvert is incorrect, and the build fails.

Expected behavior

The qt_root_dir should resolve to /usr regardless of the presence of architecture-specific subdirectories like x86_64-linux-gnu. This would ensure that Qt tools are located correctly, and the build proceeds without errors.

Suggested Solution

Modify the CMake code to account for architecture-specific subdirectories by adding a check for x86_64-linux-gnu.

Environment

  • Slicer version: N/A (CMake configuration issue)
  • Operating system: Ubuntu 22.04 LTS
  • System details:
     lsb_release -a
     No LSB modules are available.
     Distributor ID:	Ubuntu
     Description:	Ubuntu 22.04.5 LTS
     Release:	22.04
     Codename:	jammy
    
  • Error log:
    CMake Error at CMake/SlicerBlockInstallQtTools.cmake:62 (message):
      Qt tool lconvert not found: /usr/lib/x86_64-linux-gnu/../bin/lconvert
    Call Stack (most recent call first):
      CMake/SlicerCPack.cmake:31 (include)
      CMake/LastConfigureStep/CMakeLists.txt:44 (include)
    
RafaelPalomar added a commit to RafaelPalomar/Slicer that referenced this issue Dec 21, 2024
This commit fixes Slicer#8110 by adding a case for correct
detection of `qt_root_dir` for Ubuntu multiarch directory structure.
@RafaelPalomar RafaelPalomar linked a pull request Dec 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant