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. Compiling Qt5.14 for RaspberryPi4
Forum Updated to NodeBB v4.3 + New Features

Compiling Qt5.14 for RaspberryPi4

Scheduled Pinned Locked Moved Solved Mobile and Embedded
10 Posts 3 Posters 2.5k Views 3 Watching
  • 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.
  • M Offline
    M Offline
    maxwell31
    wrote on 3 Oct 2019, 12:49 last edited by
    #1

    Hi,

    I am trying to cross compile Qt5.14 ( git clone git://code.qt.io/qt/qt5.git -b 5.14) for the RaspberryPi4. I saw that in https://code.qt.io/cgit/qt/qtbase.git/tree/mkspecs/devices there is already an entry for linux-rasp-pi4-v3d-g++.

    I used Raspbian Buster installed via NOOBS to my raspberry, and mount the raspberry via sshfs to /opt/raspberry/sysroot/. In order to avoid problems with symbolic links I ran "sudo symlinks -cr ." in the root directory on my raspberry.

    For the toolchain I used https://releases.linaro.org/components/toolchain/binaries/latest-7/arm-linux-gnueabihf/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf.tar.xz (which should work according to https://code.qt.io/cgit/qt/qtbase.git/tree/mkspecs/devices/linux-rasp-pi4-v3d-g++/qmake.conf)

    This is the configure script I used:

    ./configure -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/raspberry/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-  -sysroot /opt/raspberry/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix /opt/raspberry/qt5pi -hostprefix /opt/raspberry/qt5pi_host -v
    

    However, configure reports the following problem

    ERROR: The OpenGL functionality tests failed!
    You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2],
    QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform.
    

    Thus, I tried to follow the suggestion on https://wlhe.github.io/2018/01/Build-Qt5.10-for-Raspberry-PI3 and set the following variables in tbase/mkspecs/devices/linux-rasp-pi4-v3d-g++/qmake.conf

    VC_LIBRARY_PATH         = $$[QT_SYSROOT]/opt/vc/lib
    VC_INCLUDE_PATH         = $$[QT_SYSROOT]/opt/vc/include
    
    QMAKE_LIBDIR_OPENGL_ES2 = $${VC_LIBRARY_PATH}
    QMAKE_LIBDIR_EGL        = $$QMAKE_LIBDIR_OPENGL_ES2
    QMAKE_LIBDIR_OPENVG     = $$QMAKE_LIBDIR_OPENGL_ES2
    
    QMAKE_INCDIR_EGL        = \
                            $${VC_INCLUDE_PATH} \
                            $${VC_INCLUDE_PATH}/interface/vcos/pthreads \
                            $${VC_INCLUDE_PATH}/interface/vmcs_host/linux
    QMAKE_INCDIR_OPENGL_ES2 = $${QMAKE_INCDIR_EGL}
    QMAKE_INCDIR_OPENVG     = $${QMAKE_INCDIR_EGL}
    

    and I also tried setting the following links:

    $ sudo ln -s libbrcmEGL.so libEGL.so
    $ sudo ln -s libbrcmGLESv2.so libGLESv2.so
    $ sudo ln -s libbrcmOpenVG.so libOpenVG.so
    $ sudo ln -s libbrcmWFC.so libWFC.so
    

    Still I get the same result.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      matzrm
      wrote on 7 Oct 2019, 09:06 last edited by
      #2

      Hi,

      did you have enabled fake kms driver through raspi-config?

      1 Reply Last reply
      0
      • M Offline
        M Offline
        maxwell31
        wrote on 7 Oct 2019, 09:48 last edited by maxwell31 10 Jul 2019, 09:54
        #3

        What is KMS actually?

        I just tried to compile with enabling it in raspi-config, but it does not make a difference.

        1 Reply Last reply
        0
        • O Offline
          O Offline
          oniongarlic
          wrote on 7 Oct 2019, 09:58 last edited by
          #4

          Read the full verbose log for the exact check that fails. Make sure you have all required development packages installed.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            matzrm
            wrote on 7 Oct 2019, 10:07 last edited by
            #5

            Ok,
            Start from scratch with the latest Raspian Image Light

            Enable fkms, by raspi-config -> Advanced -> GL Driver.
            Add more graphic memory (256 for examble) by raspi-config -> Advanced -> Memory Split

            Install these packages:

            # qtbase
            sudo apt-get install libboost1.58-all-dev libudev-dev libinput-dev libts-dev libmtdev-dev libjpeg-dev libfontconfig1-dev libssl-dev libdbus-1-dev libglib2.0-dev libxkbcommon-dev libegl1-mesa-dev libgbm-dev libgles2-mesa-dev mesa-common-dev
            
            # qtmultimedia
            sudo apt-get install libasound2-dev libpulse-dev gstreamer1.0-omx libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev  gstreamer1.0-alsa
            
            # qtwebengine
            sudo apt-get install libvpx-dev libsrtp0-dev libsnappy-dev libnss3-dev
            
            1 Reply Last reply
            0
            • M Offline
              M Offline
              maxwell31
              wrote on 7 Oct 2019, 10:33 last edited by
              #6

              I installed the suggested libraries, but it does not change anything. Does it have something to do with this?
              https://wiki.gentoo.org/wiki/Raspberry_Pi_VC4

              1 Reply Last reply
              0
              • M Offline
                M Offline
                matzrm
                wrote on 7 Oct 2019, 10:49 last edited by matzrm 10 Jul 2019, 10:56
                #7

                Have you enabled fmks driver?
                Have you made a re-sync of the sysroot after have installed the plugins on the raspberry?
                Are you started from scratch?Make a git clean -dfx before execute the configure command.

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  maxwell31
                  wrote on 7 Oct 2019, 10:56 last edited by maxwell31 10 Jul 2019, 10:57
                  #8

                  Hm, I might be mistaken, I guess installing the above libraries changed something. I will report more later

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    maxwell31
                    wrote on 8 Nov 2019, 15:20 last edited by
                    #9

                    I succeeded in compiling Qt 5.14. After I compiled, I tried to cross compile a program for the Raspberry. This also worked, but when executing the program on the Raspberry I got a complaint that it could not find libQt5QuickControls2.so.5. I set LD_LIBRARY_PATH correctly, but in the lib directory, there are the Qt libraries but no library for QuickControls2. Do I need to set an option to build it? I also wonder how it was possible to compile if this library was missing

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      maxwell31
                      wrote on 11 Nov 2019, 08:58 last edited by
                      #10

                      The problem was that cross compilation was successfull but make install had an error relating to qt3d, thus the quickcontrols2 dll did not get copied to the right directory

                      1 Reply Last reply
                      1

                      • Login

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