Need help on Cross compiling Qt 5.1.1 on Imx6
-
ah good good.
now here comes the time-consuming part:take the sd card out and copy everything (cp -r ) from the card to a directory on your local machine. put it somewhere under a directory called rootfs or so
for example /home/erick/projects/rootfs/this is because the cross compile will be for that particular setup and it needs all the include files and libraries on that card. we will be copying this card a few times as we find out missing libraries (in lib packages) and header files (in lib-dev packages)
go to your qt 5.1.1 source directory and cd into qtbase
then run ./configureand keep in mind that this will take a while to get right
@cd qtbase
./configure -opensource -confirm-license -icu -qt-xcb -make libs -no-pch -opengl es2 -prefix /opt/qt5.1.1-armel -device-option CROSS_COMPILE=/home/erick/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-fsl-linux-gnueabi- -device imx6 -sysroot /home/erick/projects/rootfs/ -no-gcc-sysroot@and i am expecting a lot of errors, so don't worry yet.
-
So I assume this will be the hard part and as you said its time consuming, so I better be get started :-D
Before I proceed, can I make one clarification first. On my system, I think theres two qt programs (I'm assuming they are not the same because one is on a qt5 folder and the other is Qt5.1.1)
I got Qt5.1.1 from http://qt-project.org/downloads using the file "Qt 5.1.1 for Linux 32-bit (417 MB) " to install it(which is a GUI installer and I use default setting for installing) which created a folder on my system ( '/home/erick/Qt5.1.1')
I got qt5 from following this procedure:(https://community.freescale.com/docs/DOC-94066)
QT5
These steps are performed on the host
-
Download the git respository for qt5:
$ git clone git://gitorious.org/qt/qt5.git qt5
$ cd qt5
Let us consider this as <QTDir>
-
Create a build directory to install for the qt5 packages. This directory can be in any loctation. For example,
$ sudo mkdir /opt/qt5
$ sudo chown -R <username> /opt/qt5
Let us consider the the installdir as /opt/qt5
-
Enter the Qt5 directory and run the init-repository script to download all the source code for
Qt5. To download all the source code will take about an hour.$ ./init-repository
Update: In the latest Qt5 release the webkit library is included by default and there are some issues trying to compile it.
use the next line to avoid problems if not desired to use webkit.
$ ./init-repository --no-webkit
===============================================================
which created a folder on my system (/home/erick/qt5).
Now the problem is, you mentioned
"go to your qt 5.1.1 source directory and cd into qtbase
then run ./configure"I can't find "configure" file nor the "qtbase" folder on the Qt5.1.1 folder. But it can be found on the qt5 folder (both the qtbase folder and configure file). Logically, I should pick the qt5 folder because it has the component, and run configure (right?) Would it be a problem in the future (assuming I got the correct configuration), that I have only an installation of qt creator for Qt5.1.1 and not for qt5? Can't find also qtcreator on the qt5 folder :-(
on a side note:
both folders(Qt5.1.1 and qt5) contains the files "qeglfshooks_imx6.cpp, qmake.conf, and qplatformdefs.h" though in different paths.
on the qt5 folder it can be found on '/home/erick/qt5/qtbase/mkspecs/devices/linux-imx6-g++'
on the Qt5.1.1 folder it can be found on '/home/erick/Qt5.1.1/5.1.1/gcc/mkspecs/devices/linux-imx6-g++'
I know this is quite a reading, and I do apologize. I just want you to a have a big and clear picture of what's going on over at my part. I really do appreciate the time and effort your putting out in order to help me. Again, Thank you very very much :-D
-
-
the binary (GUI) installer was for your local machine ( intel 32 bit) so we'll ignore that one, we need the sources
after you do a
git clone git://gitorious.org/qt/qt5.git qt5and look in the qtbase directory, you'll probably see that it is completely empty.. they (recently ?) split up all the subprojects into stand alone git projects...
so just go to the /opt/qt5 directory (do a "git pull" to get the latest version )
then also checkout qtbase
git clone git://gitorious.org/qt/qtbase.gitafter that you should see the configure script appear in qtbase.
-
Ok got it. Ignorning the GUI installed qt.
git clone git://gitorious.org/qt/qt5.git qt5 - DONE
and yes the '/home/erick/qt5/qtbase' folder is empty.entered the directory /opt/qt5 folder,
did "git clone git://gitorious.org/qt/qtbase.git". And now I can see a "configure" file and "configure.bat" file in the directory under /opt/qt5/qtbase.should I do these now:
cd qtbase
./configure - opensource - confirm-license - icu - qt- xcb - make libs - no-pch - opengl es2 - prefix /opt/qt5.1.1-armel - device-option CROSS_COMPILE=/home/erick/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-fsl-linux-gnueabi- -device imx6 -sysroot /home/erick/projects/rootfs/ -no-gcc-sysroothow about "-prefix /opt/qt5.1.1-armel -device-option" I assume its pertaining to a directory in which I know I don't have. Or should I just type everything as you instructed.
-
-prefix /opt/qt5.1.1-armel
is where the make install (at the end of all this) will install your cross-compiled qt (on your rootfs )
additional it is also where the make install will install the qmake on your local machine that you will need for cross-compiling
it doesn't matter what you call it, i just called it qt5.1.1-armel because i also have natively compiled versions of qt on my disk, this way i know which is which.
isn't it working ?
-
Currently copying files from the sd card to the host compuater. I'm having a problem with limited storage on my drive. Would it matter if instead I copy it to "/home/erick/projects/rootfs/" I would put it to an additional drive. the path would be "/media/erick/Development-Files/iMx6Files/rootfs' then I would put it as the sysroot directory when Im in the configuring procedure?
-
I have run the configure file almost exactly the same as your parameters except with the directory path for sysroot. I have encountered this error:
"Running configuration tests...
Failed to process makespec for platform 'devices/linux-imx6-g++'
Turn on verbose messaging (-v) to see the final report."As you expected :-D
-
hi,
I managed to fix the the first error problem, but another error showed up. It shows "Could not dertemined target architecture". What could that be? I have no clue :-(
Here's the complete error message:
This is the Qt Open Source Edition.
You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.You have already accepted the terms of the license.
<srcbase> = /opt/qt5/qtbase
<outbase> = /opt/qt5/qtbase
Creating qmake...
make: Nothing to be done for `first'.
Running configuration tests...
Note: PKG_CONFIG_LIBDIR automatically set to /media/erick/Development-Files/iMx6Files/rootfs/usr/lib/pkgconfig:/media/erick/Development-Files/iMx6Files/rootfs/usr/share/pkgconfig:/media/erick/Development-Files/iMx6Files/rootfs/usr/lib/arm-none-linux-gnueabi/pkgconfig
Note: PKG_CONFIG_SYSROOT_DIR automatically set to /media/erick/Development-Files/iMx6Files/rootfsCould not determine the target architecture!
Turn on verbose messaging (-v) to see the final report.
The ICU library support cannot be enabled.
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. -
Hello,
just wanted to share my experience with wandboard-dual iMX6 and Yocto.
The easiest way would be to just take Yocto to build your image with QtEmbedded. Freescale is delivering the following layer to add support
https://github.com/Freescale/fsl-community-bsp-base for a couple of development boards. Even if you don't use the image itself, you will find the proper configuration to configure and cross compile Qt for the iMX6.So just building an image for one of the supported iMX6 development boards, and look in the log-files what bitbake did in the background would propably help you to get it running for your board as well.
Kind Regards
Soilworker -
So I'm having the same problem with 5.2.1 using either the codesourcery or linaro toolchains.
My friend and I have spent 7 hours together trying to build Qt so we can finish a project and we have searched and searched. ANY help would be so appreciated!
using
Sourcery CodeBench Lite 2013.11-33
gcc-linaro-arm-linux-gnueabihf-4.8-2014.03_linux.tar
qt-everywhere-opensource-src-5.2.1@./configure -opensource -confirm-license -qt-xcb -make libs -no-pch -opengl es2 -prefix /opt/Qt5.2.1 -device-option CROSS_COMPILE=/opt/CodeSourcery/G++Lite/bin/arm-none-linux-gnueabi- -device imx6 -sysroot /opt/rootfs -no-gcc-sysroot@
@./configure -opensource -confirm-license -icu -qt-xcb -make libs -no-pch -opengl es2 -prefix /opt/Qt5.2.1 -device-option CROSS_COMPILE=/opt/Linaro/bin/arm-linux-gnueabihf- -device imx6 -sysroot /opt/rootfs -no-gcc-sysroot@
This is the Qt Open Source Edition.
You are licensed to use this software under the terms of
the Lesser GNU General Public License (LGPL) versions 2.1.You have already accepted the terms of the license.
Creating qmake...
make: Nothing to be done for `first'.
Running configuration tests...
Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set.
Note: PKG_CONFIG_SYSROOT_DIR automatically set to /opt/rootfsCould not determine the target architecture!
Turn on verbose messaging (-v) to see the final report.
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
/opt/Qt5/qtbase/mkspecs/devices/linux-imx6-g++. -
Hi there,
I just want to let you know, that I was able to compile QT 5.2.0 a couple a month ago with Yocto (dora) and the additional meta-qt layer. You have to get the jansa-branch of that layer. With that I was able to compile the above version and I guess Mr. Jansa already adapted it for the latest Qt Version as well.
Of course this solution implies a bit of a knowledge of the yocto build system itself. But if you follow this guide:
http://wiki.wandboard.org/index.php/Building_Qt5_using_yocto_on_Wandboard
and adapt it to your target board (in case your board is supported by Yocto), this would propably the easiest way to get it running.
Kind Regards
Soilman
-
I changed my configure to
@/opt/gitQt/qt5/qtbase/configure/ -opensource -confirm-license -qt-xcb -make libs -no-pch -opengl es2 -prefix /opt/Qt5.2.1 -device-option CROSS_COMPILE=/opt/Linaro/bin/arm-linux-gnueabihf- -device imx6 -sysroot /opt/rootfs -no-gcc-sysroot -developer-build -no-gtkstyle -xplatform linux-arm-gnueabi-g++@
and that got rid of the target architecture error...
Now this remains:
@Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set.
Note: PKG_CONFIG_SYSROOT_DIR automatically set to /opt/rootfs
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
/opt/gitQt/qt5/qtbase/mkspecs/linux-arm-gnueabi-g++.
@ -
edit: stupid question...
-
Hi tunahammer,
before I started to compile Qt with the help of Yocto, I was trying it in the same you are currently doing and I ran into the same issue.
To make this error disappear, I had to specify inside the make-spec the path to the includes and the library of opengl inside my target sysroot.
After that I was able to get one step further.
Kind Regards
Soilman -
It appears the manufacturer does not include the correct files for opengl in their sysroot for this device. Am I correct in thinking I need to download the source and compile a version of opengl es2 or is this generic enough that I could try to find someone else with a project with these for an imx6 and use theirs?
-
Hi tunahammer,
you can either use the sysroot which is provided by freescale (on the website under downloads for imx6 - ubuntu), or you could also use the yocto build system to automatically create a sysroot for you.
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6Q&fpsp=1&tab=Design_Tools_Tab#
I tried it both ways and it was working fine.
And yes I think you could also use a sysroot from another project like the wandboard.org which uses the imx6 as well.
See here the important parameters for my build with yocto:
linux-imx6-g++:...
QMAKE_INCDIR_OPENGL_ES2 += /home/linuxdev/DevStuff/poky-dora-10.0.0/fsl-community-bsp-platform/build/tmp/sysroots/wandboard-dual/usr/include
QMAKE_LIBDIR_OPENGL_ES2 += /home/linuxdev/DevStuff/poky-dora-10.0.0/fsl-community-bsp-platform/build/tmp/sysroots/wandboard-dual/usr/lib...
IMX6_CFLAGS = -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1 -mfloat-abi=hard -DQT_NO_GLIB
-
I would have never ever found those files Oo
Here they are:
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=i.MX6Q&fpsp=1&tab=Design_Tools_Tab#
Software Development Tools (15)
Set of applications for the Linux L3.0.35_4.1.0 BSP/Vivante_VDK-v1.4.6/Linux L3.0.35_4.1.0 GPU Driver with vprofiler/drivers
-
Soilworker,
I'm moving to a new thread since it's probably more fitting, please follow if you can sir!