PDA

View Full Version : Crosscompile QT5 on x86_64 Ubuntu16.04 LTS for target BBB running on Debian



Puneet2793
10th March 2017, 12:56
Hi,
I am a beginner in Qt. Usually i use to create some Qt based Gui application for my host machine(Ubuntu 16.04 LTS).
But now i want to cross compile the QT application for my BBB which is running on Debian with a LCD cape. I googled alot hot to get this done but couldn't make it work in the cross-compiling step. Can some one explain me in detail how to get this done?

jmg227
25th March 2017, 16:55
Hi,
I have been working on the same problem. I do not have the problem completely solved but I am most of the way there. I have switched over to Raspberry Pi 3 because I can get a capacitive touchscreen. The remaining work is to resolve the correct linker flags when building the Qt project and to disable X11 at start up (the last item should be pretty routine). These steps are based on the good info at the following sites:
BeagleBone Black Beginner's Guide (Qt) (https://wiki.qt.io/BeagleBone_Black_Beginners_Guide),
Raspberry Pi 2 EGLFS (https://wiki.qt.io/RaspberryPi2EGLFS), and
Configuring Qt Creator for Raspberry Pi (https://www.ics.com/blog/configuring-qt-creator-raspberry-pi)
Although these sites are made for Raspberry Pi, both Raspberry Pi and Beaglebone Black are running Debian on an ARM processor. Much of what is on these sites applies to BBB as well.

I started by following the BeagleBone Black Beginner's Guide. A couple of things to note:

Although there are later versions of the Linaro cross-compiler available, pick the one that matches gcc on your target. For Debian 8 (Jessie) that will be 4.9.x.
The script to fix qualified paths does not work very well. There is a better on on the Raspberry Pi 2 EGLFS site.
The BeagleBone Black Beginner's Guide has you build Qt with no GUI (I believe, e.g. -no-xcb -no-opengl options)
If you want OpenGL ES acceleration, you will need to build the drivers for the BeagleBone (see below)


Building Drivers for OpenGL ES Acceleration
See the instructions at https://groups.google.com/forum/#!topic/beagleboard/tsRfbDVwjSM considering these additional notes:

Use

sudo apt-get install -y {ti-sgx-es8-modules,linux-image,linux-firmware-image}-4.1.9-ti-r20
to install the kernel modules on BBB.
Get the x86 tools by entering the following URL in a web browser and downloading the zip file (I don’t know how to get the cloned repository to switch to the ti-linux-4.1.y branch and update the files yet): https://github.com/RobertCNelson/ti-linux-kernel-dev/tree/ti-linux-4.1.y


Configuring and Building Qt
Now that you've done all that prep work, you can build Qt using the instructions in the Raspberry Pi 2 EGLFS guides. The configure command I used was:

sudo /opt/Qt/5.8/Src/qtbase/configure -debug -opengl es2 -device linux-beagleboard-g++ -device-option CROSS_COMPILE=/opt/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/bbb-rootfs -opensource -confirm-license -nomake examples -prefix /usr/local/Qt-5.8 -extprefix /mnt/bbb-rootfs/usr/local/Qt-5.8 -hostprefix /usr/local/qt5bbb

Note that the paths are different from the ones in the BBB Guide because I did not want to install things in my home directory. I also specify the absolute path for configure because I am doing a shadow build in a different directory.

I think that is about it. Hopefully that is enough to get you started. If I discover I've left out some important details. I'll edit this post.

Jim