Author Topic: Qt5 build for cubieboard  (Read 204737 times)

Offline wickwire

  • Full Member
  • ***
  • Posts: 144
  • Karma: +10/-0
    • View Profile
Re: Qt5 build for cubieboard
« Reply #15 on: March 19, 2013, 11:12:25 am »
Lawrence

I think I found the references you were mentioning before:

Code: [Select]
eglCreateWindowSurface
            (context->display(), context->config(), 0,0);

qt5/qtbase/src/plugins/platforms

I have several definitions for this element in sub-folders, specifically in eglfs - so I could alter the definition in
Code: [Select]
qtbase/src/plugins/platforms/eglfs/qeglfswindow.cpp for example...

Also, I noticed that the mkspecs/devices/linux-rasp-pi-g++ profile includes a qeglfshooks.cpp file which also has a definition for this eglCreateWindowSurface... and a bunch of other stuff as well.

Anyways, as soon as I can, I will attempt to change the values for the platforms/eglfs and see if there are any changes!

kadosch

  • Guest
Re: Qt5 build for cubieboard
« Reply #16 on: April 03, 2013, 06:16:58 am »
Hi wickwire,

I'm facing the same issue as you with the eglfs platform. Did you try the changes you mentioned?

If so, I'm interested in the results.

Thanks

Offline lawrence

  • Administrator
  • Sr. Member
  • *****
  • Posts: 301
  • Karma: +15/-0
    • View Profile
Re: Qt5 build for cubieboard
« Reply #17 on: April 15, 2013, 11:45:03 am »
Maybe someone wants to try razor-qt instead

https://github.com/Razor-qt/razor-qt/wiki/How-to-compile-it


Offline pcklee123

  • Jr. Member
  • **
  • Posts: 53
  • Karma: +1/-0
    • View Profile
Re: Qt5 build for cubieboard
« Reply #18 on: September 27, 2013, 06:15:47 am »
You might need to link to X11 libs to avoid the linker errors  when compiling lima
in lima/limare/tests
add -lX11 to Makefile.egl , Makefile.gles1
also add -lm to Makefile.test
« Last Edit: September 27, 2013, 08:05:36 am by pcklee123 »

Offline wickwire

  • Full Member
  • ***
  • Posts: 144
  • Karma: +10/-0
    • View Profile
Re: Qt5 build for cubieboard
« Reply #19 on: September 27, 2013, 06:32:11 am »
Hi, eventually I managed to be successful with Qt5 on Cubieboard in the following scenarios:

1)
Linaro Linux > as described on this linux-sunxi wiki page (many thanks to ssvb) http://linux-sunxi.org/Qt5

- worked with native Qt5 build on Cubieboard (took several hours), several cross-compile attempts made which didn't work
- using native X11 mali drivers

2)
Linaro Linux, using the libhybris libraries

3)
Using the stock Android in the NAND and going with Qt5 for Android

All of these worked nicely! As I have both Cubieboards A10 and A20, I think I was messing with the Linaro approaches on the A10 and Qt5 for Android on A20.

derekdhaas

  • Guest
Re: Qt5 build for cubieboard
« Reply #20 on: October 02, 2013, 02:29:19 am »
Hi WickWire

Out of curiosity, how did you managed to compile it? Can you explain it a little.

Using the instructions of ssvb, I did not managed to get past the "OpenGL ES 2.0" test, it fails.
Code: [Select]
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
 /root/QT/qt-everywhere-opensource-src-5.1.0/qtbase/mkspecs/linux-g++.

Driver is working and I can see the colored triangle

The only lib I can find is the libGLES located in:
Code: [Select]
QMAKE_LIBDIR_OPENGL_ES2 =/usr/lib(which I added to qmake.conf)

p.s. Cubieboard 2

More details
Code: [Select]
g++ -c -pipe -O2 -Wall -W -fPIE  -I../../../mkspecs/linux-g++ -I. -o opengles2.o opengles2.cpp
opengles2.cpp:45:25: fatal error: GLES2/gl2.h: No such file or directory

I don't have the GLES2 anywhere, and out of the first 5 pages of google I can't figure out where to get it. Using Cubian (debian distro)
« Last Edit: October 02, 2013, 03:07:03 am by derekdhaas »

Offline wickwire

  • Full Member
  • ***
  • Posts: 144
  • Karma: +10/-0
    • View Profile
Re: Qt5 build for cubieboard
« Reply #21 on: October 02, 2013, 06:32:44 am »
As far as I recall, I believe that ssvb's tutorial worked only for the A10 for me, not the A20:

A10 + Linaro + native X11 drivers.

A20 wen't OK with Qt5 for Android, using the android JB on the NAND and the Qt5 for Android binary installer on a Linux Mint Laptop.

In any case, make sure you installed the native mali libs for X11 and not framebuffer - do you get the triangle working on Cubian's X environment?

derekdhaas

  • Guest
Re: Qt5 build for cubieboard
« Reply #22 on: October 03, 2013, 08:19:08 am »
Yes the triangle is working, but I'm stuck at configure (not even made it to "make"... very frustrating ;))

I'm missing the header files for GLES, like stated in the verbose log of the ./configure:

"fatal error: GLES2/gl2.h: No such file or directory"

so I was wondering where did you get it :) how did you linked it... I was searching all around Google, but couldn't find any real explanation. It doesn't seem to listen to the changes in directories (I've pointed QMAKE_INCDIR_OPENGL_ES2 to a dir with GLES2/gl2.h, but the error still occures).

Since you compiled it without changing a single line, I was curious how you linked the stuff to the right directories.

The goal by the way is to compile QTwebkit to get a hardware accelerated browser (like done on the raspberry pi). Midori etc. still fall back to software rendering.
« Last Edit: October 03, 2013, 08:39:57 am by derekdhaas »

Offline wickwire

  • Full Member
  • ***
  • Posts: 144
  • Karma: +10/-0
    • View Profile
Re: Qt5 build for cubieboard
« Reply #23 on: October 03, 2013, 09:22:34 am »
I believe this issue is not relevant in terms of A10 vs A20, but on my A10 Cubie I have:

/home/linaro/sunxi-mali/include/GLES2/gl2.h
/usr/include/GLES2/gl2.h

My sugestion would be to install mlocate, index the search DB and search for gl2.h on your system.

sudo apt-get update && sudo apt-get install mlocate && sudo updatedb && sudo locate gl2.h

If anything, the headers you're missing and Qt is complaining about should be available from the sunxi-mali sources, possibly it's just a matter of making them available to Qt (some PATH or something)

derekdhaas

  • Guest
Re: Qt5 build for cubieboard
« Reply #24 on: October 04, 2013, 04:33:05 am »
Tnx WickWire, Cubian didn't include the header files, I couldn't find where the gl2.h file came from, but it's from the sunxi-mali driver (tnx for pointing that out).

So I compiled all the drivers from source, and now the .configure is working.

Hoping to get it all to compile! I will set up a better tutorial, since the other one is great but limited ;)

derekdhaas

  • Guest
Re: Qt5 build for cubieboard
« Reply #25 on: October 04, 2013, 05:36:42 am »
Alright, little manual for Cubian:

Updated 2013/10/05
- Updated QT to 5.1.1
- Added dependencies for QTWebkit

Updated 2013/10/06
- Use g++ 4.7 (gcc/g++ 4.6 will fail compiling: RenderingAllInOne.cpp)

Notes
- Use a 4gb card at least! The build directory will become around 2 gig after building.


Lets start
Quick and dirty:
Code: [Select]
sudo -i
Install dependencies:
Code: [Select]
apt-get install build-essential autoconf automake make libtool  libdbus-1-dev libdbus-glib-1-dev flex bison gperf libicu-dev libxslt-dev ruby xorg-dev xutils-dev pkg-config libdrm-dev
Update to gcc/g++ 4.7
Code: [Select]
aptitude install install gcc-4.7 g++-4.7
Setup alternatives
Code: [Select]
update-alternatives --remove-all gcc
update-alternatives --remove-all g++

update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.6
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7

Set gcc to use version 4.7 (option 2)
Code: [Select]
update-alternatives --config gcc
Install libdri2 and sunxi-mali
Go to /root
Code: [Select]
cd /root
Get libdri2 and sunxi-mali:
Code: [Select]
git clone https://github.com/robclark/libdri2.git
git clone https://github.com/linux-sunxi/sunxi-mali.git

