Cross-Compiling Qt5 on Beaglebone Black with OpenGL

3,645 views
Skip to first unread message

Jay Cady

unread,
Jul 16, 2014, 3:25:19 PM7/16/14
to beagl...@googlegroups.com

Hey all,

I’ve been googling around and searching for about 2 days now with no luck.

I’m trying to cross-compile Qt5 (5.3.1 or 5.2.0) for the Beaglebone Black and get Quick 2.0 and Qt Quick Controls working (so I need OpenGL). So far I haven’t been able to find any good sources to walk me through this process.

I’m using a Chipsee [chipsee.com] cape to have an LCD and capacitive touch screen with it. Chipsee gives me several prebuilt images, including a Debian, Angstrom, Android, and LinuxEZSDK images. It looks like the linuxEZSDK and Angstrom images come with all the OpenGL libraries pre-loaded. The LinuxEZSDK comes pre-configured with everything for Qt, but it’s Qt4.8. You can find their repo of images here[chipsee.com].

Right now I’ve been working with the LinuxEZSDK image to try and build Qt5 from source and get it on there. I downloaded the linaro toolchain [launchpad.net] to use for the cross compile. I edited the 5.3.1 source following this tutorial [armsdr.blogspot.com]to setup the build for the cross-compile. If I follow that tutorial to a T, it works fine. But if I try and configure using OpenGL by running the following configure script:

  1. ../qt-everywhere-opensource-src-5.3.1/configure --opensource -confirm-license-no-pch -no-opengl -opengl es2 -make libs -device linux-beaglebone-g++ -xplatform linux-arm-gnueabihf-g++ -device-option CROSS_COMPILE=/usr/local/linaro/bin/arm-linux-gnueabihf- -sysroot/media/jay/rootfs -no-gcc-sysroot -prefix /opt/qt5

I mounted the SD card that countains the LinuxEZSDK in order to find the OpenGL drivers and set the sysroot to /media/jay/rootfs, which is the root of the OS. Configuring that gives me the following error:

  1. OpenGL ES 2.x auto-detection... ()
  2. /usr/local/linaro/bin/arm-linux-gnueabihf-g++ --pipe -O2 -Wall --fPIE  -I/home/jay/qt-everywhere-opensource-src-5.3.1/qtbase/mkspecs/linux-arm-gnueabihf-g++ -I/home/jay/qt-everywhere-opensource-src-5.3.1/qtbase/config.tests/unix/opengles2 -I. -o opengles2.o /home/jay/qt-everywhere-opensource-src-5.3.1/qtbase/config.tests/unix/opengles2/opengles2.cpp
  3. /home/jay/qt-everywhere-opensource-src-5.3.1/qtbase/config.tests/unix/opengles2/opengles2.cpp:45:25: fatal error:GLES2/gl2.h: No such file or directory
  4.    #include <GLES2/gl2.h>
  5.                          ^
  6. compilation terminated.
  7. make: *** [opengles2.o] Error 1
  8. OpenGL ES 2.x disabled.
  9. The OpenGL ES 2.0 functionality test failed!
  10.  You might need to modify the include and library search paths by editing
  11.  QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and QMAKE_LIBS_OPENGL_ES2 in
  12.  /home/jay/qt-everywhere-opensource-src-5.3.1/qtbase/mkspecs/linux-arm-gnueabihf-g++.

I even tried modifying the qmake.conf at /qtbase/mkspecs/linux-arm-gnueabihf-g++ to include the following:

  1. QMAKE_INCDIR_OPENGL += /media/jay/rootfs/usr/include
  2. QMAKE_LIBDIR_OPENGL += /media/jay/rootfs/usr/lib
  3. QMAKE_LIBS_OPENGL_ES2 =

But that resulted in the same error.

Does anyone have any ideas how I can get this cross compiled for the Beaglebone with support for Qt Quick 2 and Qt Quick Controls?

Thanks!

Don deJuan

unread,
Jul 16, 2014, 10:58:15 PM7/16/14
to beagl...@googlegroups.com
On 07/16/2014 12:25 PM, Jay Cady wrote:
>
> Hey all,
>
> I’ve been googling around and searching for about 2 days now with no luck.
>
> I’m trying to cross-compile Qt5 (5.3.1 or 5.2.0) for the Beaglebone Black
> and get Quick 2.0 and Qt Quick Controls working (so I need OpenGL). So far
> I haven’t been able to find any good sources to walk me through this
> process.
>
> I’m using a Chipsee
> <http://www.chipsee.com/product/evm/beagle/beaglebone-black-expansion-capacitive.html?___store=english&___from_store=default>
> *[chipsee.com]* cape to have an LCD and capacitive touch screen with it.
> Chipsee gives me several prebuilt images, including a Debian, Angstrom,
> Android, and LinuxEZSDK images. It looks like the linuxEZSDK and Angstrom
> images come with all the OpenGL libraries pre-loaded. The LinuxEZSDK comes
> pre-configured with everything for Qt, but it’s Qt4.8. You can find their
> repo of images here <http://www.chipsee.com/upload/BBB/>*[chipsee.com]*.
>
> Right now I’ve been working with the LinuxEZSDK image to try and build Qt5
> from source and get it on there. I downloaded the linaro toolchain
> <https://launchpad.net/linaro-toolchain-binaries/trunk/2013.04/+download/gcc-linaro-arm-linux-gnueabihf-4.8-2013.04-20130417_linux.tar.xz>
> *[launchpad.net]* to use for the cross compile. I edited the 5.3.1 source
> following this tutorial
> <http://armsdr.blogspot.com/2014/01/bare-metal-qt-52-on-beaglebone-black_10.html>
> *[armsdr.blogspot.com]*to setup the build for the cross-compile. If I
> follow that tutorial to a T, it works fine. But if I try and configure
> using OpenGL by running the following configure script:
>
> 1. ../qt-everywhere-opensource-src-5.3.1/configure -v -opensource -
> confirm-license-no-pch -no-opengl -opengl es2 -make libs -device linux-
> beaglebone-g++ -xplatform linux-arm-gnueabihf-g++ -device-option
> CROSS_COMPILE=/usr/local/linaro/bin/arm-linux-gnueabihf- -sysroot/media/
> jay/rootfs -no-gcc-sysroot -prefix /opt/qt5
>
> I mounted the SD card that countains the LinuxEZSDK in order to find the
> OpenGL drivers and set the sysroot to /media/jay/rootfs, which is the root
> of the OS. Configuring that gives me the following error:
>
> 1. OpenGL ES 2.x auto-detection... ()
> 2. /usr/local/linaro/bin/arm-linux-gnueabihf-g++ -c -pipe -O2 -Wall -W -fPIE
> -I/home/jay/qt-everywhere-opensource-src-5.3.1/qtbase/mkspecs/linux-arm-
> gnueabihf-g++ -I/home/jay/qt-everywhere-opensource-src-5.3.1/qtbase/
> config.tests/unix/opengles2 -I. -o opengles2.o /home/jay/qt-everywhere-
> opensource-src-5.3.1/qtbase/config.tests/unix/opengles2/opengles2.cpp
> 3. /home/jay/qt-everywhere-opensource-src-5.3.1/qtbase/config.tests/unix/
> opengles2/opengles2.cpp:45:25: fatal error:GLES2/gl2.h: No such file or
> directory
> 4. #include <GLES2/gl2.h>
> 5. ^
> 6. compilation terminated.
> 7. make: *** [opengles2.o] Error 1
> 8. OpenGL ES 2.x disabled.
> 9. The OpenGL ES 2.0 functionality test failed!
> 10. You might need to modify the include and library search paths by
> editing
> 11. QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and
> QMAKE_LIBS_OPENGL_ES2 in
> 12. /home/jay/qt-everywhere-opensource-src-5.3.1/qtbase/mkspecs/linux-
> arm-gnueabihf-g++.
>
> I even tried modifying the qmake.conf at
> /qtbase/mkspecs/linux-arm-gnueabihf-g++ to include the following:
>
> 1. QMAKE_INCDIR_OPENGL += /media/jay/rootfs/usr/include
> 2. QMAKE_LIBDIR_OPENGL += /media/jay/rootfs/usr/lib
> 3. QMAKE_LIBS_OPENGL_ES2 =
>
> But that resulted in the same error.
>
> Does anyone have any ideas how I can get this cross compiled for the
> Beaglebone with support for Qt Quick 2 and Qt Quick Controls?
>
> Thanks!
>

Just use arch linux arm for qt5 as your default.

Aswin

unread,
Jul 17, 2014, 10:42:37 AM7/17/14
to beagl...@googlegroups.com
Hi Jay,

Sorry for deviating from the topic, but I'd like to know if the touchscreen is working fine with your installation of Qt5.

ashwin.s...@gmail.com

unread,
Jul 17, 2014, 12:13:54 PM7/17/14
to beagl...@googlegroups.com
Hi,

I am facing the same problem too. However, missing gl2.h is not the only error I am seeing. There are other similar errors for mysql.h, oci.h etc.
I am using a the kernel version that supports SGX and was able to run a demo program. I do not see gl2.h anywhere in /usr/include directory. Please update if you find out any solution.

Thanks,
Ashwin

Jay Cady

unread,
Jul 17, 2014, 1:20:16 PM7/17/14
to beagl...@googlegroups.com, ashwin.s...@gmail.com
Don: I'm unsure of what you mean by using arch-linux arm.  Can you explain how I would do this?

Aswin: I'm actually not sure if the touchscreen works with the Qt5 installation yet.  The touchscreen is definitely functioning with the image, but I haven't been able to do any tests yet.  If I can get it working with OpenGL, I'll let you know.

Ashwin: A lot of the errors you get in configuring Qt from source are normal.  They just indicate that it tried to build those modules because you didn't explicitly say to exclude them, but they don't exist.  You can suppress them by passing -no arguments with the module that is giving you the issue when configuring (i.e. -no-sql-mysql).  It doesn't matter much because if everything else is still good, it will still configure successfully and just disable those modules.

Jay Cady

unread,
Jul 17, 2014, 1:22:34 PM7/17/14
to beagl...@googlegroups.com, ashwin.s...@gmail.com
Ashwin: Can you elaborate on how you got the SGX stuff working?  I'm trying to follow this tutorial and having some difficulties.

Don deJuan

