Cross-compiling Qt for Pandaboard
Asked Answered
H

3

5

I spend weeks trying to cross compile Qt for my Panda board and no way, I can't pass the ./configure. If someone could give me a help I'll appreciate.

My host system is Ubuntu-13.04 ×86_64bit(running un Virtualbox)

My target system is Pandaboard ES Ubuntu-12.04.

All the steps in host box:

sudo apt-get install arm-linux-gnueabihf

sudo mkdir /opt/qt-485-armhf

cd /usr/src

sudo wget http://download.qt-project.org/official_releases/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.tar.gz

sudo tar xf qt-everywhere-opensource-src-4.8.5.tar.gz

cd /usr/src/qt-everywhere-opensource-src-4.8.5

sudo cp -r mkspecs/qws/linux-arm-gnueabi-g++ mkspecs/qws/linux-arm-gnueabihf-g++

sudo vim mkspecs/qws/linux-arm-gnueabihf-g++/qmake.conf
-------------------------------
include(../../common/gcc-base-unix.conf)
include(../../common/g++-unix.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)

#Compiler Flags to take advantage of the ARM architecture
#N.B.:I also tried to uncomment the two following instructions with no success   
QMAKE_CFLAGS = -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard
QMAKE_CXXFLAGS = -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard

# modifications to g++.conf
QMAKE_CC                = arm-linux-gnueabihf-gcc
QMAKE_CXX               = arm-linux-gnueabihf-g++
QMAKE_LINK              = arm-linux-gnueabihf-g++
QMAKE_LINK_SHLIB        = arm-linux-gnueabihf-g++

# modifications to linux.conf
QMAKE_AR                = arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY           = arm-linux-gnueabihf-objcopy
QMAKE_STRIP             = arm-linux-gnueabihf-strip

load(qt_config)
---------------------------------

sudo sed -i -e "/#if/d" -e "/#error/d" -e "/#endif/d" config.tests/unix/libmng/libmng.cpp (This command fixes detection of libmng 2.0.)
export QTDIR=/opt/qt4-485-armhf
And finally:
sudo ./configure -prefix /opt/qt4-485-armhf -sysconfdir /etc/xdg -embedded arm -little-endian -host-big-endian -no-qt3support -nomake examples -nomake demos -opensource -confirm-license -release -openssl-linked -no-phonon -no-phonon-backend -no-nis -platform qws/linux-x86_64-g++ -xplatform qws/linux-arm-gnueabihf-g++ -optimized-qmake

With this result:
Creating qmake. Please wait...
g++ -c -o option.o -pipe -m64 -DQMAKE_OPENSOURCE_EDITION -O2 -g -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/mac -Igenerators/symbian -Igenerators/integrity -I/usr/src/qt-everywhere-opensource-src-4.8.5/include -I/usr/src/qt-everywhere-opensource-src-4.8.5/include/QtCore -I/usr/src/qt-everywhere-opensource-src-4.8.5/src/corelib/global -I/usr/src/qt-everywhere-opensource-src-4.8.5/src/corelib/xml -I/usr/src/qt-everywhere-opensource-src-4.8.5/tools/shared -DQT_NO_PCRE -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL -DQT_NO_COMPRESS -I/usr/src/qt-everywhere-opensource-src-4.8.5/mkspecs/qws/linux-x86_64-g++ -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DEPRECATED  option.cpp
g++ -o "/usr/src/qt-everywhere-opensource-src-4.8.5/bin/qmake" project.o property.o main.o makefile.o unixmake2.o unixmake.o mingw_make.o option.o winmakefile.o projectgenerator.o meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o borland_bmake.o msvc_vcproj.o msvc_vcxproj.o msvc_nmake.o msvc_objectmodel.o msbuild_objectmodel.o symmake.o initprojectdeploy_symbian.o symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o gbuild.o qtextcodec.o qutfcodec.o qstring.o qtextstream.o qiodevice.o qmalloc.o qglobal.o qbytearray.o qbytearraymatcher.o qdatastream.o qbuffer.o qlist.o qfile.o qfilesystementry.o qfilesystemengine_unix.o qfilesystemengine.o qfilesystemiterator_unix.o qfsfileengine_unix.o qfsfileengine.o qfsfileengine_iterator.o qregexp.o qvector.o qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o qfileinfo.o qdatetime.o qstringlist.o qabstractfileengine.o qtemporaryfile.o qmap.o qmetatype.o qsettings.o qsystemerror.o qlibraryinfo.o qvariant.o qvsnprintf.o qlocale.o qlocale_tools.o qlocale_unix.o qlinkedlist.o qnumeric.o qcryptographichash.o qxmlstream.o qxmlutils.o  