Compile libdri2:
Code: [Select]
cd libdri2
./autogen.sh --prefix=/usr
make install

Go back to root:
Code: [Select]
cd /root
Compile sunxi-mali:
Code: [Select]
cd sunxi-mali
git submodule init
git submodule update
make config ABI=armhf VERSION=r3p0
make install

Install QT5 from source
Back to root:
Code: [Select]
cd /root
Get QT5:
Code: [Select]
wget http://download.qt-project.org/official_releases/qt/5.1/5.1.1/single/qt-everywhere-opensource-src-5.1.1.tar.gzUntar:
Code: [Select]
tar -xzf qt-everywhere-opensource-src-5.1.1.tar.gzGo to directory:
Code: [Select]
cd qt-everywhere-opensource-src-5.1.1
Configure it: (this will successfully configure QT5 with opengl) It doesn't meet all the recommended requirements (gstreamer, GTK theme, libudev) if you know how to get how to get all the recommendations working, feel free to post it
Code: [Select]
./configure -release -opensource -confirm-license -opengl es2 -no-eglfs -no-linuxfb -no-pch -qt-xcb
Make: (Will take a very long time)
Code: [Select]
make -j 2
Make install:
Code: [Select]
make install


Sources:
http://linux-sunxi.org/Qt5
http://lektiondestages.blogspot.nl/2013/05/installing-and-switching-gccg-versions.html
« Last Edit: October 07, 2013, 01:52:00 am by derekdhaas »

Offline wickwire

  • Full Member
  • ***
  • Posts: 144
  • Karma: +10/-0
    • View Profile
Re: Qt5 build for cubieboard
« Reply #26 on: October 04, 2013, 06:33:17 am »
Thanks for sharing!

Talking to ssvb yesterday, I got some additional pointers regarding A20 performance and X11 mali libs:

instead of using r3p0, we are encouraged to go with r3p2 for better performance on A20 over A10 (cubieboard1). As I have it, r3p0 on Cubieboard 2 won't harness the SoC's full potential.

However, r3p2 requires proper kernel support, so it might be that Cubian's stock images aren't directed at this and the same even for  the master branch on github for the sunxi kernel, and so one will have to step back even further to get this working on top performance:

1) Building a kernel from ssvb's github branch (which includes the proper patches) hooking it to an ARM linux rootfs and finishing with a custom SD Card image
2) After successful boot, proceed with X11 mali binaries (but installing r3p2 instead of r3p0) and attempt Qt5 build

I will attempt to do this during the weekend and in the end, compare performance results between A10 and A20 and post any additional steps that may be required over what we already have.


derekdhaas

  • Guest
Re: Qt5 build for cubieboard
« Reply #27 on: October 05, 2013, 03:42:05 am »
My next goal is to compile mlbrowser (a browser build on QT5 & QTWebkit, fully hardware accelerated browser): https://github.com/Topguy/mlbrowser which needs:
- QTWebkit (to compile)
- QT5 (compiled in previous example)

Run before starting:
Code: [Select]
sudo -i
cd /root

Compile QT5Webkit

First we need the prerequirements:
Code: [Select]
aptitude install flex bison gperf libicu-dev libxslt-dev ruby
Didn't install libicu before compiling QT5? Use this step:
Go to the qt-every* folder
Code: [Select]
cd qt-every*
ICU is required to be build in QTBase before compiling QTWebkit, so we have to compile a small portion of QTBase again:

Code: [Select]
cd qtbase/src/plugins/platforms/xcb
make
make install

Compile QTWebkit
Only needed when not installed at first compile
Set the env variables:
Code: [Select]
export QTDIR=/usr/local/Qt-5.1.1
export PATH=$QTDIR/bin:$PATH./

And BUILD: (takes an hour or so)
Code: [Select]
qtwebkit/Tools/Scripts/build-webkit --qt --debug

Compile mlbrowser
Go to /root
Code: [Select]
cd /root
Download mlbrowser from source:
Code: [Select]
git clone https://github.com/Topguy/mlbrowser.git
cd mlbrowser

Configure:
Code: [Select]
mkdir build
cd build
qmake DEFINES+=_BROWSER_ DEFINES+=_MOUSE_ DEFINES+=_PROPERTYCHANGER_ ../src/mlbrowser.pro

replace the line starting with "LIBS" in the Makefile with this line:
Code: [Select]
LIBS = $(SUBLIBS) -L/opt/vc/lib -lQt5WebKitWidgets -pthread -lrt -L/usr/lib/arm-linux-gnueabihf -lQt5Sql -lQt5Quick -lQt5OpenGL -lQt5PrintSupport -lQt5WebKit -lQt5Qml -lQt5Widgets -lQt5Network -lQt5Gui -lQt5Core -lGLESv2 -lpthread
Build:
Code: [Select]
make
make install

Test it:
Code: [Select]
mlbrowser -platform eglfs http://www.cubian.org/
P.s. I'm still compiling and will edit this tutorial along the way.

Used sources:
http://qt-project.org/wiki/Building_Qt_5_from_Git
http://trac.webkit.org/wiki/BuildingQtOnLinux
https://github.com/Topguy/mlbrowser

For those who hate "sudo -i", just append sudo in front of every line except cd and mkdir and use your cubie homedir
« Last Edit: October 05, 2013, 06:36:12 am by derekdhaas »

derekdhaas

  • Guest
Re: Qt5 build for cubieboard
« Reply #28 on: October 06, 2013, 10:36:59 am »
Stuck with a few errors:
Code: [Select]
/home/cubie/qt-everywhere-opensource-src-5.1.1/qtwebkit/Source/WebCore//.obj/release-shared/dom/DOMAllInOne.o: In function `WebCore::TreeScope::findAnchor(WTF::String const&)':
DOMAllInOne.cpp:(.text._ZN7WebCore9TreeScope10findAnchorERKN3WTF6StringE+0xa2): undefined reference to `WebCore::HTMLAnchorElement::name() const'
DOMAllInOne.cpp:(.text._ZN7WebCore9TreeScope10findAnchorERKN3WTF6StringE+0xb8): undefined reference to `WebCore::HTMLAnchorElement::name() const'
/home/cubie/qt-everywhere-opensource-src-5.1.1/qtwebkit/Source/WebCore//.obj/release-shared/dom/DOMAllInOne.o: In function `WebCore::Document::~Document()':
DOMAllInOne.cpp:(.text._ZN7WebCore8DocumentD2Ev+0x382): undefined reference to `WebCore::SVGDocumentExtensions::~SVGDocumentExtensions()'
/home/cubie/qt-everywhere-opensource-src-5.1.1/qtwebkit/Source/WebCore//.obj/release-shared/dom/DOMAllInOne.o: In function `WebCore::Document::implicitClose()':
DOMAllInOne.cpp:(.text._ZN7WebCore8Document13implicitCloseEv+0x94): undefined reference to `WebCore::HTMLLinkElement::dispatchPendingLoadEvents()'
DOMAllInOne.cpp:(.text._ZN7WebCore8Document13implicitCloseEv+0x98): undefined reference to `WebCore::HTMLStyleElement::dispatchPendingLoadEvents()'
DOMAllInOne.cpp:(.text._ZN7WebCore8Document13implicitCloseEv+0xa8): undefined reference to `WebCore::SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements()'
DOMAllInOne.cpp:(.text._ZN7WebCore8Document13implicitCloseEv+0x17e): undefined reference to `WebCore::SVGDocumentExtensions::startAnimations()'
/home/cubie/qt-everywhere-opensource-src-5.1.1/qtwebkit/Source/WebCore//.obj/release-shared/dom/DOMAllInOne.o: In function `WebCore::Document::setTitle(WTF::String const&)':
DOMAllInOne.cpp:(.text._ZN7WebCore8Document8setTitleERKN3WTF6StringE+0x96): undefined reference to `WebCore::HTMLTitleElement::setText(WTF::String const&)'

Haven't got any clue how to fix this.

derekdhaas

  • Guest
Re: Qt5 build for cubieboard
« Reply #29 on: October 07, 2013, 06:48:16 am »
wickwire:

Compiling sunxi-mali using:
Code: [Select]
cd /home/sunxi-mali
git submodule init
git submodule update
make config ABI=armhf VERSION=r3p2-01rel1
make install

Will work correctly, but it's missing:
sunxi_mali_ump_dri2.h:27:21: fatal error: ump/ump.h:

when compiling for example the xf86-video-fbturbo. when changing it back to r3p0 all will compile.