unread,
Jul 17, 2014, 1:28:13 PM7/17/14
to beagl...@googlegroups.com
On 07/17/2014 10:20 AM, Jay Cady wrote:
> Don: I'm unsure of what you mean by using arch-linux arm. Can you explain
> how I would do this?
Install arch linux arm on your BBB as opposed to running Debian. Then
install qt5 or qt4 or both
>>> <http://www.chipsee.com/product/evm/beagle/beaglebone-black-expansion-capacitive.html?___store=english&___from_store=default>
>>> *[chipsee.com <http://chipsee.com>]* cape to have an LCD and capacitive
>>> touch screen with it. Chipsee gives me several prebuilt images, including a
>>> Debian, Angstrom, Android, and LinuxEZSDK images. It looks like the
>>> linuxEZSDK and Angstrom images come with all the OpenGL libraries
>>> pre-loaded. The LinuxEZSDK comes pre-configured with everything for Qt, but
>>> it’s Qt4.8. You can find their repo of images here
>>> <http://www.chipsee.com/upload/BBB/>*[chipsee.com <http://chipsee.com>]*.
>>>
>>> Right now I’ve been working with the LinuxEZSDK image to try and build
>>> Qt5 from source and get it on there. I downloaded the linaro toolchain
>>> <https://launchpad.net/linaro-toolchain-binaries/trunk/2013.04/+download/gcc-linaro-arm-linux-gnueabihf-4.8-2013.04-20130417_linux.tar.xz>
>>> *[launchpad.net <http://launchpad.net>]* to use for the cross compile.
>>> I edited the 5.3.1 source following this tutorial
>>> <http://armsdr.blogspot.com/2014/01/bare-metal-qt-52-on-beaglebone-black_10.html>
>>> *[armsdr.blogspot.com <http://armsdr.blogspot.com>]*to setup the build
>>> for the cross-compile. If I follow that tutorial to a T, it works fine. But
>>> if I try and configure using OpenGL by running the following configure
>>> script:
>>>
>>> 1. ../qt-everywhere-opensource-src-5.3.1/configure -v -opensource -
>>> confirm-license-no-pch -no-opengl -opengl es2 -make libs -device linux
>>> -beaglebone-g++ -xplatform linux-arm-gnueabihf-g++ -device-option
>>> CROSS_COMPILE=/usr/local/linaro/bin/arm-linux-gnueabihf- -sysroot/
>>> media/jay/rootfs -no-gcc-sysroot -prefix /opt/qt5
>>>
>>> I mounted the SD card that countains the LinuxEZSDK in order to find the
>>> OpenGL drivers and set the sysroot to /media/jay/rootfs, which is the root
>>> of the OS. Configuring that gives me the following error:
>>>
>>> 1. OpenGL ES 2.x auto-detection... ()
>>> 2. /usr/local/linaro/bin/arm-linux-gnueabihf-g++ -c -pipe -O2 -Wall -
>>> W -fPIE -I/home/jay/qt-everywhere-opensource-src-5.3.1/qtbase/mkspecs
>>> /linux-arm-gnueabihf-g++ -I/home/jay/qt-everywhere-opensource-src-
>>> 5.3.1/qtbase/config.tests/unix/opengles2 -I. -o opengles2.o /home/jay/
>>> qt-everywhere-opensource-src-5.3.1/qtbase/config.tests/unix/opengles2/
>>> opengles2.cpp
>>> 3. /home/jay/qt-everywhere-opensource-src-5.3.1/qtbase/config.tests/
>>> unix/opengles2/opengles2.cpp:45:25: fatal error:GLES2/gl2.h: No such
>>> file or directory
>>> 4. #include <GLES2/gl2.h>
>>> 5. ^
>>> 6. compilation terminated.
>>> 7. make: *** [opengles2.o] Error 1
>>> 8. OpenGL ES 2.x disabled.
>>> 9. The OpenGL ES 2.0 functionality test failed!
>>> 10. You might need to modify the include and library search paths by
>>> editing
>>> 11. QMAKE_INCDIR_OPENGL_ES2, QMAKE_LIBDIR_OPENGL_ES2 and
>>> QMAKE_LIBS_OPENGL_ES2 in
>>> 12. /home/jay/qt-everywhere-opensource-src-5.3.1/qtbase/mkspecs/linux
>>> -arm-gnueabihf-g++.
>>>
>>> I even tried modifying the qmake.conf at
>>> /qtbase/mkspecs/linux-arm-gnueabihf-g++ to include the following:
>>>
>>> 1. QMAKE_INCDIR_OPENGL += /media/jay/rootfs/usr/include
>>> 2. QMAKE_LIBDIR_OPENGL += /media/jay/rootfs/usr/lib
>>> 3. QMAKE_LIBS_OPENGL_ES2 =

ashwin.s...@gmail.com

unread,
Jul 17, 2014, 2:56:15 PM7/17/14
to beagl...@googlegroups.com, ashwin.s...@gmail.com
Jay,

I used instructions in http://elinux.org/BeagleBoardDebian#SGX_BeagleBone.2FBeagleBone_Black to build kernel and sgx drivers and installed them to my BBB. The demo example mentioned in link ran fine.

ashwin.s...@gmail.com

unread,
Jul 17, 2014, 3:03:55 PM7/17/14
to beagl...@googlegroups.com, ashwin.s...@gmail.com
Jay,

Try using just -opengl instead of -opengl es2. I did it and configure output had 'OPENGL Desktop'. I'm guessing full GL was selected instead of ES subset. My /use/include had a GL/ directory but no GLES/ or GLES2/.

Jay

unread,
Jul 21, 2014, 12:29:53 PM7/21/14
to beagl...@googlegroups.com, ashwin.s...@gmail.com
Hey guys,

No luck for me in getting this working. Beaglebone seems to have quite a few issues with Qt5 and the build doesn't seem to want to cooperate.  For others looking to pursue the same route, I got several suggestions to take the route of Yocto and bitbaking the meta-ti recipe, which seems promising.

For me, because my project is flexible, (call me a traitor) I switched to a Raspberry Pi to build Qt5 on to.  It was incredibly easy to get the latest Qt5.3.1 build on there and all the drivers I needed came pre-installed with the Raspbian image.  So if there's anyone out there like me who isn't extremely versed in dealing with all the build issues, I'd recommend the Raspberry Pi if you need an embedded platform with Qt5.

Jay

Don deJuan

unread,
Jul 21, 2014, 12:35:14 PM7/21/14
to beagl...@googlegroups.com
On 07/21/2014 09:29 AM, Jay wrote:
> Hey guys,
>
> No luck for me in getting this working. Beaglebone seems to have quite a
> few issues with Qt5 and the build doesn't seem to want to cooperate. For
> others looking to pursue the same route, I got several suggestions to take
> the route of Yocto and bitbaking the meta-ti recipe, which seems promising.
>
> For me, because my project is flexible, (call me a traitor) I switched to a
> Raspberry Pi to build Qt5 on to. It was incredibly easy to get the latest
> Qt5.3.1 build on there and all the driv
Or you could just use an OS for BBB that has it built for you since you
seem to not be able to build it yourself on that platform.

wipe Debian, install archlinux-arm pacman -S qt5
AndWhatEverElseYouWantQT5Related

Again you can even install qt4 and at5 side by side

profit.

Brent

unread,
Sep 20, 2014, 10:37:02 PM9/20/14
to beagl...@googlegroups.com
Don,

This may sound strange, but would I be able to install qt5 on arch linux, and then copy all of the qt libraries over to my Angstrom OS and have it work?  I am currently not able to switch to an new OS in our product at the current time, so I'm looking for ways to make this work.  Thanks,

Don deJuan

unread,
Sep 20, 2014, 11:40:09 PM9/20/14
to beagl...@googlegroups.com
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

no. Use the proper build methods for Yocto/Angstrom/OE.

Sid Boyce

unread,
Sep 20, 2014, 11:52:27 PM9/20/14
to beagl...@googlegroups.com
Not possible. The libraries built on x86 or x86_64 are also dynamically linked to x86 or x86_64 libraries.
# file /usr/local/qt5/qtbase/lib/libQt5Core.so.5.3.1
/usr/local/qt5/qtbase/lib/libQt5Core.so.5.3.1: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked (uses shared libs), BuildID[sha1]=32404e368d550b3270a1aa09380fb52b67f7b91a, not stripped

ARM is a different architecture.
# file /usr/local/qt5/qtbase/lib/libQt5Core.so.5.3.2
/usr/local/qt5/qtbase/lib/libQt5Core.so.5.3.2: ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), BuildID[sha1]=435ca3248a88788420b0540400cf93054a9aa917, not stripped
Regards
Sid.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
Sid Boyce ... Hamradio License G3VBV, Licensed Private Pilot
Emeritus IBM/Amdahl Mainframes and Sun/Fujitsu Servers Tech Support
Senior Staff Specialist, Cricket Coach
Microsoft Windows Free Zone - Linux used for all Computing Tasks

Don deJuan

unread,
Sep 20, 2014, 11:53:46 PM9/20/14
to beagl...@googlegroups.com
uhhh I believe he meant arch linux arm not the x86_64 or i686 Arch Linux.. And technically yes he "could" should he no.

Brent Sink

unread,
Sep 21, 2014, 7:20:58 AM9/21/14
to beagl...@googlegroups.com

Yep, I meant Arch Linux Arm.

You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/uvpgF3vVNwg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

ptph...@gmail.com

unread,
Jan 26, 2016, 8:11:49 AM1/26/16
to BeagleBoard
For people who come across this post, I recommend to install Debian Wheezy to get QtQuick run on Beaglebone Black, it's so much easier than Angstrom. This is a youtube video of a guy who did it. Read the comments for more information.

https://www.youtube.com/watch?v=4p9kDyf7Ho4

ad...@dbanet.org

unread,
Feb 20, 2018, 9:53:00 AM2/20/18
to BeagleBoard
Unfortunately, on both element14 and armsdr.blogspot.com people have failed to compile with TI's SGX SDK OpenGL ES support, so it runs using a software rasterizer.
Reply all
Reply to author
Forward
0 new messages