swampdog
Posts: 295
Joined: Fri Dec 04, 2015 11:22 am

Qt Creator 4.10.0

Fri Nov 29, 2019 11:40 pm

I'm away until early/mid next week and am about to set off what should be an error free build of QT 5.12.5 on rpi4. Just wanted to see if there's any interest. It'll be a big tarball (approx 3Gb). It will contain this..

gcc 9.2.0
cmake 3.15.4
mariadb 10.4.8
z3 4.8.6
llvm 8.0.1
cfe 8.0.1
lld 8.0.1
qt 5.12.5
qtc 4.10.0

..all sat in /usr/local/QT/5.12.5/ so it's not "installed" and won't conflict with existing QT. There's an 'sd-qt' (much like you prefix 'distcc') with the expectation the user knows about PATH/LD_LIBRARY_PATH and can sort out their own mess. Sure 'sd-qt qtcreator' will launch fine but you'll have to go in and configure it not to use the system stuff and so forth.

I've always regretted not learning QT so figured I ought to make it new enough so that if/when I get the time next year I'm not out of date before I start! The idea is, by the time I've learnt anything useful the system stuff will have advanced enough to build a project normally.

QT has all the docs/examples and is configured thus..

Code: Select all

Configure summary:

Build type: distcc-native (arm, CPU features: <none>)
Compiler: gcc 9.2.0
Configuration: use_gold_linker compile_examples enable_new_dtags largefile preco
mpile_header shared rpath release c++11 c++14 c++1z concurrent dbus reduce_expor
ts stl
Build options:
  Mode ................................... release
  Optimize release build for size ........ no
  Building shared libraries .............. yes
  Using C standard ....................... C11
  Using C++ standard ..................... C++1z
  Using ccache ........................... no
  Using gold linker ...................... yes
  Using new DTAGS ........................ yes
  Using precompiled headers .............. yes
  Using LTCG ............................. no
  Target compiler supports:
    NEON ................................. no
  Build parts ............................ libs examples tools
Qt modules and options:
  Qt Concurrent .......................... yes
  Qt D-Bus ............................... yes
  Qt D-Bus directly linked to libdbus .... yes
  Qt Gui ................................. yes
  Qt Network ............................. yes
  Qt Sql ................................. yes
  Qt Testlib ............................. yes
  Qt Widgets ............................. yes
  Qt Xml ................................. yes
Support enabled for:
  Using pkg-config ....................... yes
  udev ................................... yes
  Using system zlib ...................... yes
Qt Core:
  DoubleConversion ....................... yes
    Using system DoubleConversion ........ no
  GLib ................................... yes
  iconv .................................. no
  ICU .................................... yes
  Tracing backend ........................ <none>
  Logging backends:
    journald ............................. no
    syslog ............................... no
    slog2 ................................ no
  Using system PCRE2 ..................... no
Qt Network:
  getifaddrs() ........................... yes
  IPv6 ifname ............................ yes
  libproxy ............................... no
  Linux AF_NETLINK ....................... yes
  OpenSSL ................................ yes
    Qt directly linked to OpenSSL ........ no
  OpenSSL 1.1 ............................ yes
  DTLS ................................... yes
  SCTP ................................... no
  Use system proxies ..................... yes
Qt Gui:
  Accessibility .......................... yes
  FreeType ............................... yes
    Using system FreeType ................ yes
  HarfBuzz ............................... yes
    Using system HarfBuzz ................ no
  Fontconfig ............................. yes
  Image formats:
    GIF .................................. yes
    ICO .................................. yes
    JPEG ................................. yes
      Using system libjpeg ............... yes
    PNG .................................. yes
      Using system libpng ................ yes
  EGL .................................... yes
  OpenVG ................................. no
  OpenGL:
    Desktop OpenGL ....................... yes
    OpenGL ES 2.0 ........................ no
    OpenGL ES 3.0 ........................ no
    OpenGL ES 3.1 ........................ no
    OpenGL ES 3.2 ........................ no
  Vulkan ................................. no
  Session Management ..................... yes
