Compiled binaries of Qt 5.3 for the Raspberry Pi (ARMv6) and Pi 2 (ARMv7-A)

At the time of writing Qt 5.4 release existed but I found it has number of bugs that affect multimedia capabilities of the Raspberry Pi.

Download the following binary release and install using following instructions. Instructions assume you still have the user pi in your Raspberry Pi system and make command installed as well (sudo apt-get install make). For the wget command, use the address found in “Download” link below the instructions.

ssh pi@<ip-of-the-rpi>

mkdir -p Qt5.3.2/qt-everywhere-opensource-src-5.3.2

cd Qt5.3.2

wget https://s3-ap-southeast-2.amazonaws.com/purinda.com/raspberrypi/qt-everywhere-opensource-src-5.3.2_compiled_armv7l.tar.gz

tar xf qt-everywhere-opensource-src-5.3.2_compiled_armv7l.tar.gz -C qt-everywhere-opensource-src-5.3.2

cd qt-everywhere-opensource-src-5.3.2

sudo make install

After running “make install”, binaries will be copied to the /usr/local/qt5 so you can remove the /home/pi/Qt5.3.2 directory.

Raspberry Pi still doesn’t know how to use the Qt 5.3.2 libraries as we haven’t instructed where the library files are. So you need to edit your .bashrc and stick following lines in there which sources the Qt libraries.

export LD_LIBRARY_PATH=/usr/local/qt5/lib/
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/qt5/bin

Precompiled binaries: Download

The problem

If you are like me running Raspbian on your “Raspberry Pi” or “Raspberry Pi 2”, you will figure out that Raspbian pointing to the following package repository doesn’t contain Qt libraries.

deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi

Then tried searching for a solution and almost all require you to Cross-compile qt source, which I am not a big fan of as you need to cross-compile dependencies of Qt libraries to get Qt to compile without choking on some incorrectly cross-compiled dependency.

So I thought of compiling the Qt source package on shiny new Raspberry Pi 2, which has quad-cores and 1GB of RAM so I thought it will be faster to compile directly on it, and ran the ./configure and make -j3 (-j3 here is telling make command to use 3-cores to compile) with following settings enabled.

Build options:
Configuration ………. accessibility accessibility-atspi-bridge alsa audio-backend c++11 clock-gettime clock-monotonic concurrent cups dbus evdev eventfd fontconfig full-config getaddrinfo getifaddrs glib iconv icu inotify ipv6ifname large-config largefile libudev linuxfb medium-config minimal-config mremap nis no-harfbuzz openssl pcre png posix_fallocate precompile_header pulseaudio qpa qpa reduce_exports release rpath shared small-config system-freetype system-jpeg system-png system-zlib xcb xcb-glx xcb-plugin xcb-render xcb-xlib xinput2 xkbcommon-qt xlib xrender
Build parts ………… libs
Mode ………………. release
Using C++11 ………… yes
Using PCH ………….. yes
Target compiler supports:
iWMMXt/Neon ………. no/auto

Qt modules and options:
Qt D-Bus …………… yes (loading dbus-1 at runtime)
Qt Concurrent ………. yes
Qt GUI …………….. yes
Qt Widgets …………. yes
Large File …………. yes
QML debugging ………. yes
Use system proxies ….. no

