Important: Please read the Qt Code of Conduct -

Qt 6.0 build from source on Raspberry Pi 4 "Opengl functionality tests failed"

  • Hi everyone,
    I'm trying to build Qt6 from source on the Raspberry Pi 4.
    I'm using the 64 bit image: raspios_arm64-2020-08-24
    I'm running into an issue doing the configuration; I'm running:
    ./configure -release -opensource -confirm-license -prefix /home/Desktop/Qt6/build
    I've added a few other parameters to the command, but no fix so far

    It works for a bit, and spits out the error message:

    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.
    CMake Error at qtbase/cmake/QtBuildInformation.cmake:66 (message):
      Check the configuration messages for an error that has occurred.
    Call Stack (most recent call first):
      qtbase/cmake/QtBuildInformation.cmake:10 (qt_configure_print_summary)
      CMakeLists.txt:87 (qt_print_feature_summary)
    -- Configuring incomplete, errors occurred!
    See also "/home/pi/Desktop/Qt6/src/CMakeFiles/CMakeOutput.log".
    See also "/home/pi/Desktop/Qt6/src/CMakeFiles/CMakeError.log".
    CMake Error at qtbase/cmake/QtProcessConfigureArgs.cmake:788 (message):
      CMake exited with code 1.

    I've done a lot of digging on the internet, and it looks like this was a common issue for the 5.x versions of Qt as well, but a lot of the solutions involve modifying the qmake.config file, which isn't used anymore.
    I've installed a bunch of opengl libraries now, but nothing has changed each time. I also enabled opengl on the Pi via the config menu.

    I can't think of any more details now, but if you ask I can probably give you an answer!
    Thanks for the help!

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Did you restart from a clean state after your various tests ?

  • Yes I have, no change to the error.

  • Lifetime Qt Champion

    Did you check the test logs to see what exactly has failed ?

  • I have, but I'm not able to discern much of use from them. There's not really any mention of opengl in them, so I can't see exactly what's failing. I'd post the whole thing but the files are HUGE. Is that useful? Also fyi I'm limited in how often I can post since I'm new. :)

    it does look like a lot of the actions had this failure:

    Performing C++ SOURCE FILE Test HAVE_d2d1_1 failed with the following output:
    Change Dir: /home/pi/Desktop/Qt6/src/CMakeFiles/CMakeTmp

    I can't tell if that's useful.

  • Lifetime Qt Champion

    Might be a silly question but did you install the dev packages of the OpenGL libraries ?

  • Yes, I've installed a bunch of different opengl packages based on similar threads around the internet.
    fwiw I can't see it in the /usr/lib directory, but I'm not 100% that's where it should be.
    running glxinfo "grep "OpenGL version" gives: 2.1 Mesa 19.3.2

    So it's there, but I guess the Qt configuration is maybe looking in the wrong place for it?

  • Lifetime Qt Champion

    There's the catch: you have the normal package to use by application and you have their dev version for development purpose hence my question about them being installed.

  • I'm not sure this is the issue - probably the command I ran to get the version only shows the normal package, I don't know how to show the dev package versions. To make sure I went back through all the steps I could find to install dev packages:
    sudo apt-get install freeglut3
    sudo apt-get install freeglut3-dev
    sudo apt-get install binutils-gold
    sudo apt-get install libglew-dev
    sudo apt-get install mesa-common-dev
    sudo apt-get install libglew1.5-dev libglm-dev
    sudo apt-get install libgles2-mesa-dev
    sudo apt-get install xorg-dev

    A few of these installed packages I didn't have before. After a reboot and rerunning the Qt6 configuration, same issue.

  • Lifetime Qt Champion

    One thing that you can do is to install the build dependencies of the Qt 5 OpenGL package.

    apt-get build-dep libqt5opengl5

  • It seemed so promising! But the same error at the end.

    I'll list out what I did so the next poor lost soul can follow along.
    so for me that returned an error: You must put some source URIs in your sources.list.
    I went to etc/apt/sources.list and uncommented the bottom three lines.
    After retrying, it said two packages were missing, one of which had another dependent package that was missing.

    sudo apt-get install libgtk-3-dev
    sudo apt-get install libegl-mesa0
    sudo apt-get install libgbm-dev

    Then I retried your command, and it spent a while building everything. But like I said when I tried the ./configure stuff again I ended with the same message.

  • So maybe it's worth noting the reason I'm building from source is because the online installer executable isn't running on my pi. I'm running the new 64-bit Raspberry Pi OS image, but it's not recognizing the 64-bit executable. Googling that hasn't been much help, it's mostly people that have mismatched the executable and operating system, but as far as I can tell, mine should match. Any insight there? If I get that working life might be a lot easier.

  • Lifetime Qt Champion

    @Kelenyche said in Qt 6.0 build from source on Raspberry Pi 4 "Opengl functionality tests failed":

    but it's not recognizing the 64-bit executable

    Do you mean the online installer from Qt Company web site? That one is for x86_64, not ARM.

  • Ah, that makes sense. So that means if I'm gonna get this installed on a Pi I have to build from source then.

  • Holy Geez I solved it!

    I decided to just start going through the entire log that it blurts out after running the configure script. One of the first warnings was that I had the default build package (I forgot the name) instead of Ninja, but Qt is made to work with Ninja, so use the default at your own risk. I installed Ninja, and it configured just fine and is building now!

  • Lifetime Qt Champion

    Great !

    Thanks for providing the solution.

    Ninja is one point I did not think about.

Log in to reply