Features used by QPA backends:
  evdev .................................. yes
  libinput ............................... no
  INTEGRITY HID .......................... no
  mtdev .................................. no
  tslib .................................. no
  xkbcommon .............................. yes
  X11 specific:
    XLib ................................. yes
    XCB Xlib ............................. yes
    EGL on X11 ........................... yes
QPA backends:
  DirectFB ............................... no
  EGLFS .................................. yes
  EGLFS details:
    EGLFS OpenWFD ........................ no
    EGLFS i.Mx6 .......................... no
    EGLFS i.Mx6 Wayland .................. no
    EGLFS RCAR ........................... no
    EGLFS EGLDevice ...................... yes
    EGLFS GBM ............................ no
    EGLFS VSP2 ........................... no
    EGLFS Mali ........................... no
    EGLFS Raspberry Pi ................... no
    EGLFS X11 ............................ yes
  LinuxFB ................................ yes
  VNC .................................... yes
  Mir client ............................. no
  XCB:
    Using system-provided XCB libraries .. no
    XCB XKB .............................. yes
    XCB XInput ........................... yes
    Native painting (experimental) ....... yes
    GL integrations:
      GLX Plugin ......................... yes
        XCB GLX .......................... yes
      EGL-X11 Plugin ..................... yes
Qt Sql:
  SQL item models ........................ yes
Qt Widgets:
  GTK+ ................................... no
  Styles ................................. Fusion Windows
Qt PrintSupport:
  CUPS ................................... yes
Qt Sql Drivers:
  DB2 (IBM) .............................. no
  InterBase .............................. no
  MySql .................................. yes
  OCI (Oracle) ........................... no
  ODBC ................................... no
  PostgreSQL ............................. no
  SQLite2 ................................ no
  SQLite ................................. yes
    Using system provided SQLite ......... no
  TDS (Sybase) ........................... no
Qt Testlib:
  Tester for item models ................. yes
Qt SerialBus:
  Socket CAN ............................. yes
  Socket CAN FD .......................... yes
Further Image Formats:
  JasPer ................................. no
  MNG .................................... no
  TIFF ................................... yes
    Using system libtiff ................. yes
  WEBP ................................... yes
    Using system libwebp ................. no
Qt QML:
  QML network support .................... yes
  QML debugging and profiling support .... yes
  QML sequence object .................... yes
  QML list model ......................... yes
  QML XML http request ................... yes
  QML Locale ............................. yes
  QML delegate model ..................... yes
Qt Quick:
  Direct3D 12 ............................ no
  AnimatedImage item ..................... yes
  Canvas item ............................ yes
  Support for Qt Quick Designer .......... yes
  Flipable item .......................... yes
  GridView item .......................... yes
  ListView item .......................... yes
  TableView item ......................... yes
  Path support ........................... yes
  PathView item .......................... yes
  Positioner items ....................... yes
  Repeater item .......................... yes
  ShaderEffect item ...................... yes
  Sprite item ............................ yes
Qt Scxml:
  ECMAScript data model for QtScxml ...... yes
Qt Gamepad:
  SDL2 ................................... yes
Qt 3D:
  Assimp ................................. yes
  System Assimp .......................... no
  Output Qt3D Job traces ................. no
  Output Qt3D GL traces .................. no
  Use SSE2 instructions .................. no
  Use AVX2 instructions .................. no
  Aspects:
    Render aspect ........................ yes
    Input aspect ......................... yes
    Logic aspect ......................... yes
    Animation aspect ..................... yes
    Extras aspect ........................ yes
Qt 3D Renderers:
  OpenGL Renderer ........................ yes
Qt 3D GeometryLoaders:
  Autodesk FBX ........................... no
Qt Wayland Drivers:
  EGL .................................... yes
  Raspberry Pi ........................... no
  XComposite EGL ......................... yes
  XComposite GLX ......................... yes
  DRM EGL ................................ yes
  libhybris EGL .......................... no
  Linux dma-buf server buffer integration . yes
  Vulkan-based server buffer integration . no
  Shm emulation server buffer integration . yes
Qt Wayland Client ........................ yes
Qt Wayland Compositor .................... yes
Qt Wayland Compositor Layer Plugins:
  VSP2 hardware layer integration ........ no
Qt Bluetooth:
  BlueZ .................................. no
  BlueZ Low Energy ....................... no
  Linux Crypto API ....................... no
  WinRT Bluetooth API (desktop & UWP) .... no
