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.

HMarioD
  • 842
  • 10
  • 18
  • Why are you not using Qt 5? The QWS mess is simply just not worth dealing with... ;-) – László Papp Sep 27 '13 at 20:46
  • In fact, I have not even mentioned QtQuick2... Besides, software opengl is also fine for QtQuick2... – László Papp Sep 28 '13 at 00:23
  • 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. – HMarioD Sep 28 '13 at 12:16
  • 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. – HMarioD Sep 28 '13 at 12:17
  • Artless: thank, but I don't understand your answer. – HMarioD Sep 28 '13 at 12:29
  • 2
    Try this http://qt-project.org/wiki/TIPandaBoard. – vinay hunachyal Oct 01 '13 at 05:03
  • @HMarioD have u tried above site – vinay hunachyal Oct 04 '13 at 04:34
  • @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?. – HMarioD Oct 04 '13 at 15:50
  • @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)? – artless noise Oct 04 '13 at 20:16
  • 1
    just one more note, weird that you use a `gnueabihf` where `hf` should stand for hardware float and then `-mfloat-abi=softfp` – Alex Oct 05 '13 at 07:14
  • @Alex, you are right, I already correct that. Thank's for answer! – HMarioD Oct 05 '13 at 11:54
  • @Alex, I correct too the -mtune switch for cortex-a9 that match the Pandaboard ES processor OMAP4460. Thank's one more time! – HMarioD Oct 05 '13 at 12:06

3 Answers3

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.

artless noise
  • 21,212
  • 6
  • 68
  • 105
  • Ok, I install the libssl-dev and the Openssl error disappear but the error about floating point format persists. Thanks for your time. – HMarioD Oct 04 '13 at 16:30
  • 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). – HMarioD Oct 04 '13 at 18:11
  • 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. – HMarioD Oct 04 '13 at 18:52
  • 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*. – artless noise Oct 04 '13 at 20:10
  • 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. – HMarioD Oct 04 '13 at 21:58
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.

yegorich
  • 4,653
  • 3
  • 31
  • 37
  • 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. – HMarioD Oct 03 '13 at 14:57
  • @HMarioD 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 http://www.angstrom-distribution.org/ has packages, but I don't have much experience with it. – yegorich Oct 03 '13 at 15:54
  • 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. – HMarioD Oct 03 '13 at 18:52
  • @HMarioD 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? – artless noise Oct 04 '13 at 14:26
  • @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. – HMarioD Oct 04 '13 at 17:00
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
Jens A. Koch
  • 39,862
  • 13
  • 113
  • 141