Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt6 cross compile for imx6 with Wayland support
Forum Updated to NodeBB v4.3 + New Features

Qt6 cross compile for imx6 with Wayland support

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 1 Posters 2.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Harlock21
    wrote on last edited by
    #1

    Hi all,
    I am trying to cross compile Qt6 for the imx6 target with the Wayland support.
    In the imx6 sysroot I have the wayland includes just as the libraries needed to achieve the task but when I trigger the configuration stage with cmake I get such wired error for what it concerns wayland:

    Configuring submodule 'qtwayland'
    -- Could NOT find Qt6WaylandScannerTools (missing: Qt6WaylandScannerTools_DIR)
    CMake Error at qtbase/cmake/QtToolHelpers.cmake:170 (message):
    The tool "Qt6::qtwaylandscanner" was not found in the
    Qt6WaylandScannerTools package. Package found: 0
    Call Stack (most recent call first):
    qtwayland/src/qtwaylandscanner/CMakeLists.txt:8 (qt_internal_add_tool)

    The cmake build configuration is arranged as follows:
    cmake -B buildQt6_ARM . -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/home/michal/toolchains/armxl2-toolchain.cmake -DCMAKE_INSTALL_PREFIX=/opt/Qt6_ARM -DCMAKE_STAGING_PREFIX=/opt/Qt6_ARM -DQT_HOST_PATH=/opt/Qt6 -DQT_QMAKE_TARGET_MKSPEC=integrity-armv7-imx6 -DQT_BUILD_EXAMPLES=FALSE -DQT_BUILD_TESTS=FALSE -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON -DBUILD_qtwayland=ON -DBUILD_WITH_PCH=OFF -DINPUT_reduce_exports=yes -DINPUT_optimize_size=yes -DBUILD_qtdoc=OFF -DBUILD_qtwebengine=OFF -DBUILD_qtwebview=OFF -DBUILD_qtmultimedia=OFF

    Thank you in advance for any help.

    1 Reply Last reply
    0
    • H Offline
      H Offline
      Harlock21
      wrote on last edited by Harlock21
      #2

      Looking in the CMakeError.log file it seems that the wayland test tries to use the vulkan API.
      Is there any chance to instruct the wayland module to be built up by using EGL instead of vulkan?
      Thanks

      1 Reply Last reply
      0
      • H Offline
        H Offline
        Harlock21
        wrote on last edited by Harlock21
        #3

        Guys I can partially understand that maintaining the whole Qt framework is really a hard task but it is unthinkable at the same time that a develope should go through all the cmake rules to understand why a fancy Qt6WaylandScannerTools module is trying to use vulkan when vulkan is absent.
        From what I ve seen the CMakeOutput.log shows that the wayland tests are using the egl API while for some obscure reason there is one test that is trying to use vulkan during the Qt6WaylandScannerTools module processing.
        You can imagine how much joy a developer can feel especially when he has to deal with deadlines and the whole work still to be done.

        1 Reply Last reply
        0
        • H Offline
          H Offline
          Harlock21
          wrote on last edited by
          #4

          Just to recap - this is the error stated into the CMakeError.log:

          /home/michal/work/armxl-buildroot/output_imx6_rootfs/host/bin/arm-buildroot-linux-gnueabihf-g++ --sysroot=/home/michal/work/armxl-buildroot/output_imx6_rootfs/host/arm-buildroot-linux-gnueabihf/sysroot -DHAVE_vulkan_server_buffer -march=armv7-a -mfpu=neon -mfloat-abi=hard -fPIE -std=gnu++17 -o CMakeFiles/cmTC_e567f.dir/src.cxx.o -c /home/michal/Downloads/qt-everywhere-src-6.3.1/buildQt6_ARM/CMakeFiles/CMakeTmp/src.cxx
          /home/michal/Downloads/qt-everywhere-src-6.3.1/buildQt6_ARM/CMakeFiles/CMakeTmp/src.cxx:2:10: fatal error: vulkan/vulkan.h: No such file or directory
          #include <vulkan/vulkan.h>
          ^~~~~~~~~~~~~~~~~
          compilation terminated.
          ninja: build stopped: subcommand failed.

          Source file was:
          #define VK_USE_PLATFORM_WAYLAND_KHR 1
          #include <vulkan/vulkan.h>

          int main(int argc, char *argv)
          {
          (void)argc; (void)argv;
          /
          BEGIN TEST: /
          VkExportMemoryAllocateInfoKHR exportAllocInfo = {};
          exportAllocInfo.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR;
          exportAllocInfo.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;
          return 0;
          /
          END TEST: */
          return 0;
          }

          Even by passing the the feature flag -DFEATURE_wayland_vulkan_server_buffer=OFF
          the build configuration is trying to pick up vulkan API.

          1 Reply Last reply
          0
          • H Offline
            H Offline
            Harlock21
            wrote on last edited by
            #5

            This is the resolution:

            Building Qt6 for the x86_64 target (host machine)

            The dependencies to be installed first:
            sudo apt install libxi-dev
            sudo apt install libxkbcommon-x11-dev
            sudo apt install libx11-xcb-dev
            sudo apt install libxcb-glx0-dev
            sudo apt install libxcbutil-icccm
            sudo apt install libxcbutil
            sudo apt install libxcb-devel
            sudo apt install libxcb-dev
            sudo apt install libfontconfig1-dev libfreetype6-dev libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxkbcommon-dev libxkbcommon-x11-dev libxcb-xinerama0-dev
            sudo apt install libxcb-icccm4-dev

            sudo apt install vulkan-utils -or- sudo apt install vulkan-tools
            sudo apt install vulkan-headers -or- sudo apt install libvulkan-dev
            sudo apt install libvulkan1 mesa-vulkan-drivers
            sudo apt install libnvidia-egl-wayland-dev #for nvidia proprietary adapters
            sudo apt install libnvidia-egl-wayland-dev
            sudo apt install libwayland-*

            The cmake command that should be issued (with few minor exceptions) is:

            cmake -B buildQt6 . -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/Qt6 -DCMAKE_STAGING_PREFIX=/opt/Qt6 -DQT_BUILD_TESTS=FALSE -DQT_BUILD_EXAMPLES=FALSE -DBUILD_qtwebengine=OFF -DBUILD_qtwayland=ON
            Then we should issue at fist the compilation and then the install cmake commands:

            cd buildQt6
            cmake --build . --parallel
            *** it will take eons ***
            sudo cmake --install .
            Building Qt6 for the imx6 target

            The cmake command that should be issued (with few minor exceptions) is:

            cmake -B buildQt6_ARM . -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/path-to/armxl2-toolchain.cmake -DCMAKE_INSTALL_PREFIX=/opt/Qt6_ARM -DCMAKE_STAGING_PREFIX=/opt/Qt6_ARM -DQT_HOST_PATH=/opt/Qt6 -DQT_QMAKE_TARGET_MKSPEC=devices/linux-imx6-g++ -DBUILD_qtwayland=ON -DQT_BUILD_EXAMPLES=FALSE -DQT_BUILD_TESTS=FALSE -DCMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE=ON -DBUILD_WITH_PCH=OFF -DINPUT_reduce_exports=yes -DINPUT_optimize_size=yes -DBUILD_qtdoc=OFF -DBUILD_qtwebengine=OFF -DBUILD_qtwebview=OFF -DBUILD_qtmultimedia=OFF -DFEATURE_xcb=OFF -DQT_FEATURE_brotli=OFF -DQT_FEATURE_hunspell=OFF
            Then just as it has been done for the x86_64 target:

            cd buildQt6_ARM
            cmake --build . --parallel
            *** it will take eons ***
            sudo cmake --install .

            The armxl2-toolchain.cmake file:

            cmake_minimum_required(VERSION 3.15)
            include_guard(GLOBAL)

            set(CMAKE_SYSTEM_NAME Linux)
            set(CMAKE_SYSTEM_PROCESSOR arm)

            set(TARGET_SYSROOT /path-to-imx6-sysroot)
            set(CROSS_COMPILER /path-to/arm-linux-gnueabihf-)

            set(CMAKE_SYSROOT ${TARGET_SYSROOT})

            set(CMAKE_C_COMPILER ${CROSS_COMPILER}gcc)
            set(CMAKE_CXX_COMPILER ${CROSS_COMPILER}g++)

            set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
            set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
            set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
            set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

            1 Reply Last reply
            0
            • M MAWE referenced this topic on

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved