Planned maintenance has been done but it did not solve the problem. So work will continue on this and a new time for trying updates will be announced asap.

Compiling Qt5.14 for RaspberryPi4



  • 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.



  • Hi,

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



  • What is KMS actually?

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



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



  • 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


  • 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



  • 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.



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



  • 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



  • 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


Log in to reply