Building Qt5.6 or Qt5.7 on Raspberry Pi3 or/and Pi zero
Asked Answered
G

3

10

Is there a working guide on how to get Qt5.6 or even 5.5 built on the Raspberry Pi3?

I've found a number of guides on Wiki, that all seem incomplete in some way, the last one I tried was:

https://wiki.qt.io/RaspberryPi2EGLFS

Which was ok until I got to:

    ./configure -release -opengl es2 -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v

I'm not sure if its because its for a Pi2 but this errors with:

    The OpenGL ES 2.0 functionality test failed!
    You migh 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 /home/.../raspi/qtbase/mkspace/mkspecs/devices/linux-rasp-p2-g++.

I'm not sure how to progress further, thank you.

Edit, heres a bit more information:

I have a Raspberry Pi 3, running:

    Linux pi3 4.1.21.v7+ #872 SMP Wed Apr 6 17:34:14 BST 2016 armv71 GNU/Linux

The first error I see is: ./configure: 3497: ./configure: /home/simon/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: not found

I went to:

    ~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin

And typed: arm-linux-gnueabihf-g++

It wasn't installed, so then: sudo apt-get install g++-arm-linux-gnueabihf

Installation ok, then tried the configure instruction again, same result, still cannot find arm-linux-gnueabihf-g++

Edit 2016/06/12 ... I tried another source:

enter link description here

This also has problems, there are two libraries that are a problem:

    libjpeg62-dev and libxcb-sync0-dev

Can anyone refer me to information that is accurate and works?

Edit 2016/06/13, After following the information posted by RSATom, I tried both the information on the wiki page and downloading Qt, both result in the same when executing configure...

Running configuration tests (phase 2)... Failed to process makespec for platform 'devices/linux-rasp-pi2-g++' Project ERROR: Compiler /home/pi/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ not found. Check the value of CROSS_COMPILE -device-option Could not read qmake configuration file /home/pi/qtbase/mkspecs/devices/linux-rasp-pi2-g++/qmake.conf. Error processing project file: /dev/null

make make: * No targets specified and no makefile found. Stop. pi@pi3:~/qtbase $ make install make: * No rule to make target 'install'. Stop.

2nd attempt, 2016/06/14...

OpenGL ES 2.0 disabled. The OpenGL ES 2.0 functionality test 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 /home/pi/raspi/qt5pi/qtbase/mkspecs/devices/linux-rasp-pi2-g++.

3rd attempt, 2016/06/15...

Ok, starting again from scratch and following the information on:

https://wiki.qt.io/RaspberryPi2EGLFS

First off, I checked my OS on the Pi 3:

    uname -a

Result:

    Linux pi3 4.4.9-v7+ #884 SMP Fri May 6 17:28:59 BST 2016 armv7l GNU/Linux

Then:

    lsb_release -a

Result:

    No LSB modules are available.
    Distributor ID: Raspbian
    Description:    Raspbian GNU/Linux 8.0 (jessie)
    Release:        8.0
    Codename:       jessie

Having established this I then jumped to step 3.

Step 4, I didn't read correctly the first time around, I don't want cross platform development I want to develop on the Pi 3 directly.

However I have Oracle VirtualBox running Version 5.0.20 r106931 with a Ubuntu virtual machine, started this, current release of Ubuntu:

    uname -a
    Linux simon-VirtualBox 3.19.0-59-generic #66-14.04.1-Ubuntu SMP Fri May 13 17:27:10 UTC 2016 x86_64 x84_64 GNU/Linuxu

    lsb_release -a
    No LSB modules are available.
    Dsitributor ID: Ubuntu
    Description:    Ubuntu 14.04.4 LTS
    Release:        14.04
    Codename:       trusty

Completed Steps 4, 5, 6.

Replaced link in Step 7 with:

    wget download.qt.io/official_releases/qt/5.6/5.6.0/single/qt-everywhere-opensource-src-5.6.0.tar.gz

Then extracted:

    tar -zxvf qt-everywhere-opensource-src-5.6.0.tar.gz

Once complete renamed folder 'qt-everywhere-opensource-src-5.6.0' to 'qtbase':

    mv qt-everywhere-opensource-src-5.6.0 qtbase

Then continued with Step 7 after the clone instruction at:

    cd qtbase

At this point lots of errors appear after a few seconds of scrolling messages, which end with:

    OpenGL ES 2.0 disabled.
    The OpenGL ES 2.0 functionality test 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

/home/simon/raspi/qtbase/qtbase/mkspecs/devices/linux-rasp-pi2-g++.

4th attempt, 2016/06/18...

Thanks to the efforts of RSATom, things have progressed some what.

I upgraded my installation of Jessie using:

    wget https://raw.githubusercontent.com/Topguy/Raspberry-Qt5-experiments/master/qt5_twolife_jessie_setup.sh

Make the downloaded script executable:

    chmod +x qt5_twolife_jessie_setup.sh

Execute the script:

    ./qt5_twolife_jessie_setup.sh

This will add a new repository for updating, update the system:

    sudo apt-get update
    sudo apt-get upgrade

Ensure you have all the required tools:

    sudo apt-get install build-essential

Ensure you have the required opengl components:

    sudo apt get install libgl1-mesa-dev libglu1-mesa-dev

Install qt5:

     sudo apt-get install qt5-default

Update the system again:

    sudo apt-get update
    sudo apt-get upgrade

This is where I am stuck as the system will not allow me to perform installation of qtcreator:

    sudo apt-get install qtcreator

It errors, and if I then reboot the Pi, it will not boot, I've performed this sequence twice and whilst it does appear to install Qt5.5, it is not complete and bricks the Pi, or at least will not boot until the SD card is re-flashed.

I'm now looking for a solution to this to find out why the Pi will not book after installing this update and why qtcreator will not install.

5th attempt, 2016/06/19...

Downloaded source of Qt5.7:

    wget http://download.qt.io/official_releases/qt/5.7/5.7.0/single/qt-everywhere-opensource-src-5.7.0.tar.gz

Extracted:

    tar -zxvf qt-everywhere-opensource-src-5.7.0.tar.gz

Thank you to dbmitch, for links:

Preparing Raspberry Pi 3

Its so frustrating, the above link looks very promising, but I cannot find any link to the mentioned Pi 3 Qt image.

2016/06/29 Found this today, looks promising, will try tonight: Building Your Own Embedded Linux Image

I'm fast running out of patience, having followed the instructions on the above link, I really don't think the authors of this page have tried it with the tools available on the links.

There are menu references in QtCreator that don't exist. It isn't easy to follow, do they want to promote usage of the product? I use the Qt environment at work daily and its excellent, but why is it so difficult to role out on what is supposed to be a supported platform?

2016/07/01 Sixth time lucky?...

Working through: Step by Step instructions

I simply changed 5.6 to 5.7 on this line:

    git clone git://code.qt.io/qt/qtbase.git -b 5.6

And it works...at least I'm building and making 5.7 on Ubuntu 16.04, when its finished I will rsync it across...I'll come back and post results.

See my answer...

Grot answered 5/5, 2016 at 20:4 Comment(24)
It looks like you don't have a libgl installed in your cross-compiler's search paths. Can you verify this?Mcmann
tbh I don't understand why you didn't get it working. I've built Qt 5.6.0 for latest Raspbian right yesterday. I just followed to wiki.qt.io/RaspberryPi2EGLFS and got it working from first try. The only thing I've changed - I've built it from download.qt.io/official_releases/qt/5.6/5.6.0/single/…, not git repo. You could even try run my basic demo app if you like: github.com/RSATom/WebChimera-desktop/releases/tag/RPi.v.0.3 (it already contains prebuilt Qt 5.6.0)Hargreaves
Thank you, I will try tonight.Grot
@RSATom, ok, I tried both the download from your posted link and when that failed the instructions from the wiki page, both fail to build ...after executing the ./configure, see my edit above.Grot
as I can see at github.com/raspberrypi/tools/tree/master/arm-bcm2708/… arm-linux-gnueabihf-g++ is exist there. Are you sure did git clone https://github.com/raspberrypi/tools ?Hargreaves
Will check it all tonight, thank youGrot
New errors, see post.Grot
For me it looks like you did something wrong. I could recommend you start from scratch and follow wiki.qt.io/RaspberryPi2EGLFS preciselyHargreaves
and please read Troubleshooting section at the same docHargreaves
Groan.... Will try againGrot
@RSATom, please see latest edit...feel like I'm going around in circles.Grot
Let us continue this discussion in chat.Hargreaves
Thank you for the advice I will try Ubuntu 16.04 on virtual machine tonight.Grot
I've downloaded Ubuntu 16.04 (ISO) size (1,485,881,344 bytes), I've configured VirtualBox (5.0.20 r106931) for the virtual machine. But when I try to start it I get "FATAL: Could not read from the boot medium! System halted." I didn't do anything different than setting up 14.04, know of any guides I could follow?Grot
Sorted, opened the devices menu, selected ISO, rebooted. Installing now.Grot
Having lots of headaches with 16.04, lots of set-up issues....I've also done a bit of searching and there are lots of reported issues with "The OpenGL ES 2.0 functionality test failed!" and Qt5.Grot
Are you sure changed IP to real raspberry pi IP at step 5?Hargreaves
unfortunately I didn't finish my test with Ubuntu 16.04 on Virtual Box - it works muuch slower than without Virtual Box...Hargreaves
I will try again tonight...Grot
I've had to create an answer as I couldn't post all the errors in the original post, and then I had to shorten the post because of the limit on the answer size, I was very careful to ensure I followed the instructions exactly, still no joy.Grot
I've found xubuntu is much more VirtualBox friendly than ubuntu, so I've decided switch to it and start from scratch. I hope finish build today on xubuntu and write you results.Hargreaves
thank you, I've got 16.04 installed now with guest additions. Will try that too.Grot
I've created chat room on gitter.im ( gitter.im/RSATom/Qt-RPi ), maybe it will be more convenient proceed talk there...Hargreaves
I'm in the room...waiting :)Grot
G
7