Support enabled for:
Accessibility ………. yes
ALSA ………………. yes
CUPS ………………. yes
Evdev ……………… yes
FontConfig …………. yes
FreeType …………… yes (system library)
Glib ………………. yes
GTK theme ………….. no
HarfBuzz …………… no
Iconv ……………… yes
ICU ……………….. yes
Image formats:
GIF ……………… yes (plugin, using bundled copy)
JPEG …………….. yes (plugin, using system library)
PNG ……………… yes (in QtGui, using system library)
journald …………… no
mtdev ……………… no
Networking:
getaddrinfo ………. yes
getifaddrs ……….. yes
IPv6 ifname ………. yes
OpenSSL ………….. yes (loading libraries at run-time)
NIS ……………….. yes
OpenGL / OpenVG:
EGL ……………… no
OpenGL …………… no
OpenVG …………… no
PCRE ………………. yes (bundled copy)
pkg-config …………. yes
PulseAudio …………. yes
QPA backends:
DirectFB …………. no
EGLFS ……………. no
KMS ……………… no
LinuxFB ………….. yes
XCB ……………… yes (system library)
EGL on X ……….. no
GLX ……………. yes
MIT-SHM ………… yes
Xcb-Xlib ……….. yes
Xcursor ………… yes (loaded at runtime)
Xfixes …………. yes (loaded at runtime)
Xi …………….. no
Xi2 ……………. yes
Xinerama ……….. yes (loaded at runtime)
Xrandr …………. yes (loaded at runtime)
Xrender ………… yes
XKB ……………. no
XShape …………. yes
XSync ………….. yes
XVideo …………. yes
Session management ….. yes
SQL drivers:
DB2 ……………… no
InterBase ………… no
MySQL ……………. yes (plugin)
OCI ……………… no
ODBC …………….. yes (plugin)
PostgreSQL ……….. yes (plugin)
SQLite 2 …………. yes (plugin)
SQLite …………… yes (plugin, using bundled copy)
TDS ……………… yes (plugin)
udev ………………. yes
xkbcommon ………….. yes (bundled copy, XKB config root: /usr/share/X11/xkb)
zlib ………………. yes (system library)
NOTE: libxkbcommon and libxkbcommon-x11 0.4.1 or higher not found on the system, will use
the bundled version from 3rd party directory.
NOTE: Qt is using double for qreal on this system. This is binary incompatible against Qt 5.1.
Configure with ‘-qreal float’ to create a build that is binary compatible with 5.1.
Info: creating super cache file /home/pi/Qt5.3.2/qt-everywhere-opensource-src-5.3.2/.qmake.super

Qt is now configured for building. Just run ‘make’.
Once everything is built, you must run ‘make install’.
Qt will be installed into /usr/local/qt5

Prior to reconfiguration, make sure you remove any leftovers from
the previous build.

After good 4-5 hours the make finished and end up with the binaries.

Some information regarding the build environment

uname -a

Linux thor 3.18.5-v7+ #225 SMP PREEMPT Fri Jan 30 18:53:55 GMT 2015 armv7l GNU/Linux

cat /proc/version

Linux version 3.18.5-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 – Linaro GCC 2014.03) ) #225 SMP PREEMPT Fri Jan 30 18:53:55 GMT 2015

libc6 info

Package: libc6
State: installed
Automatically installed: no
Multi-Arch: same
Version: 2.13-38+rpi2+deb7u7
Priority: required
Section: libs
Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
Architecture: armhf
Uncompressed Size: 8,914 k
Depends: libc-bin (= 2.13-38+rpi2+deb7u7), libgcc1
Suggests: glibc-doc, debconf | debconf-2.0, locales
Conflicts: prelink (<= 0.0.20090311-1), tzdata (< 2007k-1), tzdata-etch
Breaks: locales (< 2.13), locales-all (< 2.13), nscd (< 2.13)
Provides: glibc-2.13-1
Description: Embedded GNU C Library: Shared libraries
Contains the standard libraries that are used by nearly all programs on the system. This package includes shared versions of the standard C library and the standard math library, as well as many others.
Homepage: http://www.eglibc.org

build directory

/home/pi/Qt5.3.2/qt-everywhere-opensource-src-5.3.2/

install directory

/usr/local/qt5

Advertisements

