Installation QT 5.11 on Raspberry Pi 3
-
Hello.
Im trying to install qt5.11 on my RPI 3. Now it has qt5.3 and quickcontrols 1.2, but i need to use quickcontrols 2.3.i downloaded source code and configure it with next:
../qt-everywhere-src-5.11.2/configure -v -opengl es2 -eglfs -no-gtk -device linux-rasp-pi-g++ \ -device-option CROSS_COMPILE=/usr/bin/ -opensource -confirm-license -reduce-exports \ -force-pkg-config -nomake examples -no-compile-examples -skip qtwayland -skip qtwebkit -skip qtwebengine -release \ -qt-pcre -ssl -evdev -system-freetype -fontconfig -glib -prefix /opt/qt5
but at the end of configuration process i have errors:
Note: Also available for Linux: linux-clang linux-icc Note: Disabling X11 Accessibility Bridge: D-Bus or AT-SPI is missing. WARNING: Cross compiling without sysroot. Disabling pkg-config ERROR: Feature 'pkg-config' was enabled, but the pre-condition 'tests.pkg-config' failed. ERROR: Feature 'glib' was enabled, but the pre-condition 'libs.glib' failed. ERROR: Feature 'system-freetype' was enabled, but the pre-condition 'features.freetype && libs.freetype' failed. ERROR: Feature 'fontconfig' was enabled, but the pre-condition '!config.win32 && features.system-freetype && libs.fontconfig' failed.
What i need to check to configure and compile qt5.11 on RPI 3 natively?
-
Hello.
Im trying to install qt5.11 on my RPI 3. Now it has qt5.3 and quickcontrols 1.2, but i need to use quickcontrols 2.3.i downloaded source code and configure it with next:
../qt-everywhere-src-5.11.2/configure -v -opengl es2 -eglfs -no-gtk -device linux-rasp-pi-g++ \ -device-option CROSS_COMPILE=/usr/bin/ -opensource -confirm-license -reduce-exports \ -force-pkg-config -nomake examples -no-compile-examples -skip qtwayland -skip qtwebkit -skip qtwebengine -release \ -qt-pcre -ssl -evdev -system-freetype -fontconfig -glib -prefix /opt/qt5
but at the end of configuration process i have errors:
Note: Also available for Linux: linux-clang linux-icc Note: Disabling X11 Accessibility Bridge: D-Bus or AT-SPI is missing. WARNING: Cross compiling without sysroot. Disabling pkg-config ERROR: Feature 'pkg-config' was enabled, but the pre-condition 'tests.pkg-config' failed. ERROR: Feature 'glib' was enabled, but the pre-condition 'libs.glib' failed. ERROR: Feature 'system-freetype' was enabled, but the pre-condition 'features.freetype && libs.freetype' failed. ERROR: Feature 'fontconfig' was enabled, but the pre-condition '!config.win32 && features.system-freetype && libs.fontconfig' failed.
What i need to check to configure and compile qt5.11 on RPI 3 natively?
@gogoer Is this being configured on the Pi itself? If so you aren't cross compiling then so you don't need the CROSS_COMPILE stuff.
If it's being done on a desktop then you need a sysroot in order to cross compile.
-
To add to what @ambershark has said, here is the cross compilation guide for Raspberry Pi: https://wiki.qt.io/RaspberryPi2EGLFS
One thing to note: Qt 5.11.1 did not compile on RPi at all (a bug in Qt). I'm not sure if it was fixed in Qt 5.11.2, but if not you'll see some compilation error complaining about QGeoSomething (can't remember the exact class name, sorry).
-
Yes i want to configure and compile it on RPI3 natively.
i deleted crosscompile option and have next configuration error:
+ g++ -dumpmachine > arm-linux-gnueabihf Checking for valid makespec... + cd /home/pi/opt/qt5/build/config.tests/verifyspec && /home/pi/opt/qt5/build/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared use_gold_linker warn_off console single_arch" -early "CONFIG += cross_compile" /home/pi/opt/qt5/qt-everywhere-src-5.11.2/qtbase/config.tests/verifyspec > Project ERROR: CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=<path> Note: Also available for Linux: linux-clang linux-icc ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
-
Use
linux-g++
mkspecs instead of the Raspberry Pi one when you compile natively. Start with onlyqtbase
and expect a lot of issues to solve along the way, especially in more complex modules. -
is there any version of qr >5.10 that compiles normally on raspberry pi?
i need to compile a little project with some gauges. Now i do it on qt5.3 wich goes with RPI in QTCreator. But i cant use QTQuickQontrols 2.3 there.@gogoer said in Installation QT 5.11 on Raspberry Pi 3:
is there any version of qr >5.10 that compiles normally on raspberry pi?
No idea.
qtbase usually compiles natively without issues. But it's definitely not checked regularly, as it is a niche use case. Last time I compiled qtbase + qtquick natively was around Qt 5.8 or 5.9 IIRC. It required some tweaking around OpenGL support. Maybe newer versions work, too, I don't know.
-
@sierdzio said in Installation QT 5.11 on Raspberry Pi 3:
Start with only qtbase
sorry, but what this means?
@gogoer said in Installation QT 5.11 on Raspberry Pi 3:
@sierdzio said in Installation QT 5.11 on Raspberry Pi 3:
Start with only qtbase
sorry, but what this means?
Qt is comprised of many repositories, which contain modules inside.
qtbase
is the most basic repo, and contains QtCore, QtGui, QtNetwork and some other stuff.If you want to compile only qtbase, you have 3 options:
- if you are using git repos, you need to call the
init_repository
script and specify qtbase only. More info: guide - if you are using Qt tarballs (I recommend this solution), you can simply remove all forlders apart from qtbase from the uncompressed tarball
- you can also pass
-skip qtmodulename
toconfigure
, but that would require you to pass all the modules apart from those found inqtbase
... that's a lot of typing
Then you just run
configure
as usual. - if you are using git repos, you need to call the
-
hi @gogoer
Just one side note. I periodically cross-compile qt with all working modules for rpi. This is done on a HP Z440 with 8 cores an 16GB RAM. The compilation takes about 2 hours.
But even if you just compile qtbase, prepare for a long long time to wait, way longer than set up the cross-toolchain on a desktop. -
what folders i need to leave if i want only use basecal QT, QTQuick and QTQuickControls 2.3 and QML.
@gogoer said in Installation QT 5.11 on Raspberry Pi 3:
what folders i need to leave if i want only use basecal QT, QTQuick and QTQuickControls 2.3 and QML.
- qtbase
- qtdeclarative
- qtquickcontrols2
Optionally:
- qtsvg
- qttools
- qtx11extras
- qtgraphicaleffects
- qtmultimedia
-
@sierdzio said in Installation QT 5.11 on Raspberry Pi 3:
Use linux-g++ mkspecs instead of the Raspberry Pi one when you compile natively.
what i need to do?
i deleted folders, except your list.
now i use config string:../qt-everywhere-src-5.11.2/configure -v -opengl es2 -eglfs -no-gtk -device linux-rasp-pi-g++ \ -opensource -confirm-license -reduce-exports \ -force-pkg-config -nomake examples -no-compile-examples -release \ -qt-pcre -ssl -evdev -system-freetype -fontconfig -glib -prefix /opt/qt5
but i have error:
Cannot compile minimal program. The toolchain or QMakeSpec is broken.
-
@sierdzio said in Installation QT 5.11 on Raspberry Pi 3:
Use linux-g++ mkspecs instead of the Raspberry Pi one when you compile natively.
what i need to do?
i deleted folders, except your list.
now i use config string:../qt-everywhere-src-5.11.2/configure -v -opengl es2 -eglfs -no-gtk -device linux-rasp-pi-g++ \ -opensource -confirm-license -reduce-exports \ -force-pkg-config -nomake examples -no-compile-examples -release \ -qt-pcre -ssl -evdev -system-freetype -fontconfig -glib -prefix /opt/qt5
but i have error:
Cannot compile minimal program. The toolchain or QMakeSpec is broken.
@gogoer said in Installation QT 5.11 on Raspberry Pi 3:
-device linux-rasp-pi-g++
Remove that, it should be enough.
If not, you can specify the mkspecs using this flag:
configure -platform linux-g++
-
Thank you!
configuration is successfull.
i start compilation bymake -j 4
and it compiles about an hour, then gives error:
make[3]: Leaving directory '/home/pi/otp/qt5/build/qtbase/src/testlib' make[2]: Leaving directory '/home/pi/otp/qt5/build/qtbase/src' Makefile:48: recipe for target 'sub-src-make_first' failed make[1]: *** [sub-src-make_first] Error 2 make[1]: Leaving directory '/home/pi/otp/qt5/build/qtbase' Makefile:52: recipe for target 'module-qtbase-make_first' failed make: *** [module-qtbase-make_first] Error 2
what i can do to solve this?
-
That output does not give details about any errors. Run
make
(without-j
) and / or look for real error in the output (something coming from either linker or the compiler). -
-
Whoa, that I have not seen before. Perhaps try with some older Qt release, maybe it won't trigger the compiler error. Also, disable tests as it seems to happen in test lib (
-nomake tests -nomake examples
). -
@gogoer said in Installation QT 5.11 on Raspberry Pi 3:
g++: internal compiler error: Segmentation fault (program cc1plus)
That might be an out of memory error. I used to see that when I tried to build Qt in a VM that was not given enough memory.