Qt Sensors:
  sensorfw ............................... no
Qt Quick Controls 2:
  Styles ................................. Default Fusion Imagine Material Universal
Qt Quick Templates 2:
  Hover support .......................... yes
  Multi-touch support .................... yes
Qt Positioning:
  Gypsy GPS Daemon ....................... no
  WinRT Geolocation API .................. no
Qt Location:
  Qt.labs.location experimental QML plugin . yes
  Geoservice plugins:
    OpenStreetMap ........................ yes
    HERE ................................. yes
    Esri ................................. yes
    Mapbox ............................... yes
    MapboxGL ............................. yes
    Itemsoverlay ......................... yes
QtXmlPatterns:
  XML schema support ..................... yes
Qt Multimedia:
  ALSA ................................... yes
  GStreamer 1.0 .......................... no
  GStreamer 0.10 ......................... no
  Video for Linux ........................ yes
  OpenAL ................................. no
  PulseAudio ............................. yes
  Resource Policy (libresourceqt5) ....... no
  Windows Audio Services ................. no
  DirectShow ............................. no
  Windows Media Foundation ............... no
Qt Tools:
  QDoc ................................... yes
Qt WebEngine:
  Embedded build ......................... no
  Full debug information ................. no
  Pepper Plugins ......................... yes
  Printing and PDF ....................... yes
  Proprietary Codecs ..................... no
  Spellchecker ........................... yes
  Native Spellchecker .................... no
  WebRTC ................................. yes
  Use System Ninja ....................... no
  Geolocation ............................ yes
  WebChannel support ..................... yes
  Use v8 snapshot ........................ yes
  Kerberos Authentication ................ no
  Support qpa-xcb ........................ yes
  Use ALSA ............................... yes
  Use PulseAudio ......................... yes
  Optional system libraries used:
    re2 .................................. no
    icu .................................. no
    libwebp, libwebpmux and libwebpdemux . no
    opus ................................. yes
    ffmpeg ............................... no
    libvpx ............................... no
    snappy ............................... no
    glib ................................. yes
    zlib ................................. yes
    minizip .............................. no
    libevent ............................. yes
    jsoncpp .............................. no
    protobuf ............................. no
    libxml2 and libxslt .................. no
    lcms2 ................................ no
    png .................................. yes
    JPEG ................................. yes
    harfbuzz ............................. no
    freetype ............................. yes
  Required system libraries:
    fontconfig ........................... yes
    dbus ................................. yes
    nss .................................. yes
    khr .................................. yes
    glibc ................................ yes
  Required system libraries for qpa-xcb:
    x11 .................................. yes
    libdrm ............................... yes
    xcomposite ........................... yes
    xcursor .............................. yes
    xi ................................... yes
    xtst ................................. yes
