QT5.7.0 cross compile information for NVIDIA TK1



  • Dear All.

    Recently, I am testing QT5.7.0 in the TK1 board.
    But I couldn't set up the QT5.7.

    Below contents is procedure for me.

    << HostPC - Ubuntu 14.04 64bit >>

    1. Install JetPack-L4T-2.2.1-linux-x64.run. for TK1 board.
    2. Download QT5.7 (qt-everywhere-opensource-src-5.7.0.tar.gz)
    3. QT configure
      ./configure -opengl es2 -nomake tests -no-xcb -device linux-jetson-tk1-g++ -device-option CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- -make libs -opensource -confirm-license -release -v
    4. QT make and make install
      make && sudo make install
    5. qmake path = /usr/local/Qt-5.7.0/bin

    << target board - NVIDIA TK1 >>

    1. Download QT5.7 (qtbase-opensource-src-5.7.0.tar.gz) - [ everywhere source is too big. -> no space left on device. ]
    2. QT configure
      ./configure -opengl es2 -nomake tests -no-xcb -nomake examples
    3. QT make and make install
      make && sudo make install
    4. qmake path = /usr/local/Qt-5.7.0/bin

    But I couldn't install QT for Host PC or Target board.
    There are errors in make sequence.
    Anyway, I want to use QT 5.7 or QT 5.6 in TK1 board.
    If i have wrong things, let me know it.
    Or If you have any good informations, let me know it, too.

    Please help me.
    Thanks.

    NTNman.


  • Moderators

    @NTNman said in QT5.7.0 cross compile information for NVIDIA TK1:

    But I couldn't install QT for Host PC or Target board

    How should this work?
    Didn't you already build Qt for the target board in the first step with ./configure -opengl es2 -nomake tests -no-xcb -device linux-jetson-tk1-g++ -device-option CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- -make libs -opensource -confirm-license -release -v
    To install it on the target board you need to copy the built binaries (libraries) to the target board.



  • @jsulm
    Thanks for kind reply.

    You means

    1. I install QT 5.7 in my HOST PC.
    2. And then I must copy(flash) the built binaries(with libraries) to target board.

    Is it right?
    Thanks.


  • Moderators

    @NTNman Yes. In the first step you built Qt for your target board. To use Qt on the board you need to copy all needed binaries from that build to the board.
    In the second step you built Qt for your host PC. This build is only needed if you want to build your application for your host PC and it cannot be used on your target board as it is for a different architecture.



  • It is enougth to compile Qt once with Cross-Compiler on your host PC.

    1. You should specify the '-prefix' option, e.g. as '-prefix /opt/qt'
    2. You should specify an '-sysroot' option with a path to your Tegra's rootfs, e.g. '-sysroot /mnt/tegra-rootfs'
    3. Your Tegra's rootfs should contains all desired dev-packages and there should be fixed some symlinks to system shared libraries (say "hello" and "thanks" to Ubuntu).

    There are a two ways to install this additional packages to your rootfs:

    • Install them on Tegra board directly, and then clone Tegra's rootfs from yout Tegra board to your Host PC, using rsync utility
    • Install them using qemu on your Host PC.
    1. After cross-compilation, you should install your Qt's binaries to rootfs, just call "sudo make install". In this case your Tegra's rootfs will contain the Qt e.g. in rootfs/opt/qt directory

    2. Use rsync to clone rootfs/opt/qt directory back to your Tegra's board, e.g. to same location /opt/qt.



  • Dear Kuzulis.
    Thanks for your kind reply.

    Now, I trying to test by your comments.
    But. there are errors for below comments.


    ./configure -opengl es2 -sysroot /home/ubuntu/NVIDIA_TK1/TK1/Linux_for_Tegra_tk1/rootfs -device linux-jetson-tk1-g++ -device-option CROSS_COMPILE=/usr/bin/arm-linux-gnueabihf- -opensource -confirm-license -prefix /usr/local/qt5 -v

    Found architecture in binary
    CFG_ARCH="arm"
    CFG_CPUFEATURES=" neon"
    Determining architecture... ()
    g++ -c -pipe -g -Wall -W -fPIC -I. -I../../mkspecs/linux-g++ -o arch.o arch.cpp
    g++ -o arch arch.o
    Found architecture in binary
    CFG_HOST_ARCH="x86_64"
    CFG_HOST_CPUFEATURES=" mmx sse sse2"
    System architecture: 'arm'
    Host architecture: 'x86_64'
    Precompiled-headers support enabled.
    /usr/bin/arm-linux-gnueabihf-g++ -c -fvisibility=hidden fvisibility.c
    Symbol visibility control enabled.
    /usr/bin/arm-linux-gnueabihf-g++ --sysroot=/home/ubuntu/NVIDIA_TK1/TK1/Linux_for_Tegra_tk1/rootfs -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
    bsymbolic_functions.c:2:2: error: #error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)."
    #error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)."
    ^
    Symbolic function binding disabled.
    checking for C++11...
    /usr/bin/arm-linux-gnueabihf-g++ -c -pipe -mtune=cortex-a15 -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard --sysroot=/home/ubuntu/NVIDIA_TK1/TK1/Linux_for_Tegra_tk1/rootfs -O2 -std=gnu++11 -Wall -W -fPIC -I. -I/home/ubuntu/NVIDIA_TK1/TK1/Linux_for_Tegra_tk1/rootfs/usr/include -I/home/ubuntu/NVIDIA_TK1/TK1/Linux_for_Tegra_tk1/rootfs/usr/include/arm-linux-gnueabihf -I../../../mkspecs/devices/linux-jetson-tk1-g++ -o c++11.o c++11.cpp
    c++11.cpp:46:19: fatal error: utility: No such file or directory
    #include <utility>
    ^
    compilation terminated.
    make: *** [c++11.o] Error 1
    C++11 disabled.
    ERROR: Qt requires a C++11 compiler and yours does not seem to be that.
    Please upgrade.

    I am trying to find out the solution.
    If you have any information or solution, let me know it.
    Thank you very much.


  • Moderators

    @NTNman Qt 5.7 requires a C++ compiler supporting C++11. Check the version of your compiler with:

    /usr/bin/arm-linux-gnueabihf-g++ --version
    


  • @jsulm
    Thanks for reply.

    gcc version is 4.8.4.
    arm-linux-gnueabihf-g++ (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) 4.8.4
    Copyright (C) 2013 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

    Thanks for help.


  • Moderators

    @NTNman That version should be fine. You should check whether libstdc++ and its dev package (containing the header files) are installed in your sysroot. Somewhere inside /home/ubuntu/NVIDIA_TK1/TK1/Linux_for_Tegra_tk1/rootfs/usr/include you should have a file named "utility".



  • @jsulm

    Dear jsulm
    Thanks for your very kind reply.
    You are right.

    I solved upper issue as I copy libraries to rootfs(sysroot folder).
    And then I successed configure/make/make install.

    But, I have another problem for qtcreator.
    I trying to install qtcreator 3.6.1. (qt-creator-opensource-src-3.6.1.tar.gz)

    When I execute "qmake -r" in qtcreator folder, there is a error

    Project ERROR: Unknown module(s) in QT : designer designercomponents-private.

    If you have any opinion or solution, let me know it.
    Thank you very much and have a nice day!!!


  • Moderators

    @NTNman Why do you want to build QtCreator from sources? If you don't want to run it on your target board, then just install prebuild QtCreator (you can use Qt Online Installer for that).



  • @jsulm
    Dear jsulm

    OK. I see.
    I thought that I must use opensource qtcreator for cross compile.
    If it is not, I will test using online-installer version.
    Thank you very much.!!!!!


  • Moderators

    @NTNman said in QT5.7.0 cross compile information for NVIDIA TK1:

    I thought that I must use opensource qtcreator for cross compile.

    That does not mean you have to build it by yourself :-)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.