17 thoughts on “Compiled binaries of Qt 5.3 for the Raspberry Pi (ARMv6) and Pi 2 (ARMv7-A)

  1. hi
    thanks for the document, most of the qt compiling stuff found on the web does not seem to work today.
    in this case I have experienced the following:
    sudo make install command on line 7 gives the following error:
    make: *** No rule to make target ‘install’. Stop.
    have you experienced such an issue ? or do you know how to overcome this? thanks in advance.

    • Hi Matt,

      Please pay special attention to the first paragraph, where I say to use the “ssh pi@” command, which logs you into the Raspberry Pi as the user “pi”. The idea is that sudo make install commands has to be run on the “/home/pi/Qt5.3.2/qt-everywhere-opensource-src-5.3.2” directory, so untar the downloaded compiled binaries to that directory.

      Let me know if you need further help.

  2. Hi again,
    Thanks for the reply. I am already using raspberry pi as user pi. So I have the command line:
    pi@raspberrypi~$… and I am running the sudo make install under the given directory (“/home/pi/Qt5.3.2/qt-everywhere-opensource-src-5.3.2″). I think this issue is related to something else. Thanks. Matt

    • I just downloaded it again and tested. the make install command worked fine and binaries got installed into /usr/local/ folder.

      Can you please make sure “build-essential” is installed, I am just guessing here at the moment. Try after installing it. Also let me know the version of Raspberry Pi and OS your are using.

      • I’m having the same issue as Matt. Logged in as pi@raspberrypi ~/Qt5.3.2/qt-everywhere-opensource-src-5.3.2 $
        running sudo make install results in the message..
        make: *** No rule to make target ‘install’. Stop.

        build-essential is installed

        Raspberry Pi 2
        Linux version 3.18.7-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 – Linaro GCC 2014.03) ) #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015

        Would be useful to know if this was fixed and what the solution was?

        Thanks in advance

      • Figured it out, if you follow the instructions above to the letter you end up with

        home/pi/Qt5.3.2/qt-everywhere-opensource-src-5.3.2/qt-everywhere-opensource-src-5.3.2/[install files..]

        By moving the files down a level to

        home/pi/Qt5.3.2/qt-everywhere-opensource-src-5.3.2/[install files..]

        Then everything works. I suppose if the first line was..

        mkdir -p Qt5.3.2
        …omitting the creation of /qt-everywhere-opensource-src-5.3.2 then it should work fine.

    • Sorry, can’t find the configure options in the history.

      I remember I didn’t build demos/examples. If you are after specific settings such as support for OpenGL etc, refer to “Build options” section.

  3. Help me, i try to cross compile for Pi2 from Ubuntu 14.04, when run make, Error:
    .obj/qlibrary_unix.o: In function `QLibraryPrivate::load_sys()’:
    qlibrary_unix.cpp:(.text+0x12e0): warning: Using ‘dlopen’ in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
    /mnt/raspberry-rootfs/usr/lib/arm-linux-gnueabihf/libdl.a(dlopen.o): In function `dlopen’:
    (.text+0xc): undefined reference to `__dlopen’
    /mnt/raspberry-rootfs/usr/lib/arm-linux-gnueabihf/libdl.a(dlclose.o): In function `dlclose’:
    (.text+0x0): undefined reference to `__dlclose’
    /mnt/raspberry-rootfs/usr/lib/arm-linux-gnueabihf/libdl.a(dlsym.o): In function `dlsym’:
    (.text+0xc): undefined reference to `__dlsym’
    /mnt/raspberry-rootfs/usr/lib/arm-linux-gnueabihf/libdl.a(dlerror.o): In function `dlerror’:
    (.text+0x0): undefined reference to `__dlerror’
    collect2: error: ld returned 1 exit status
    make[3]: *** [../../lib/libQt5Core.so.5.4.1] Error 1
    make[3]: Leaving directory `/home/tobi/raspberry/qt-everywhere-opensource-src-5.4.1/qtbase/src/corelib’
    make[2]: *** [sub-corelib-make_first] Error 2
    make[2]: Leaving directory `/home/tobi/raspberry/qt-everywhere-opensource-src-5.4.1/qtbase/src’
    make[1]: *** [sub-src-make_first] Error 2
    make[1]: Leaving directory `/home/tobi/raspberry/qt-everywhere-opensource-src-5.4.1/qtbase’
    make: *** [module-qtbase-make_first] Error 2
    Can you help me

  4. I’ve had the same issue because when unzipping the archive it unzipped in a subdirectory. Basically I had /home/pi/Qt5.3.2/qt-everywhere-opensource-src-5.3.2/qt-everywhere-opensource-srv-5.3.2. I just moved the second qt-everywhere… one directory up and it worked without issues. Thank you for the great work that saved me hours of work and frustration!

  5. Hi,
    very very thank you for your document and Precompiled binaries. Most of the qt compiling document found on the internet
    but does not to work. Qt5.5 released. Have you any experienced qt5.5. Could you share Precompiled binaries for qt5.5..?
    regards.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s