If there is interest then there two problems. First is, I have nowhere to host it. Second is, as a tarball, it isn't for most users. The only thing you'll have to go on for installing system dependencies is a "dpkg -l" of the build box (I'm not inclined to produce a proper package).

Alternatively, it could just wait until I get around to putting all the build infrastructure onto github. That may be never though - reasons. :-(

Anyway. Enough waffle. I'll just let this dangle for a few days and see what happens. :-)

K9spud
Posts: 14
Joined: Fri Nov 22, 2019 5:38 am

Re: Qt Creator 4.10.0

Sat Nov 30, 2019 2:15 am

Wow, good job! I've managed to compile gcc 9.2.0 and Qt 5.13.2 with the Qt 5.14.0beta3 qtwebengine on Raspberry Pi 4 (with 4GB RAM), but I have so far been unable to compile Qt Creator 4.9.2 or 4.10.2. Mine always seems to konk out with some errors relating to Qbs project file add/remove files internal methods not being defined.

I don't suppose you had to do anything special to get your Qt Creator to compile, did you? I have read online someone claiming you have to uninstall all the system provided Qt installation to get Qt Creator to successfully compile due to some kind of interaction from those old libraries interferring with the Qt Creator build. I haven't gotten myself to the point of actually trying that though, since my system is mostly fine as it is, using the Raspbian default Qt Creator 4.8.2 and telling it to go use my specially built Qt 5.13.2 installation for building all my apps.

Edit: I made a backup of my root filesystem and proceeded to remove all the Qt5 distro provided packages/libraries. After that, Qt Creator 4.10.2 compiled without a hitch on the first try! Copied the resultant install files to my original system and now I'm good to go on the very latest of Qt and Qt Creator!

The next big challenge in my mind is trying to get Qt on Raspberry Pi to let me build Android apps. If I could get RPi to do that, it would be one step closer for me to fully dustbin my x86 laptop.

swampdog
Posts: 295
Joined: Fri Dec 04, 2015 11:22 am

Re: Qt Creator 4.10.0

Sat Dec 07, 2019 6:14 pm

I was away for longer than I thought!

It may be you have to uninstall some stuff though I suspect not. I started with a standard raspbian desktop image (not lite, not full) so whilst there's a handful of qt5 system libs there are not too many. I had already built it under linux mint 18 so had an idea which dev packages were required. Over time I added more so that further features became enabled. A point to note though is that my linux box does have a ton of qt stuff installed (including qtcreator) so I'll talk about the linux box (sdu) because that's where I saw my conflicts.

I have qbs disabled. It's depreciated in 5.12.5 so was never picked up by the qtcreator 4.10.0 configure.

Taking both the above into account I'd suspect you don't have an environmental variable set correctly. You are supposed to be able to build/install/run multiple QT's together. It is very easy to miss something.

Typically when I build something new I install it to /usr/local/PACKAGE/VERSION/
eg:

Code: Select all

foo@sdu ~/usr/src/QT/qtc $ lc /usr/local/GCC
total 32
drwxr-xr-x 9 foo foo 4096 Jul 16 14:38 4.9.4
drwxr-xr-x 9 foo foo 4096 Jul 17 02:22 5.5.0
drwxr-xr-x 9 foo foo 4096 Jul 17 09:51 6.5.0
drwxr-xr-x 8 foo foo 4096 Aug  7 20:18 7.4.0
drwxr-xr-x 9 foo foo 4096 Jul 18 07:29 8.2.0
drwxr-xr-x 8 foo foo 4096 Aug  7 20:04 8.3.0
drwxr-xr-x 8 foo foo 4096 Aug  7 20:39 9.1.0
drwxr-xr-x 8 foo foo 4096 Sep 23 08:34 9.2.0
I pick which one is to be my "goto version" and symlink to it..

Code: Select all

foo@sdu ~/usr/src/QT/qtc $ lc -d /usr/local/g*
drwxr-xr-x. 2 root root 4096 Dec 13  2016 /usr/local/games
lrwxrwxrwx  1 root root   10 Jul 18 22:13 /usr/local/gcc -> GCC/8.3.0/
lrwxrwxrwx. 1 root root    9 Dec 24  2015 /usr/local/gdb -> GDB/7101/
This way build scripts can just prefix "/usr/local/gcc" to their PATH/LD_LIBRARY_PATH. Very occasionally I jump to a new one. All that's required is I change the symlink and rebuild everything, fingers crossed everything still builds. I've only done this twice in over a decade. First time because I was forced to (was still using gcc 4.0.2 and had to go to 4.9.4) then as you can see to 8.3.0 and plan on 9.2.0 (or greater) next year. Then I'll likely stop on it for ages.

The reason I mention the above, is the workflow doesn't fit QT "end user" at all well. You'd have to prefix PATH/LD_LIBRARY_PATH (and other stuff) for each and every package (cmake,sql,clang) and is is going to be oh so easy to break. Much saner to build everything again and stuff it into the QT installation folder. I don't use the 'sd-qt' command during the build to ensure I don't get lazy. It gets generated right near the end. It's generated contents are..

Code: Select all

foo@pi19:~/usr/src/QT $ cat /usr/local/QT/5.12.5/bin/sd-qt
#!/bin/bash
PATH=/usr/local/QT/5.12.5/bin:$PATH \
LD_LIBRARY_PATH=/usr/local/QT/5.12.5/lib64:/usr/local/QT/5.12.5/lib \
LLVM_INSTALL_DIR=/usr/local/QT/5.12.5 \
QTC_ENABLE_LIBTOOLING=1 \
QTDIR=/usr/local/QT/5.12.5 \
MANPATH=/usr/local/QT/5.12.5/share/man \
INFOPATH=/usr/local/QT/5.12.5/share/info \
"$@"
..and I just have a symlink to 'sd-qt' in my default PATH.

QtCreator 4.10.0 settings..

Code: Select all

foo@sdu ~/usr/src/QT/qtc $ cat go.cfg
CFG="
CONFIG+=release
-DCMAKE_INSTALL_PREFIX="$QT_DIR"
-DWITH_DOCS=1
-DWITH_ONLINE_DOCS=1
-DBUILD_DEVELOPER_DOCS=1
"
foo@sdu ~/usr/src/QT/qtc $ cat go.env
. "../5.12.5/go.env"
export PATH="$QT_DIR""/bin":"$PATH"
export PYTHON_INSTALL_DIR=/usr/lib/python3
export QTC_ENABLE_CLANG_LIBTOOLING=1
export Qt5_DIR="$QT_DIR"

foo@sdu ~/usr/src/QT/5.12.5 $ cat go.env
. "../clang/go.env"
LLVM_INSTALL_DIR="$QT_DIR"
export LLVM_INSTALL_DIR
#PATH="/usr/local/MYSQL/5144/bin:$PATH"
PATH="$OBJ/qtbase/bin:$PATH"
export PATH
export NINJAFLAGS="-v -j4"

foo@sdu ~/usr/src/QT/clang $ cat go.env 
PATH="$QT_DIR/bin":"$PATH"
LD_LIBRARY_PATH="$QT_DIR/lib":"$QT_DIR/lib64":"$QT_DIR/lib32"
LLVM_INSTALL_DIR="$QT_DIR"
export PATH LD_LIBRARY_PATH LLVM_INSTALL_DIR
#: ${CC:="$QT_DIR/bin/gcc"}
#: ${CXX:="$QT_DIR/bin/g++"}
: ${CC:="$QT_DIR/bin/gcc920"}
: ${CXX:="$QT_DIR/bin/g++920"}
export CC CXX
The whole lot is driven by..

Code: Select all

foo@sdu ~/usr/src/QT $ cat fudge 
#!/bin/bash

NAM=`basename "$0"`
SUB="/usr/local/sd/syschk/lib"

. "$SUB/f_go"

export QT_DIR=/usr/local/QT/5.12.5
#export JPROC="-j12"
#export F_GO_DEL=all

: ${C:="all"}

date "+%s" > .ts

(
 cd gcc;
 export PKG=gcc
 export VER=9.2.0
 f_go_init
 [ -f "$QT_DIR""/bin/gcc920" ] || {
	sudo tar -C / -xvjf `f_go_tar_tarname` || exit 1
 }
 ./go $C
) || exit 1
(cd cmake;	PKG=cmake VER=3.15.4	./go $C) || exit 1
(cd mysql;	PKG=mariadb VER=10.4.8	./go $C) || exit 1
(cd clang/z3;	PKG=z3 VER=4.8.6	./go $C) || exit 1
(cd clang/llvm;	PKG=llvm VER=8.0.1	./go $C) || exit 1
(cd clang/cfe;	PKG=cfe VER=8.0.1	./go $C) || exit 1
(cd clang/lld;	PKG=lld VER=8.0.1	./go $C) || exit 1
(cd 5.12.5;	PKG=qt VER=5.12.5	./go $C) || exit 1
(
 PKG=n/a VER=n/a ./go sdqt
 sudo install -m 755 "./sd-qt" "$QT_DIR""/bin/"
 rm -f "./sd-qt"
) || exit 1
(
 cd qtc;
 export PKG=qtc
 export VER=4.10.0
 ./go $C || return 1
 touch `f_go_tar_tarname`
 sudo ./go tar || return 1
) || exit 1

date "+%s" >> .ts
echo "SECS="$(echo $(head -2 .ts | tail -1)"-"$(head -1 .ts) | bc)
It's not useful to post more detail as there's a whole /usr/local/sd/* hierarchy to support that 'go' command. Suffice it to say, it's identical on the rpi4 - just rsync'd across.

Return to “C/C++”