Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Cross Compiler for Google Coral Dev Board Problem



  • I attempt to make cross compile from my PC(Ubuntu 20.04) to my embedded device, but I face some problem.

    My Qt version: 5.9.9

    My cross compiler tool:

    gcc-linaro-6.3.1-2017.02-x86_64_aarch64-linux-gnu
    

    (I put the cross compiler tool to /usr/local/)

    My embedded device information:

    $uname -a
    Linux vexing-dog 4.14.98-imx #1SMP PREEMPT Fri Jul 17 01:15:45 UTC 2020 aarch64 GUN/Linux
    $lsb_release -a
    NO LSB modules are available.
    Distributor ID:Mendel
    Description:Mendel Gun/Linux 5 (Eagle)
    Release:10.0
    Codename:eagle
    
    CPU info:
    Architecture:aarch64
    Model:Cortex-A53
    

    I refer the cross compiler for Jetson Nano video. The link is below.
    cross compiler for Jetson Nano video

    Since there is no qmake.conf file for Google Coral dev board, I try to adjust the qmake.conf file from "linux-jetson-tk1-g++" folder.

    $cp linux-jetson-tk1-g++ linux-imx8-g++
    $nano linux-imx8-g++/qmake.conf
    

    Here is my qmake.conf

    include(../common/linux_device_pre.conf)
    
    QMAKE_INCDIR_POST += \
        $$[QT_SYSROOT]/usr/include \
        $$[QT_SYSROOT]/usr/include/aarch64-linux-gun
    
    QMAKE_LIBDIR_POST += \
        $$[QT_SYSROOT]/usr/lib \
        $$[QT_SYSROOT]/lib/aarch64-linux-gun \
        $$[QT_SYSROOT]/usr/lib/aarch64-linux-gun
    
    QMAKE_RPATHLINKDIR_POST += \
        $$[QT_SYSROOT]/usr/lib \
        $$[QT_SYSROOT]/usr/lib/aarch64-linux-gun \
        $$[QT_SYSROOT]/lib/aarch64-linux-gun
    
    
    #QMAKE_INCDIR_EGL        = $$[QT_SYSROOT]/usr/lib/aarch64-linux-gun
    QMAKE_LIBS_EGL         += -lEGL
    QMAKE_LIBS_OPENGL_ES2  += -lGLESv2 -lEGL 
    
    DISTRO_OPTS                  += aarch64
    COMPILER_FLAGS               += -march=armv8-a+crypto+crc
    
    EGLFS_DEVICE_INTEGRATION = eglfs_viv
    #EGLFS_DEVICE_INTEGRATION = eglfs_kms
    #EGLFS_DEVICE_INTEGRATION = eglfs_kms_egldevice
    
    include(../common/linux_arm_device_post.conf)
    load(qt_config)
    

    and I mount my device rootfs to /opt/Coral/rootfs.

    $mkdir -p /opt/Coral/rootfs
    $sshfs root@192.168.100.2:/ /opt/Coral/rootfs
    

    and configure the Qt

    ./configure  -v \
    -release \
    -opensource \
    -confirm-license \
    -recheck-all \
    -device linux-imx8-g++ \
    -device-option CROSS_COMPILE=/usr/local/gcc-linaro-6.3.1-aarch64/bin/aarch64-linux-gnu- \
    -sysroot /opt/Coral/rootfs \
    -prefix /opt/Coral/qt5.9.9_SDK \
    -opengl es2 \
    -gstreamer 1.0 \
    -nomake examples -nomake tests \
    -no-use-gold-linker 
    

    and i got the error below

    ERROR: Feature 'opengles2' was enabled, but the pre-condition 'config.win32 || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)' failed.
    
    ERROR: The OpenGL functionality tests 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 the mkspec for your platform.
    
    ERROR: Feature 'gstreamer_1_0' was enabled, but the pre-condition 'libs.gstreamer_1_0' failed.
    

    I check my dev package correct install.

    $sudo apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base
    
    gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
    Reading package lists... Done
    Building dependency tree  	 
    Reading state information... Done
    gstreamer1.0-alsa is already the newest version (1.14.4+imx-6).
    gstreamer1.0-gl is already the newest version (1.14.4+imx-6).
    gstreamer1.0-gtk3 is already the newest version (1.14.4+imx-5).
    gstreamer1.0-plugins-bad is already the newest version (1.14.4+imx-7).
    gstreamer1.0-plugins-base is already the newest version (1.14.4+imx-6).
    gstreamer1.0-plugins-good is already the newest version (1.14.4+imx-5).
    gstreamer1.0-pulseaudio is already the newest version (1.14.4+imx-5).
    gstreamer1.0-tools is already the newest version (1.14.4+imx-3).
    gstreamer1.0-x is already the newest version (1.14.4+imx-6).
    libgstreamer1.0-0 is already the newest version (1.14.4+imx-3).
    gstreamer1.0-doc is already the newest version (1.14.4-1).
    gstreamer1.0-libav is already the newest version (1.15.0.1+git20180723+db823502-2).
    gstreamer1.0-plugins-ugly is already the newest version (1.14.4-1).
    gstreamer1.0-qt5 is already the newest version (1.14.4-1).
    0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
    
    $sudo apt-get install libgles2-mesa-dev libxkbcommon-dev
    
    Reading package lists... Done
    Building dependency tree  	 
    Reading state information... Done
    libgles2-mesa-dev is already the newest version (18.3.6-2+deb10u1).
    libxkbcommon-dev is already the newest version (0.8.2-1).
    

    The related files in my device
    The files, libEGL.so libEGL.so.1 libEGL.so.1.1.0 libEGL_mesa.so.0 libEGL_mesa.so.0.0.0, libGLESv2.so libGLESv2.so.2 and libGLESv2.so.2.1.0 exist in /opt/Coral/rootfs/usr/lib/aarch64-linux-gun

    Any dev package or setting I missing ?

    Thanks for any help
    Shao


  • Lifetime Qt Champion

    Hi,

    You need these packages for your target. They are usually provided through its root filesystem.

    The usual way is to install them directly on your device and then synch the root filesystem back to your desktop machine to use it for cross-compilation.



  • This is NOT an attempt to hijack this thread!
    ( I have started similar thread elsewhere )

    I am in process to build / cross-compile using Qt Creator and looking for any pointers and found this.

    I am currently in Tools-Options and have installed GCC crosscomplier.
    My next step is to "connect" to "device " - using same Tools-Options.

    My "device" is Raspberry Pi and it has "Target Commodification Framework' (TCF) installed and it was working using another IDE.
    So far I am unable to locate a decent sample / tutorial implementing TCF in QtCreator.

    The video mentioned is using Eclipse "light" and it does not look at all as the Eclipse I was using - no TCF is used.

    In short - I am not sure if I have to modify qmake - prefer NOT to - but in general - am I on right track to implement TCF in QtCreator?



  • @Shao said in Cross Compiler for Google Coral Dev Board Problem:

    ERROR: The OpenGL functionality tests failed!

    Please check the config.log in the folder where you're trying to configure the Qt build for the exact issue why it 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 the mkspec for your platform.

    Please do so, since you're using qmake.conf file from "linux-jetson-tk1-g++"



  • @AnneRanch said in Cross Compiler for Google Coral Dev Board Problem:

    This is NOT an attempt to hijack this thread!

    However, you've succeeded hijacking the post. You're issue is quite different from the original post (different devices, different goals).

    ( I have started similar thread elsewhere )

    So why double posting here? One post is enough, please wait for other users to comment on your other post.



  • @SGaist
    I think I am correct install these needed packages in my target device.
    (libgles2-mesa-dev, libxkbcommon-dev, libgstreamer1.0-0, gstreamer1.0-plugins-base)
    Is there something I still missing?



  • @Pablo-J-Rogina
    In my opinion, the reason to cause the OpenGL functionality tests failed is incorrect setting of QMAKE_INCDIR_OPENGL, QMAKE_LIBDIR_OPENGL and QMAKE_LIBS_OPENGL.
    Is that right?

    Those setting is refer to my past experience and some article(not Coral dev board), but actually I don't know the setting detail.
    Could you provide me some additional reference?

    I noticed that the rasp-pi and Jetson device will provide specific file and folder about opengl.
    In the Jetson, there is a folder locate at sysroot/usr/lib/aarch64-linux-gun/tergra-egl
    In the rasp-pi, there is a folder locate at sysroot/opt/vc.

    These specific folder is setting in the QMAKE.
    But I don't find the specific folder in the image file provide by the development company.
    Even I link to sysroot/usr/lib/aarch64-linux-gun (the path to libEGL.so libEGL.so.1.1.0 ,etc.), I got the same error.


  • Lifetime Qt Champion

    You should check the configure logs to see exactly what is failing.

    You should also do an out of source build so you can more easily nuke and restart when you change something or you have an error and need to restart.