You have not explicitly asked to use pkg-config and are cross-compiling.
pkg-config will not be used to automatically query cflag/lib parameters for
dependencies


The system floating point format could not be detected.
This may cause data to be generated in a wrong format
Turn on verbose messaging (-v) to see the final report.
OpenSSL support cannot be enabled due to functionality tests!
 Turn on verbose messaging (-v) to ./configure to see the final report.
 If you believe this message is in error you may use the continue
 switch (-continue) to ./configure to continue.

Thanks in advance.

Headwaters answered 27/9, 2013 at 20:32 Comment(12)
Why are you not using Qt 5? The QWS mess is simply just not worth dealing with... ;-)Raskin
In fact, I have not even mentioned QtQuick2... Besides, software opengl is also fine for QtQuick2...Raskin
Laszlo: Thank for your answer. I already have QT4 installed in both,host and target machines. I successfully compile and run locally in both. Also I already have installed in host the Angstrom arm toolchain which compile successfully too, but the compiled app not run in target machine it exit with a file not found message, I think the problem occur because the angstrom toolchain is for gnueabi and for OMAP4430 it need gnueabihf, for that reason I'm trying to build a gnueabihf toolchain in my host box.Headwaters
I split my comment because is too long.As I was noticed reading many papers, QT5 isn't ready yet for OMAP4, when I install QT5 in the Pandaboard the video drivers became irresponsible and de video performance slow down at the point you can use it.Headwaters
Artless: thank, but I don't understand your answer.Headwaters
Try this qt-project.org/wiki/TIPandaBoard.Shadshadberry
@Headwaters have u tried above siteShadshadberry
@vinayhunachyal I read but not try it yet because I don't understand some points on it, for example how I will install the SGX drivers without graphic interface? I need to run a QTwidget app that play videos, sorry my ignorance, but it's possible do that without X11?.Headwaters
@vinayhunachyal That link is for Qt5. However, I see that the PandaBoard does have a PowerVR GPU, so as per Laszlo, the Qt5 is a better option, but I think he wants it to be compatible with another board that doesn't have Qt5 (and a GPU/OpenGL)?Henbit
just one more note, weird that you use a gnueabihf where hf should stand for hardware float and then -mfloat-abi=softfpCassiopeia
@Alex, you are right, I already correct that. Thank's for answer!Headwaters
@Alex, I correct too the -mtune switch for cortex-a9 that match the Pandaboard ES processor OMAP4460. Thank's one more time!Headwaters
H
5

To cross-compile a program on a PC you must have the development files for the same packages installed on the PC as the ARM target. Qt 4.8 depends on OpenSSL, so you must get the correct development files for the ARM release if you wish to compile Qt.

  1. Install a Ubuntu 12.04 PC virtual box. SAME VERSION as the board.
  2. Get the compiler. apt-get install arm-linux-gnueabihf (You knew that).
  3. Get required development packages. apt-get install libssl-dev or
    apt-get build-dep -aarmhf qt4 (which only works for X11).
  4. Edit your Qt configuration to suit your needs and build it.

The current step you are missing is step 3; but to perform it you need step 1 or some other way to get the OpenSSL development files for Ubuntu 12.04. There is probably some other way to do this using apt.sources. I think the steps above will be easiest for you.

