Qt 6.0 build from source on Raspberry Pi 4 "Opengl functionality tests failed"
-
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.
-
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.2So it's there, but I guess the Qt configuration is maybe looking in the wrong place for it?
-
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-devA few of these installed packages I didn't have before. After a reboot and rerunning the Qt6 configuration, same issue.
-
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-devThen 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.
-
@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.
-
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!
-
Great !
Thanks for providing the solution.
Ninja is one point I did not think about.
-
@Kelenyche said in Qt 6.0 build from source on Raspberry Pi 4 "Opengl functionality tests failed":
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!
Hi,
I am just starting with qt and cross compiling. I got the same error with ubuntu 22 and raspberry pi3 64 bit. I followed this tutorial. https://wiki.qt.io/Cross-Compile_Qt_6_for_Raspberry_Pi.
My doubt is,
1: How to install Ninja?
2: How to configure with it?Any help would be greatly appreciated.
-
- Using apt (apt install ninja-build)
- Pass this parameter to CMake: -GNinja
-
@jsulm
Thanks for the immediate reply.
1: ninja-build was already installed.
2: -GNinja argument was passed with the command.I ran the following script
cmake ../qt5/ -GNinja -DCMAKE_BUILD_TYPE=Release -DINPUT_opengl=es2 -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF -DQT_HOST_PATH=$HOME/qt-host -DCMAKE_STAGING_PREFIX=$HOME/qt-raspi -DCMAKE_INSTALL_PREFIX=/usr/local/qt6 -DCMAKE_TOOLCHAIN_FILE=$HOME/toolchain.cmake -DQT_QMAKE_TARGET_MKSPEC=devices/linux-rasp-pi4-aarch64 -DQT_FEATURE_xcb=ON -DFEATURE_xcb_xlib=ON -DQT_FEATURE_xlib=ON
-
@hareendran-tl And what is the problem?
You should now be able to build using ninja. -
@jsulm
This is the error i getting.ERROR: The OpenGL functionality tests failed! You might need to modify the OpenGL package search path by setting the OpenGL_DIR CMake variable to the OpenGL library's installation directory.
CMake Error at qtbase/cmake/QtBuildInformation.cmake:181 (message):
Check the configuration messages for an error that has occurred.
Call Stack (most recent call first):
qtbase/cmake/QtBuildInformation.cmake:21 (qt_configure_print_summary)
CMakeLists.txt:111 (qt_print_feature_summary)