Qt 5.11 source build instructions for i.MX8 early access

Qt version in Morty is pretty old. I rebuilt Qt for the i.MX8 from most recent sources pretty easily. I thought I’d post a successful command line. You have to first build the SDK from source using the usual instructions for Yocto/OE and then install. The resulting examples all run on the i.MX8 Apalis eval card. Please note some of them provoke the power starvation erratum in the Apalis carrier board datasheet.

These instructions will be superseded later by some official build sequence from Qt, but for early eval this can help get started for a few weeks or so.

I assume below some familiarity with building Qt from source. I can’t guarantee this is the optimum setup but it does create programs that run on the target so it’s close. Others may have improvements.

First, you have to make a device for the i.MX8. I made a directory in qtbase/devices called linux-imx8-g++. It has to have the two usual files. The qplatform defs file is the same as the imx6.



QMAKE_LIBS_EGL         += -lEGL

#IMX8_CFLAGS             = -march=armv7-a -mfpu=neon -DLINUX=1 -DEGL_API_FB=1
IMX8_CFLAGS            = -DLINUX=1

DISTRO_OPTS += aarch64

# Preferred eglfs backend



Then, in a shadow build directory parallel to qt-everywhere-src-5.11.1, the commands were:

export QT5PREFIX=/opt/qt5
../qt-everywhere-src-5.11.1/configure  \
    -v \
-opensource -confirm-license \
-prefix $QT5PREFIX \
-device linux-imx8-g++ \
-sysroot /opt/fsl-imx-x11/4.9.51-mx8-beta/sysroots/aarch64-poky-linux \
-device-option CROSS_COMPILE=/opt/fsl-imx-x11/4.9.51-mx8-beta/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux- \
-sql-mysql \

To install I made a USB jump drive and a link -s for /opt/qt5. Other than needing to export LD_LIBRARY_PATH as /opt/qt5/lib, nothing else was needed to run the examples.

hi @dgribben

Thanks for these instructions. We will evaluate this content for updating our Qt Setup article.

Best regards, Jaski

Thanks for reformatting the page correctly… I’m still learning this tool, I’m used to Mediawiki. Cheers.

You are welcome.