Skip to content

Latest commit

 

History

History
106 lines (73 loc) · 5.9 KB

Build-Ubuntu-ARM64-Qt6.8.3.md

File metadata and controls

106 lines (73 loc) · 5.9 KB

How to Build (Qt 6.8.3) - Ubuntu 24.04 aarch64 (ARM64)

This covers building on Linux ARM64/aarch64, as opposed to x86_64 Ubuntu (see Build-Ubuntu-Qt6.8.2.md for limited x86_64 guidance) or macOS (see CompilingForMac.md).

NOTE: This is only for ARM Linux server build testing. There is no GUI testing to guarantee the GUI of the built application works.

NOTE: The content below in this document is generated by a local AI agent and Claude on Sep 5, 2026 as a build reference. No humans have followed through the guide to ensure its correctness yet.

Ubuntu's own Qt6 packages are far too old (Qt 6.4 on 24.04), and Qt does not publish prebuilt Linux ARM64 packages through its online installer, so Qt has to be built from source. Everything else (OpenCV, Tesseract, D-Bus) is available through apt on Ubuntu 24.04.

This was verified with:

  • Ubuntu 24.04.4 LTS, kernel 6.17, aarch64
  • Qt 6.8.3 (built from source)
  • CMake 3.28, Ninja, GCC (system default)

1. Install build tools and dependencies

sudo apt update
sudo apt install build-essential cmake ninja-build git pkg-config

# Libraries this project links against directly
sudo apt install libopencv-dev libtesseract-dev libleptonica-dev \
    libsystemd-dev libopenexr-dev libgl1-mesa-dev libglx-dev \
    libglu1-mesa-dev

# Dependencies needed to build Qt itself (xcb platform plugin, fonts, etc.)
sudo apt install libxkbcommon-dev libxkbcommon-x11-dev libxcb-cursor-dev \
    libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev \
    libxcb-render-util0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev \
    libxcb-xinerama0-dev libxcb-xkb-dev libxcb1-dev libx11-dev libx11-xcb-dev \
    libxext-dev libxfixes-dev libxi-dev libxrender-dev libfontconfig1-dev \
    libfreetype-dev libssl-dev

# FFmpeg dev libs so Qt Multimedia gets a working webcam/video backend
sudo apt install libavcodec-dev libavformat-dev libavutil-dev libswscale-dev \
    libswresample-dev

Note: libopencv-dev on 24.04 provides OpenCV 4.6, and libtesseract-dev provides Tesseract 5.3.4. Both are picked up via pkg-config (opencv4, tesseract) by SerialPrograms/CMakeLists.txt — no manual OpenCV build is required on Linux (unlike Windows/Mac, which use prebuilt binaries from the Packages repo).

2. Build Qt 6.8.3 from source

mkdir -p ~/src && cd ~/src
wget https://download.qt.io/official_releases/qt/6.8/6.8.3/single/qt-everywhere-src-6.8.3.tar.xz
tar xf qt-everywhere-src-6.8.3.tar.xz
cd qt-everywhere-src-6.8.3

mkdir build && cd build
../configure -prefix "$HOME/qt/6.8.3" -release -opensource -confirm-license \
    -nomake examples -nomake tests \
    -skip qtwebengine -skip qt3d -skip qtwayland

cmake --build . --parallel "$(nproc)"
cmake --install .

This builds the full "everywhere" module set (qtbase, qtdeclarative, qtmultimedia, qtserialport, qtsvg, qttools, qtwebsockets, etc.), which is what this project needs (Widgets, SerialPort, Multimedia, MultimediaWidgets, OpenGLWidgets, Qml, Quick, QuickWidgets). Expect this step to take a long time (well over an hour on most ARM64 boards) and to need ~20-30 GB of free disk space during the build.

If you already have a Qt 6.8.x install (e.g. built previously, or via aqtinstall/a distro package new enough to include the above modules), you can skip this step — you just need its install prefix for step 4.

3. Get the Resources folder (Packages repo)

SerialPrograms/CMakeLists.txt expects a sibling Packages checkout next to this repo (i.e. Arduino-Source/Packages, not a Resources folder copied inside SerialPrograms/):

cd /path/to/Arduino-Source   # the repo root, containing SerialPrograms/, Common/, etc.
git clone https://github.com/PokemonAutomation/Packages

CMake copies Packages/Resources into the build output automatically on first configure/build.

4. Configure and build

From the repo root:

cmake -S SerialPrograms -B build/RelWithDebInfo -G Ninja \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DCMAKE_PREFIX_PATH="$HOME/qt/6.8.3"

cmake --build build/RelWithDebInfo --parallel "$(nproc)"

Notes:

  • Discord Social SDK is auto-disabled on Linux ARM64. Discord doesn't offer a Linux ARM64 build of the Social SDK (per their platform-compatibility docs, Linux support is x86_64-only; Windows ARM64 and macOS ARM64 are both fully supported). CMakeLists.txt defaults the PA_SOCIAL_SDK option to OFF automatically when it detects a non-Apple ARM/aarch64 target, so you don't need to pass anything for this — it's mentioned here only so you know why Compiling with Discord social SDK integration disabled shows up during configure. You can still force it on/off explicitly with -DPA_SOCIAL_SDK=ON or =OFF on any platform.
  • ONNX Runtime is downloaded automatically for you (aarch64 build, from the official microsoft/onnxruntime GitHub releases) if you don't already have one. If you want to point at a pre-downloaded copy instead, pass -DONNX_ROOT_PATH=/path/to/onnxruntime-linux-aarch64-1.23.0.
  • DPP (D++ / Discord bot library) is optional and auto-detected via pkg-config; it isn't installed by the apt commands above, so you'll see Compiling with DPP integration disabled, which is expected and fine.

The two binaries are produced at build/RelWithDebInfo/SerialPrograms (GUI) and build/RelWithDebInfo/SerialProgramsCommandLine.

5. Run

./build/RelWithDebInfo/SerialPrograms

Only the command-line tool and a headless (QT_QPA_PLATFORM=offscreen) launch of the GUI binary were exercised while verifying this build — both start up and resolve all shared libraries correctly (checked with ldd). Actual on-screen GUI behavior (e.g. the video-preview flicker noted for x86_64 Ubuntu in Build-Ubuntu-Qt6.8.2.md) has not been separately verified on ARM64.


Discord Server: