site  contact  subhomenews

Qt5 qtbase compiled in OE

December 18, 2021 — BarryK

Yay, success! Earlier today, I posted that failed to compile qt5, but qt4 succeeded:

https://bkhome.org/news/202112/qt4-and-scribus-148-compiled.html

But, would really like to compile the latest Scribus. Also, Vym is a great mind-mapping tool that requires qt5. What else? -- krita is another qt5-base app I think.

So, I examined the error message where it failed. It is code supporting the AVX instructions. These are instructions that were added onto Intel x86 CPUs in 2011, though even now not all recent Intel CPUs support AVX.

Apparently, although qt5 will compile-in support for these instructions, it will detect support in the CPU at run-time, and fallback if AVX not supported.

Anyway, compile was failing, and I found this problem discussed by Gentoo guys here:

https://bugs.gentoo.org/672946

...in summary, the workaround is simply to tell qt5 not to compile the AVX instructions.

Qt5 support is provided by the 'meta-qt5' layer, available from here:

http://layers.openembedded.org/layerindex/branch/dunfell/layer/meta-qt5/

The qtbase package provides most, maybe all, of the libraries and plugins required for apps such as Scribus. The build recipe is meta-qt5/recipes-qt/qt5/qtbase_git.bb -- the format of the recipe file name is "name_version.bb".

If I want to modify anything in that recipe file, instead of editing it, I can create a file in my own layer. That is, I created a file meta-quirky/recipes-qt/qt5/qtbase_git.bbappend. This is the content:

# 181222 to compile qtstyleplugins with support for gtk2 theming, need accessibility...
# 20211217 added gtk glib xcb
PACKAGECONFIG_append = " sm harfbuzz gif sql-sqlite mtdev cups fontconfig \
icu kms openssl accessibility gtk glib xcb \
"

DEPENDS += " gtk+ ghostscript cups-filters librsvg"

QT_CONFIG_FLAGS += " -no-sse3 -no-ssse3 -no-sse4.1 -no-sse4.2 \
-no-avx -no-avx2 -no-avx512"

...the important part, that fixed the compile, is those "-no-avx -no-avx2 -no-avx512". The other options to disable sse3 and sse4*, I just added because why not, I am compiling for an elderly 'nocona' x86_64 CPU. Although qt is supposed to fallback, I don't trust it.

Now that qtbase has compiled, I might tackle compiling scribus in OE.   

Tags: easy