Finally success, follow this link:

Installing 5.6 step by step instructions

In the end I actually installed 5.7 and it works great! Just change the git pull argument from 5.6 to 5.7, thats it!

Big thanks go to RSATom

Grot answered 1/7, 2016 at 16:8 Comment(1)
what about for pizero?Conceptacle
K
1

Try to install libgl1-mesa-dev, libglu1-mesa-dev and mesa-common-dev.

Keeper answered 6/5, 2016 at 15:27 Comment(4)
What do I need to install these on Ubuntu 14.04, I tried "sudo apt-get install libgl1-mesa-dev, libglu1-mesa-dev, mesa-common-dev", but it cannot locate packages "libgl1-mesa-dev" or "libglu1-mesa-dev" ,Grot
The correct command is sudo apt get install libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev.Keeper
Ok, after all that, "is already the newest version", thanks anyway.Grot
Just nit-picking: It's either apt-get install or apt install, with apt being a rather new application striving towards more user-friendliness than the traditional apt-get. :)Actinism
S
0

EDIT - UPDATE - QT Device Creation for commercial licensing only

Link describing preparing RaspPi for Boot to QT

Not sure if this will help you or not, since it appears you are trying to build your own, but it looks like the latest version may give you another option to try.

Downloads for QT 5.7

In the release notes for version 5.7 just released June 16

Qt for Device Creation

Also Qt for Device creation has received an update and does now ship with Qt 5.7. In this release, we added out of the box support for a set of new hardware:

The Rasberry Pi 3 (32 bit mode) - note that is their spelling

From their blog...

https://blog.qt.io/blog/2016/06/16/qt-5-7-for-device-creation/

New Device Images

We’ve also updated the hardware selection for our pre-built software images with two new additions:

Raspberry Pi 3
Intel® NUC Kit DE3815TYKHE

For these, and the other common development boards, we provide the pre-built image with our SDK installer. You can flash the device with the image and immediately get started with embedded development.

Sexagenary answered 19/6, 2016 at 16:7 Comment(17)
Thank you I will take a lookGrot
I don't see any version for the Pi 3 in the list.Grot
It looks like the support comes from inside the software - using the QT for Device CreationSexagenary
I'm downloading the linux soucrce for 5.7.0 now.Grot
Appreciate all your efforts - I'm going to do the same once I get into a free wireless zone. My used data is already high for this monthSexagenary
Thanks again, please keep me updated on your progress.Grot
Do you have any links to go along with the last edit? Thank you.Grot
Updated links just nowSexagenary
Let us continue this discussion in chat.Sexagenary
There is no link for the RPI 3 listed, the source download is complete, I've run configure and its now creating qmake.Grot
Looks like the product is a pay-for-use product - doesn't say much on website about its cost - but you can apply for 30 day free trial. Not really what I was looking forSexagenary
The licensing policies for Qt are clear, for open source development it is completely free...if not open source then it is NOT free. It looks to me like they published the pages about RPi3 development before they were ready as I cannot see any links anywhere. It doesn't help that the repo for qtcreator is very old and out of date and the instructions given on the Qt web-site are not applicable for the version of qtcreator that is available for the raspberry pi.Grot
Note - last form field is "Interest in purchasing a license"Sexagenary
A license is NOT required for open source development. Use this link qt.io/download choose open source, then answer yes to are you prepared to make your application source publically available.Grot
Agreed- but it doesn't appear that they make the "Qt for Device Creation" product accessible from anywhere I can seeSexagenary
Agreed, I can't see it either.Grot
I think I will have to park for now.Grot

© 2022 - 2024 — McMap. All rights reserved.