This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

QT 5 on AM335x

Hi,

I would like to get QT 5 installed on my BeagleBone but since I am new to this I would like to clear up how that is done. If I am not mistaken I should end up with QT 5 target build for Sitara MPUs by following the instructions on this site: http://gpupowered.org/node/10

But this is only for the target. I am a bit confused about how to get my development environment set up on my PC (Ubuntu 12.04 LTS). My reasoning is, that QT is a cross platform framework so I can just set up QT for my PC, write my applications on the PC, test them and once they are running fine on the PC just cross compile them for my target and they should work just fine on my BeagleBone once copied to it (minding the installation paths for the libraries). But after googling for a while I am not so sure this will work. For starters I am worried that QT on my development machine should at least be somehow aware of this sgx mentioned in above link.

I seem to be missing a general idea of how QT on development machine and QT on embedded machine come together. And whereas I could find many details about QT I was yet unable to find a more general description in terms of: "One needs to separately build QT for the development machine and target. One must be aware of the other so they must be configured (./configure) with the same modules while they will usually differ in  for example -platform, -xplatform, ..."

Things also causing confusion are for example use of OpenGL or OpenGLES. I would imagine target would use the latter whereas development machine could use the former. Also there is the frame buffer. From my googling I kind of came to the conclusion the frame buffer mostly comes into play on the target machine.

From my confused writing above I am sure it can be seen that I am lacking some sort of "high-level" understanding of QT. I would like to kindly ask for some help in acquiring that. For starters I would just like to know how to set up a QT development environment on my PC and how to build QT for my target (the BeagleBone) in terms of what I must watch out for when building the QT source - which QT configuration options on the PC depend on QT configuration options for my board.

I am sure after understanding that a lot of my questions will get answered and I will be able to find answers to those which don't much easier. Hopefully I will be able to get QT running on my Beaglebone in the end and a useful "howto" will come out of all this.

Thank you in advance for al your help. It is deeply appreciated.

Cheers!

p.s.: I tried getting some help on QT forums already but unfortunately was unsuccessful.

  • - OpenGL ES2.0 is the minimum requirement (not OpenGL). Thus, on Linux machines, mesa will be used. On Windows, there was a plan to use GLES2 to DirectX conversion, but I have not tested it. It is preferred to use Linux machines for host also.

    - For transitioning between Host and Target, from an application perspective (ex using QML), there should not be differences. Text rendering etc will be different, behaviour of platform plugins can also be different. Input mechanisms will also be different (ex Mouse vs Touchscreen)

    - On host machine, in general just a ./configure will work. For target cross-compilation, please use steps provided in link you have already.

  • Hello Prabindh,

    thank you for your reply.

    On this site: http://doc.qt.digia.com/qt/qt-embedded-install.html an example of using at least a -embedded option with ./configure is given. So it seems to me that QT on my development machine needs to be made aware that it will be used for developing applications for embedded Linux. And it is made aware by using correct options with ./configure script. As I understand it these options are translated by ./configure script into suitable environment variables which are used by  qmake so that it can produce proper makefiles. Am I correct so far?

    What did you mean when you wrote "in general just a ./configure will work"? Could you perhaps give an example of a ./configure command and options for a Linux development machine which will be used to develop QT applications (using a GUI and 3D graphics) for embedded Linux running on Sitara processor (for example AM355x)?

    Thank you for your help.

  • This link (http://doc.qt.digia.com/qt/qt-embedded-install.html) is for Qt4.7 not Qt5 hence it is not applicable.

    Please check (http://qt-project.org/wiki/Building_Qt_5_from_Git#edc9f0a5a5d57797bf68e37364743831) for the build dependencies, and the build method.  If you try this and face issues on the host, please post back and I will be able to help.

  • OK, will try it. So just to double check... In the configure stage the following options should be enough for a Linux development machine which will be used to develop QT applications (using a GUI and 3D graphics) for embedded Linux running on Sitara processor (for example AM355x)?

    ./configure -developer-build -opensource -nomake examples -nomake tests -no-gtkstyle

  • Hi,

    I've been following instructions on the link you provided step by step, trying to figure out what I'm doing along the way. I think all is going well so far but before I proceed I have one more question.

    So far I installed all dependencies and am ready to run the configure script. From the link:
    "The Qt5 build system should be fairly resilient against any “outside distractions” – it shouldn’t matter whether you have other Qt versions in PATH, and QTDIR is entirely ignored. However, make sure that you have no qmake-specific environment variables like QMAKEPATH or QMAKEFEATURES set, and the qmake -query output does not refer to any other Qt versions ($HOME/.config/Trolltech/QMake.conf should be empty)."

    • I seem to have have a QMAKESPEC variable defined from before (QMAKESPEC=/home/casper/LinuxDevelopment/ti-sdk-am335x-evm/linux-devkit/arm-arago-linux-gnueabi/usr/share/qtopia/mkspecs/linux-g++)
    • qmake -query gives the following output:
      QT_INSTALL_PREFIX:/usr
      QT_INSTALL_DATA:/usr/share/qt4
      QT_INSTALL_DOCS:/usr/share/qt4/doc
      QT_INSTALL_HEADERS:/usr/include/qt4
      QT_INSTALL_LIBS:/usr/lib/i386-linux-gnu
      QT_INSTALL_BINS:/usr/bin
      QT_INSTALL_PLUGINS:/usr/lib/i386-linux-gnu/qt4/plugins
      QT_INSTALL_IMPORTS:/usr/lib/qt4/imports
      QT_INSTALL_TRANSLATIONS:/usr/share/qt4/translations
      QT_INSTALL_CONFIGURATION:/etc/xdg
      QT_INSTALL_EXAMPLES:/usr/lib/qt4/examples
      QT_INSTALL_DEMOS:/usr/lib/qt4/demos
      QMAKE_MKSPECS:/usr/share/qt4/mkspecs
      QMAKE_VERSION:2.01a
      QT_VERSION:4.8.

    So it seems I already have Qt4.8 installed. My question is do I have to remove it before installing Qt5 and if so, how do I do that?

    Or will deleting the QMAKESPEC environment variable and unsetting all of qmake's persistent properties by using qmake -unset property do the trick?

    Perhaps I have to do it all? Delete Qt4.8 and delete QMAKESPECS and qmake's properties?

    Thanks.

  • I generally clear all env variables, and have only the toolchain, and the path to qmake (ie QTDIR/qtbase/bin) set.

     

  • I'm afraid I don't understand what you mean.

    1)What do you mean you mean by "only have the toolchain set"? Path to it has to be in the PATH env variable? Alongside QTDIR/qtbase/bin? And so you only have one env variable set and that is PATH=path_too_toolchain: QTDIR/qtbase/bin ? No other variables are shown when issuing the printenv command?

    2)When looking through my file system I found two qmake's. One is qmake-qt4 in /usr/bin and the other is qmake2 in linux-devkit/bin of TI's SDK for Sitara. I take it the first one will be used during ./configure of Qt5. But that qmake already has some persistent properties set as is shown by qmake -query (see in my previous post). So what do I do about that? Should I just ignore the warning on http://qt-project.org/wiki/Building_Qt_5_from_Git#edc9f0a5a5d57797bf68e37364743831 where it says "make sure that ... qmake -query output does not refer to any other Qt versions" ?

  • 1) I meant only the path variable. You will ofcourse have other paths in the PATH, but ensure the toolchain and the QT5DIR/qtbase/bin is in the first slot. ie,  something like below.

    PATH=<TOOLCHAINPATH>:QT5DIR/qtbase/bin:$PATH

    2) Both qmakes are NOT to be used. Note that while building, Qt builds its own qmake, and that is always the one to be used. That is why we need to specify that path in the PATH variable.

    No dont ignore that warning. By doing above step, the qmake binary built out of Qt5 is made current. And it will be used.

     

  • Ah... Now I remeber I once read something about QT's qmake bootstraping itself. However if qmake will be built then why must qmake -query not give any output as is stated on the referenced web page? If qmake -query outputs something before running ./configure it shouldn't matter since this qmake will not be used during configuration is that not so? We just established that a "new" qmake will be built and used for generating QT5's makefiles.

  • Ok, so here are my endeavours:

    I installed all of the packages listed on http://qt-project.org/wiki/Building_Qt_5_from_Git#edc9f0a5a5d57797bf68e37364743831
    cd ~/QT5
    git clone git://gitorious.org/qt/qt5.git qt5
    perl init-repository --no-webkit
    Deleted QMAKESPEC env variable which was present
    export PATH=/usr/bin:/home/casper/QT5/qt5/qtbase/bin:$PATH
    sudo apt-get remove qt4-qmake (to ensure the currently installed qmake would not interfere with QT5's configuration - qt 4.8.1 is already installed on my PC from before)
    ./configure -developer-build -opensource -nomake examples -nomake tests -no-gtkstyle -confirm-licens

    After configuring I got the following output:

    Build type:    linux-g++
    Architecture:  i386, features:
    Host architecture: i386, features:
    Platform notes:

                - Also available for Linux: linux-kcc linux-icc linux-cxx
            
    Build .................. libs tools
    Configuration ..........  qpa largefile precompile_header sse2 sse3 ssse3 sse4_1 sse4_2 avx pcre  minimal-config small-config medium-config large-config full-config fontconfig evdev xlib xrender xcb-render xcb-glx xcb-xlib linuxfb c++11 accessibility opengl shared qpa reduce_exports reduce_relocations clock-gettime clock-monotonic mremap getaddrinfo ipv6ifname getifaddrs inotify system-png png system-freetype system-zlib nis iconv glib dbus openssl xcb xinput2 rpath icu concurrent audio-backend v8 v8snapshot debug private_tests
    Debug .................. yes
    C++11 support .......... yes
    pkg-config ............. yes
    QtDBus module .......... yes (run-time)
    QtConcurrent code ...... yes
    QtGui module ........... yes
    QtWidgets module ....... yes
    JavaScriptCore JIT ..... To be decided by JavaScriptCore
    QML debugging .......... yes
    PCH support ............ yes
    SSE2/SSE3/SSSE3......... yes/yes/yes
    SSE4.1/SSE4.2........... yes/yes/yes
    AVX/AVX2................ yes/no
    IPv6 ifname support .... yes
    getaddrinfo support .... yes
    getifaddrs support ..... yes
    Accessibility .......... yes
    NIS support ............ yes
    CUPS support ........... no
    Iconv support .......... yes
    Glib support ........... yes
    GStreamer support ...... no
    PulseAudio support ..... no
    Large File support ..... yes
    GIF support ............ plugin
    JPEG support ........... plugin (qt)
    PNG support ............ yes (system)
    zlib support ........... system
    Session management ..... auto
    libudev support ........ no
    Use system proxies ..... no
    OpenGL support ......... yes (Desktop OpenGL)
    OpenVG support ......... no
    XShape support ......... auto
    XVideo support ......... auto
    XSync support .......... auto
    Xinerama support ....... runtime
    Xcursor support ........ runtime
    Xfixes support ......... runtime
    Xrandr support ......... runtime
    Xi support ............. no
    Xi2 support ............ yes
    MIT-SHM support ........ auto
    FontConfig support ..... yes
    XKB Support ............ auto
    GTK theme support ...... no
    SQLite support ......... plugin (qt)
    OpenSSL support ........ yes (run-time)
    Alsa support ........... no
    libICU support ......... yes
    PCRE support ........... qt
    Xcb support ............ system
    Xrender support ........ yes
    EGLFS support .......... no
    DirectFB support ....... no
    LinuxFB support ........ yes
    KMS support ............ no
    Qt is now configured for building. Just run 'make'.
    Once everything is built, Qt is installed.
    You should not run 'make install'.
    To reconfigure, run 'make confclean' and 'configure'.

    Next step was make. After quite a while make seemed to have finished successfully.

    I then did git submodule foreach --recursive "git clean -dfx".

    However I noticed, that the build did not build me a new qmake (qmake -querry for example gave an error, that qmake was not found so I re-installed it by doing sudo apt-get install qt4-qmake).

    I figured I would try making a simple program to test the new QT5 installation. So I made a new folder within my qt5 directory (qt_installation_dir/MyApplications/Test) and put in the following main.cpp file:

    #include <iostream>
    #include <string>

    using namespace std;

    int main(int argc,char *argv[])
    {
        cout << "Hello" << endl;
        return 0;    
    }

    I then did:

    qmake -project (which generated a Test.pro file)
    qmake (generated a Makefile)
    make

    The last make gave the following error:

    g++ -Wl,-O1 -o Test main.o    -L/usr/lib/i386-linux-gnu -lQtGui -lQtCore -lpthread 
    /usr/bin/ld: cannot find -lQtGui
    /usr/bin/ld: cannot find -lQtCore
    collect2: ld returned 1 exit status
    make: *** [Test] Error 1

    It seems to me that some libraries are either not installed or can't be found by the linker.

    Based on all of this I have two questions (well actually three - one left from my previous post):

    1. See my previous post.
    2. Why was qmake not built when configuring and building qt5 and was installing qt4-qmake a wrong thing to do?
    3. What could be causing above errors when building my simple application?

    Thanks for the help.