Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Cross-compiling Qt 5.0 for iMX6 on Phytec development board
Forum Updated to NodeBB v4.3 + New Features

Cross-compiling Qt 5.0 for iMX6 on Phytec development board

Scheduled Pinned Locked Moved Installation and Deployment
12 Posts 3 Posters 16.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bceldran
    wrote on last edited by
    #2

    I finally managed to get it build with the following configure options :

    @./configure -opensource -confirm-license -opengl es2 -device linux-imx6-g++ -directfb -eglfs -v -device-option CROSS_COMPILE=/opt/OSELAS.Toolchain-2012.12.0/arm-cortexa9-linux-gnueabihf/gcc-4.7.3-glibc-2.16.0-binutils-2.22-kernel-3.6-sanitized/bin/arm-cortexa9-linux-gnueabihf- -no-gcc-sysroot -prefix /usr/local/Qt-5.0.0/Qt-imx6-1 -optimized-qmake -reduce-relocations -reduce-exports -make libs -no-pch
    @

    The trick was to set correctly the headers into the qmake.conf file into the qtbase/mkspecs/devices/linux-imx6-g++ folder.

    @#

    qmake configuration for the Freescale iMX6 boards (single, dual and quad)

    This mkspec is based and tested on the ltib-source-release 3.0.15

    Building ltib including glib, gpu-drivers and what ever you want to use (e.g. dbus or fontconfig)

    This mkspec is tested with a framebuffer (eglfs) configuration (not testes with X11)

    A typical configure line looks like:

    /home/tsenyk/qt5/qt5/configure -opensource -confirm-license -make libs -device imx6 \

    -device-option CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-fsl-linux-gnueabi- \

    -sysroot <path-to-your-ltib-install>/rootfs -no-gcc-sysroot \

    -prefix /usr/local/Qt-5.0.0/Qt5-imx6-1

    NOTE: currently ltib doesn't produce a proper staging/sysroot-filessystem.

    If gcc's --sysroot is used, the toolchain doesn't find basic binaries (e.g. crt1.o),

    therefore you have to pass -no-gcc-sysroot to configure if you pass -sysroot to configure!

    include(../common/linux_device_pre.conf)

    EGLFS_PLATFORM_HOOKS_SOURCES = $$PWD/qeglfshooks_imx6.cpp

    DISTRO_OPTS += hard-float

    #QMAKE_INCDIR += $$[QT_SYSROOT]/usr/include
    #QMAKE_LIBDIR += $$[QT_SYSROOT]/usr/lib

    QMAKE_INCDIR = /home/bruno/BSP/BSP-Phytec-phyFLEX-i.MX6-PD12.0.3/platform-mx6/sysroot-target/include /home/bruno/BSP/BSP-Phytec-phyFLEX-i.MX6-PD12.0.3/platform-mx6/sysroot-target/usr/include
    QMAKE_LIBDIR = /home/bruno/BSP/BSP-Phytec-phyFLEX-i.MX6-PD12.0.3/platform-mx6/sysroot-target/lib /home/bruno/BSP/BSP-Phytec-phyFLEX-i.MX6-PD12.0.3/platform-mx6/sysroot-target/usr/lib

    QMAKE_INCDIR_OPENGL_ES2 = /opt/OSELAS.Toolchain-2012.12.0/arm-cortexa9-linux-gnueabihf/gcc-4.7.3-glibc-2.16.0-binutils-2.22-kernel-3.6-sanitized/usr/include
    QMAKE_INCDIR_EGL = /opt/OSELAS.Toolchain-2012.12.0/arm-cortexa9-linux-gnueabihf/gcc-4.7.3-glibc-2.16.0-binutils-2.22-kernel-3.6-sanitized/usr/include
    QMAKE_LIBDIR_OPENGL_ES2 = /opt/OSELAS.Toolchain-2012.12.0/arm-cortexa9-linux-gnueabihf/gcc-4.7.3-glibc-2.16.0-binutils-2.22-kernel-3.6-sanitized/usr/lib
    QMAKE_LIBDIR_EGL = /opt/OSELAS.Toolchain-2012.12.0/arm-cortexa9-linux-gnueabihf/gcc-4.7.3-glibc-2.16.0-binutils-2.22-kernel-3.6-sanitized/usr/lib

    QMAKE_LIBS_EGL += -lEGL -lGAL
    QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL -lGAL
    QMAKE_LIBS_OPENVG += -lOpenVG -lEGL -lGAL

    QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/usr/lib

    IMX6_CFLAGS = -O2 -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1
    QMAKE_CFLAGS_RELEASE += $$IMX6_CFLAGS
    QMAKE_CXXFLAGS_RELEASE += $$IMX6_CFLAGS

    include(../common/linux_device_post.conf)

    load(qt_config)@

    And to set independently the paths to OpenGL libraries, as the headers and libraries are not into the same locations, due to the incomplete OSELAS toolchain (I had to copy the OpenGL libs and headers from the LTIB Linaro toolchain provided by Freescale).

    Now I have to figure out how to build other modules, as the documentation only says that it's possible to do so, not how !

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bceldran
      wrote on last edited by
      #3

      I found the solution here : http://gpupowered.org/node/8

      bq.
      After configure, make && make install are to be done. This is important, as qmake needs to be in the install path.

      Steps to build Qt3D :

      To build Qt3D, in addition to qtbase also need to build the below:

      qtjsbackend (has v8)
      qtdeclarative
      qt3d

      To build the above, enter the directory, then perform (assuming qmake is in the path as specified earlier)
      $ qmake && make && make install
      bq.

      It seems to work.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bceldran
        wrote on last edited by
        #4

        And it works better that way : http://www.mail-archive.com/interest@qt-project.org/msg04497.html

        bq. Although I didn't find out why it compiled just once (and for sure I
        didn't change some qt.conf for it :-) ), I even better understood qmake
        and found out that paths configured in qt/qtbase/bin/qt.conf were
        responsible for qmake to read the wrong module mkspecs. I've no idea how
        Prabindh from TI managed to compiled it this way as I don't see how qt5
        can be configured correctly via --prefix, but without changing this qt.conf.

        Some more details for those who bump into the same problem... In case
        you want to install qt5 to /foo/usr simply set qt/qtbase/bin/qt.conf
        also to it:

        [EffectivePaths]
        Prefix=/foo/usr

        1 Reply Last reply
        0
        • B Offline
          B Offline
          bceldran
          wrote on last edited by
          #5

          In order to test QML and OpenGL, I built the example "Samegame". I had some issue with the Makefile but I deleted the references to /usr/lib (on the host).

          I copied the Qt5 libraries (don't modify the path and directories) on my dev board root filesystem and tried to execute the program. I got these error messages, but I think they concern the GPU binaries.

          @root@phyFLEX-i:/root/samegame-build-IMX6_Qt5-Default_build_Release ./samegame
          QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed
          Qml debugging is enabled. Only use this in a safe environment!
          QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed
          evdevtouch: Using device /dev/input/event0
          min X: 0 max X: 0
          min Y: 0 max Y: 0
          min pressure: 0 max pressure: 255
          device name: stmpe-ts
          Protocol type A
          QOpenGLShader::compile(Fragment): (5:0) : error : syntax error

          *** Problematic Fragment shader source code ***
          #ifndef GL_FRAGMENT_PRECISION_HIGH
          #define highp mediump
          #endif
          uniform sampler2D texture;
          varying highp vec2 textureCoord;
          void main() {
          gl_FragColor = texture2D(texture, textureCoord).bgra;
          }


          QOpenGLShader::link: "No fragment shader attached."
          QOpenGLShaderProgram::attributeLocation( vertexCoordEntry ): shader program is not linked
          QOpenGLShaderProgram::attributeLocation( textureCoordEntry ): shader program is not linked
          QOpenGLShader::link: "No fragment shader attached."
          QOpenGLShader::link: "No fragment shader attached."
          @

          1 Reply Last reply
          0
          • M Offline
            M Offline
            msahlen
            wrote on last edited by
            #6

            HI,
            This is fixed in the latest BSP release, see this thread:
            https://lists.yoctoproject.org/pipermail/meta-freescale/2013-January/000925.html

            1 Reply Last reply
            0
            • B Offline
              B Offline
              bceldran
              wrote on last edited by
              #7

              Hi,

              I rechecked the libraries I was using and I found the bug : they were not copied into the right filesystem. Now I'm facing an other problem, while trying to execute hellogl :

              @root@xap:/root/hellogl_es2-build-IMX6_Qt5-Debug ./hellogl_es2
              QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed
              QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed
              evdevtouch: Using device /dev/input/event0
              min X: 0 max X: 0
              min Y: 0 max Y: 0
              min pressure: 0 max pressure: 255
              device name: stmpe-ts
              Protocol type A
              This plugin does not support propagateSizeHints()
              This plugin does not support setParent!
              This plugin does not support setParent!
              This plugin does not support setParent!
              This plugin does not support setParent!
              This plugin does not support setParent!
              This plugin does not support setParent!
              This plugin does not support setParent!
              This plugin does not support propagateSizeHints()
              QOpenGLContext::swapBuffers() called with non-opengl surface
              QOpenGLContext::swapBuffers() called with non-opengl surface
              QOpenGLContext::swapBuffers() called with non-opengl surface
              QOpenGLContext::swapBuffers() called with non-opengl surface
              QOpenGLContext::swapBuffers() called with non-opengl surface
              QOpenGLContext::swapBuffers() called with non-opengl surface
              QOpenGLContext::swapBuffers() called with non-opengl surface
              QOpenGLContext::swapBuffers() called with non-opengl surface @

              All I see on the screen is the frame rate, about 100 fps, white on black.

              1 Reply Last reply
              0
              • B Offline
                B Offline
                bceldran
                wrote on last edited by
                #8

                I tried to get Qt DirectFB support but there is no way to get it supported.

                I don't understand because the configure program doesn't seem to try to compile it but always return
                @DirectFB support ....... no@

                Here is my new configure options :
                @./configure -opensource -confirm-license -opengl es2 -device linux-imx6-g++ -directfb -v -device-option CROSS_COMPILE=/opt/OSELAS.Toolchain-2012.12.0/arm-cortexa9-linux-gnueabihf/gcc-4.7.3-glibc-2.16.0-binutils-2.22-kernel-3.6-sanitized/bin/arm-cortexa9-linux-gnueabihf- -no-gcc-sysroot -prefix /usr/local/Qt-5.0.1/Qt-imx6-1 -optimized-qmake -reduce-relocations -reduce-exports -make libs -no-pch -lz -lglib-2.0 -ldirect -ldirectfb -lfusion@

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  speedyxvn
                  wrote on last edited by
                  #9

                  Hey bceldran, did you manage to build with DirecFB support?
                  Also, this also compiles openCV, right? does it work? Is OpenCV using the new qt version 5.0?

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    speedyxvn
                    wrote on last edited by
                    #10

                    Hey bceldran, did you manage to build with DirecFB support?
                    Also, this also compiles openCV, right? does it work? Is OpenCV using the new qt version 5.0?

                    1 Reply Last reply
                    0
                    • B Offline
                      B Offline
                      bceldran
                      wrote on last edited by
                      #11

                      Sorry, but we let down this project two years ago. We had no time to debug these problems, QT 5 and our platform were too young. Good luck for the following !

                      1 Reply Last reply
                      0
                      • B Offline
                        B Offline
                        bceldran
                        wrote on last edited by
                        #12

                        Sorry, but we let down this project two years ago. We had no time to debug these problems, QT 5 and our platform were too young. Good luck for the following !

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved