Skip to content
Development documentation for unreleased code on main. Behavior can change before a release. Latest release docs

Linux ARM64 release builddev

tools/build-arm64 cross-compiles Luxir and its test binary on a Linux x86-64 host for the generic ARMv8-A baseline (armv8-a, with NEON). The outputs are build/arm64-release/bin/luxir and build/arm64-release/bin/luxir_test.

Use the native development environment, including GCC 16, Ninja, Git, Python 3, make, curl, tar, xz, zip/unzip, pkg-config, and the autotools required by vcpkg. Initialize deps/hpp-proto with git submodule update --init. Internet access is required for pinned tools and dependency archives.

The workflow downloads Compiler Explorer’s GCC 16.1.0 AArch64 cross compiler, checks its SHA-256 digest, and uses its bundled Linux sysroot and compiler runtimes. The script uses vcpkg’s downloaded CMake 4.4.3; LUXIR_CMAKE can override its path.

Terminal window
./tools/build-arm64

The first run on a machine builds all dependencies. The compiler, vcpkg checkout, downloads, and binary packages are kept in the shared Luxir cache (LUXIR_CACHE_DIR, default ~/.cache/luxir), so later runs from any checkout or worktree install packages from that cache instead of rebuilding them. Dependency and Luxir build jobs are sized from the cores and memory; set LUXIR_BUILD_JOBS=N to fix both. Stage logs are in build/arm64-logs/, and errors include the failed log’s tail. The dependency install, host generator, and Luxir build stay under the checkout’s build/.

The native hpp-proto generator uses g++-16; CXX can override it with an equivalent C++26-capable GCC executable. vcpkg selects the host compiler for its own build tools independently of CC/CXX.

The pinned sysroot supplies glibc 2.41. Deploy on a Linux ARM64 system with compatible glibc symbol versions and time-zone data. Generic CPU support does not imply compatibility with older glibc releases or musl-based systems. Product libraries, libstdc++, libgcc, and OpenMP are linked statically; glibc and libm remain dynamic. Cross builds use the linker supplied by the toolchain. Native builds retain automatic selection of a faster host linker.

The vcpkg manifest and overlay ports are shared with native builds. The ARM64 triplet builds Release libraries only; native protobuf/gRPC tools have a separate host triplet. Like vcpkg’s own Linux toolchain, the triplet compiles dependencies with -fPIC. Luxir itself keeps the compiler’s default PIE code, as on x86-64: with GCC, -fPIC assumes symbols may be interposed and stops inlining of non-inline global functions. protoc-gen-hpp is compiled with the native compiler. OpenBLAS uses an ARMV8 baseline with runtime dispatch to supported NEON/SVE kernels. FAISS also selects its ARM NEON/SVE implementation at runtime.

If qemu-aarch64 is installed, the build script executes its toolchain and LAPACK smoke tests and luxir --version with a Cortex-A53 CPU model to check the ARMv8-A baseline. Set LUXIR_QEMU_AARCH64 to use an emulator at another path.

Run the tests on a compatible ARM64 Linux host or under QEMU:

Terminal window
arm64_sysroot="${LUXIR_CACHE_DIR:-$HOME/.cache/luxir}/arm64-toolchain/compiler/gcc-16.1.0/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot"
qemu-aarch64 -cpu cortex-a53 -L "$arm64_sysroot" \
build/arm64-release/bin/luxir --version
qemu-aarch64 -cpu cortex-a53 -L "$arm64_sysroot" \
build/arm64-release/bin/luxir_test --gtest_brief=1 --gtest_print_time=0

QEMU user-mode checks the executable against the target CPU and libraries. Kernel-specific tests still need a native ARM64 host, where the regular native workflow builds for the host CPU: for example, QEMU 8.2 ignores huge-page advice, so allocator tests that inspect /proc/self/smaps cannot validate those hints under that emulator.