Coding Chase - Projects

My 3D Hub

Thank You For Donating:

Ikeeki (linux-sunxi@irc.freenode.net)
Computer Troubleshooters Brasil

Wednesday, 21 May 2014

Qt 5.2.1 pre-made images - revisited

Recently, a cubieforums user commented on the Qt5 thread with issues regarding Qt Creator configurations, when adding the pre-compiled Qt 5.2.1 environment, specifically, when attempting to use the Linaro ARM gcc binaries.

I took some time to verify the issue and post a step-by-step quick guide, receiving positive feedback from the user in question - and as such, I thought it might also have a place here in the blog.

To recap, I built the environment using an 64bit host system, while the Cubieboard environment itself works with a 32bit instructions set.

If, instead of going through the hard road of cross-compiling the Qt source code on your own environment, you've attempted to use my development suite for rapid deployment and faced this - or other problems, below is a step-by-step Quick Guide for setting up the pre-compiled Qt 5.2.1 environment available for download at cubieforums.

The base will be a Virtualbox Virtual Machine which will house the development environment with Qt Creator, the cross-compiled Qt 5.2.1 binaries and overall, a clean solution for you to start coding in Qt and deploying your creations to Cubieboard, rather than spend any more time getting to this point.


------------------------- Quick Guide -------------------------

Step #1 : Virtualbox > Ubuntu 14.04 LTS Desktop Clean Install

Step #2 : switched to the Documents dir

wickwire@qt5box:~/Documents$

Step #3 : grabbed the linaro arm gcc

wickwire@qt5box:~/Documents$ wget http://releases.linaro.org/13.09/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux.tar.bz2

Step #4 : decompressed the archive

wickwire@qt5box:~/Documents$ tar xvjpf gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux.tar.bz2

Step #5 : descended to the bin dir

wickwire@qt5box:~/Documents$ cd gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin/

Step #6 : executed the arm-gcc binary and confirmed the problem

wickwire@qt5box:~/Documents/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin$ ./arm-linux-gnueabihf-g++
-bash: ./arm-linux-gnueabihf-g++: No such file or directory
wickwire@qt5box:~/Documents/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin$ 

Step #7 : updated apt-get

wickwire@qt5box:~/Documents/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin$ sudo apt-get update

Step #8 : searched for ia32-libs - 32bit support under x64

wickwire@qt5box:~/Documents$ sudo apt-get install ia32-libs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  lib32z1 lib32ncurses5 lib32bz2-1.0

E: Package 'ia32-libs' has no installation candidate

Step #9 : installed the suggested replacement packages

wickwire@qt5box:~/Documents/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin$ sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0

Step #10 : executed the arm gcc binary again

wickwire@qt5box:~/Documents/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin$ ./arm-linux-gnueabihf-g++
./arm-linux-gnueabihf-g++: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
wickwire@qt5box:~/Documents/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin$

Step #11 : installed the missing libstdc package, 32bit version 

wickwire@qt5box:~/Documents/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin$ sudo apt-get install libstdc++6:i386

Step #12 : executed the arm gcc binary - success!

wickwire@qt5box:~/Documents/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin$ ./arm-linux-gnueabihf-g++ -v
Using built-in specs.
COLLECT_GCC=./arm-linux-gnueabihf-g++
COLLECT_LTO_WRAPPER=/home/wickwire/Documents/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin/../libexec/gcc/arm-linux-gnueabihf/4.8.2/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: /cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/src/gcc-linaro-4.8-2013.09/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-linux-gnueabihf --prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install --with-sysroot=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-languages=c,c++,fortran --enable-multilib --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3-d16 --with-float=hard --with-pkgversion='crosstool-NG linaro-1.13.1-4.8-2013.09 - Linaro GCC 2013.09' --with-bugurl=https://bugs.launchpad.net/gcc-linaro --enable-__cxa_atexit --enable-libmudflap --enable-libgomp --enable-libssp --with-gmp=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpfr=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-mpc=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-isl=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-cloog=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --with-libelf=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/.build/arm-linux-gnueabihf/build/static --enable-threads=posix --disable-libstdcxx-pch --enable-linker-build-id --enable-gold --with-local-prefix=/cbuild/slaves/oorts/crosstool-ng/builds/arm-linux-gnueabihf-linux/install/arm-linux-gnueabihf/libc --enable-c99 --enable-long-long --with-mode=thumb
Thread model: posix
gcc version 4.8.2 20130902 (prerelease) (crosstool-NG linaro-1.13.1-4.8-2013.09 - Linaro GCC 2013.09) 
wickwire@qt5box:~/Documents/gcc-linaro-arm-linux-gnueabihf-4.8-2013.09_linux/bin$

------------------------- Quick Guide -------------------------

From this point on, you should only have to

- decompress the qt5cb2fb or qt5cb2x11 tar.bz2 archives to /usr/local/ on the VM OS

- and then run
/usr/local/qt5cb2fb/bin/qmake -v

to obtain the expected Qt 5.2.1 pre-compiled libraries path:

QMake version 3.0
Using Qt version 5.2.1 in /opt/qt5.cubieboard2.workbench/cubie-rootfs/usr/local/qt5cb2fb/lib

From here, you'll need to mount the downloaded SD Card image to /opt/qt5.cubieboard2.workbench/cubie-rootfs so that qmake is able to find the corresponding cross-compiled Qt 5.2.1 libraries, on the VM OS.

This same image should be written to an available microSD card and loaded onto your Cubieboard device - so as to have two identical systems, the native one running on Cubieboard and the VM installed one, which will be used to cross-compile your future Qt5 Apps.

Set up Qt Creator by adding the Linaro GCC binary + the qmake binary + the remote ssh access to your Cubieboard and that should be all!

No comments :

Post a Comment