Henbit answered 4/10, 2013 at 14:55 Comment(5)
Ok, I install the libssl-dev and the Openssl error disappear but the error about floating point format persists. Thanks for your time.Headwaters
I was added -armfpa and the errors persist. I don't find documentation about this switch. mkspecs/qws/pandaboard folder is not present in the files I downloaded(qt-everywhere-opensource-src-4.8.5).Headwaters
I already try both with no success, when I write the question I paste the text of one of the many tries. Actually I don't see any example that use this switch.Headwaters
So with -embedded arm -little-endian -host-little-endian -armfpa, you still have issues with the floating point detection? Can you use the -v option as well and give some relevant configure output? This doesn't make sense; I am reading the configure script and this should not happen. Are you sure you have all of those options. None of these options have a double dash, only single.Henbit
I don't know what happen but the floating point error magically disappear. The only thing I do was restart Virtualbox and add -v to configure string I don't write a new one just use the cache pressing up arrow key and add -v. The "You have not explicitly asked to use pkg-config..." error persist. Now configure configure run until the end with a lot of messages like " Disabling video due the lack of GLib/Gio/GStreamer." or "Failure to find: generated/DrawingAreaMessageReceiver.cpp". But surely that is another history. Is too late for me I need sleep, thank you very much for your time.Headwaters
M
4

Here is an alternative approach. As you are going to use Qt, you don't necessarily need Ubuntu. Simple rootfs with Qt Embedded could be sufficient.

I'll describe, how you can create rootfs and your application using Buildroot(BR). BR already has a config file for Pandaboard. All you need to is to download BR and execute:

make pandaboard_defconfig

After that you can choose between Qt4 and Qt5 in the menuconfig.

For your application I'd suggest using CMake infrastructure, but it is a matter of taste. This article is about source directory override mechanism in BR.

Mcconaghy answered 3/10, 2013 at 14:3 Comment(5)
yegorich: Thank you for answer, I'll read the docs and eventually test your approach but, question, if I don't have Ubuntu how I will install and upgrade packages? I do it now using apt-get. Sorry for the question but I'm new in Linux world until now I was used only Ubuntu.Headwaters
@Headwaters that's a drawback/feature of BR: it's quite simple to use and extend, but you don't have packages concept as in Debian/Ubuntu. If you want to update some programs, you'll have to compile the new versions and copy files manually or just create the whole new image/rootfs. BR is good for dedicated tasks, where you know, what software you'll need to accomplish your task from the very beginning, so you don't need to install new packages afterwards. Another embedded distribution angstrom-distribution.org has packages, but I don't have much experience with it.Mcconaghy
thanks for answer, I think that is not suitable for my project, actually I already have Ubuntu & QT running and compiling in both host and target machines, what I need is avoid edit and compiling in target doing all the development in host and cross compile for Pandaboard target. Thanks anyway.Headwaters
@Headwaters This is exactly what he is describing. How did the existing Qt get to your ARM board? Did you load some image from somewhere? Where is that image located? You used some Ubuntu installer to get it there? You wish to use the existing ARM Ubuntu filesystem and just upgrade/install Qt. Is that correct?Henbit
@artlessnoise, I get ubuntu-12.04-preinstalled-desktop-armhf+omap.img from Ubuntu site, dd to sd card. Do the upgrades, install Additional drivers for OMAP4 from Installer, install QT from terminal using apt-get. My ideal target is have a QT5 cross compiling for Panda as target, I need to run and app that play promotional videos just one app just one window, the app is already running in my PC(IMAC) and I develop using QT5 widgets. I don't care about witch will be the target system just choose ubuntu because I like.Headwaters
T
0

try to get the version off gcc in your Pandaboard Ubuntu OS and if is the same arm-linux-gnueabihf-gcc version or less like 4.6 hint the config in your qmake.config

#QMAKE_CFLAGS = -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard
#QMAKE_CXXFLAGS = -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=hard
Truthfunction answered 9/9, 2014 at 22:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.