Boost as infrastructure.
Boost is a first-class part of the Genyleap native stack beside the C++ standard library, CMake and Qt. Prefer the standard library when it provides the required facility cleanly; use Boost where it still provides stronger networking, containers, numerics, parsing, interoperability or portability primitives.
Use Boost deliberately.
Do not keep a Boost dependency only because older C++ standards once lacked the equivalent facility.
Link only the Boost components a target actually needs; avoid turning the whole Boost tree into an implicit global dependency.
Header-only libraries affect compile time, warnings, feature requirements and transitive dependencies even when no binary is linked.
Keep separate install prefixes for each operating system, ABI, architecture, compiler family and binary variant.
Fetch the current stable source release.
The version is resolved from Boost's official latest-release page instead of being hard-coded into the guide.
mkdir -p "$HOME/Boost/Src"
cd "$HOME/Boost/Src"
curl -fLO "https://archives.boost.io/release/1.92.0/source/boost_1_92_0.tar.bz2"
tar -xf "boost_1_92_0.tar.bz2"
export BOOST_SRC="$HOME/Boost/Src/boost_1_92_0"
Build compiled Boost libraries; do not rebuild what is header-only.
Many Boost libraries are header-only. Libraries that produce binaries should be built once per platform/ABI and installed into an explicit prefix. Genyleap projects then consume both header-only and compiled components through CMake targets.
cd "$BOOST_SRC"
./bootstrap.sh
./b2 --version
cd C:\Boost\Src\boost_1_92_0bootstrap.bat
b2.exe --version
A Boost source tree can be shared, but compiled outputs from different compilers or architectures must never be mixed into the same installation prefix.
macOS.
Use Apple Clang for binaries that integrate with the Apple SDK. On Apple Silicon, keep arm64 and x86_64 Boost installations separate; a universal application can combine platform-specific dependencies at the application/package boundary.
arm64
cd "$BOOST_SRC"
./b2 toolset=clang architecture=arm address-model=64 variant=release threading=multi link=static,shared cxxflags="-arch arm64" linkflags="-arch arm64" --prefix="$HOME/Boost/1.92.0/macos-arm64" install
x86_64
cd "$BOOST_SRC"
./b2 toolset=clang architecture=x86 address-model=64 variant=release threading=multi link=static,shared cxxflags="-arch x86_64" linkflags="-arch x86_64" --prefix="$HOME/Boost/1.92.0/macos-x86_64" install
file "$HOME/Boost/1.92.0/macos-arm64/lib/"*
file "$HOME/Boost/1.92.0/macos-x86_64/lib/"*
Linux architectures.
| Architecture | Toolchain | Build model |
|---|---|---|
x86_64 | GCC or Clang | Native |
arm64 / aarch64 | GCC or Clang | Native or cross-compiled |
armv7 / armhf | arm-linux-gnueabihf | Usually cross-compiled |
riscv64 | Target-specific GCC/Clang | Cross-compiled/custom Linux |
Native x86_64
cd "$BOOST_SRC"
./b2 toolset=gcc architecture=x86 address-model=64 variant=release threading=multi link=static,shared --prefix="$HOME/Boost/1.92.0/linux-x86_64" install
Native arm64 / aarch64
cd "$BOOST_SRC"
./b2 toolset=gcc architecture=arm address-model=64 variant=release threading=multi link=static,shared --prefix="$HOME/Boost/1.92.0/linux-arm64" install
Cross-compiled ARMv7
For embedded Linux, define the cross compiler in a dedicated Boost.Build configuration and keep the target sysroot/toolchain aligned with the device image.
user-config-armv7.jamusing gcc : armv7 : arm-linux-gnueabihf-g++ ;
cd "$BOOST_SRC"
./b2 --user-config="$HOME/Boost/Toolchains/user-config-armv7.jam" toolset=gcc-armv7 target-os=linux architecture=arm address-model=32 abi=aapcs binary-format=elf variant=release threading=multi link=static --prefix="$HOME/Boost/1.92.0/linux-armv7" install
Windows.
Run Boost.Build inside the matching Visual Studio developer environment. Keep x64 and ARM64 outputs separate, just as you keep MSVC and clang-cl build trees separate.
x64 · MSVC
cd C:\Boost\Src\boost_1_92_0
b2.exe ^
toolset=msvc ^
architecture=x86 ^
address-model=64 ^
variant=release ^
threading=multi ^
link=static,shared ^
--prefix=C:\Boost\1.92.0\windows-x64 ^
install
ARM64 · MSVC
cd C:\Boost\Src\boost_1_92_0
b2.exe ^
toolset=msvc ^
architecture=arm ^
address-model=64 ^
variant=release ^
threading=multi ^
link=static,shared ^
--prefix=C:\Boost\1.92.0\windows-arm64 ^
install
Android ABIs.
Header-only Boost components need only the headers. Separately compiled Boost libraries must be cross-compiled once per Android ABI with the same NDK used by the rest of the native application.
| ABI | NDK compiler prefix | Boost architecture |
|---|---|---|
arm64-v8a | aarch64-linux-android28-clang++ | arm / 64 |
armeabi-v7a | armv7a-linux-androideabi28-clang++ | arm / 32 |
x86_64 | x86_64-linux-android28-clang++ | x86 / 64 |
x86 | i686-linux-android28-clang++ | x86 / 32 |
export ANDROID_NDK_ROOT="$HOME/Library/Android/sdk/ndk/27.2.12479018"
export NDK_LLVM="$(find "$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt" -mindepth 1 -maxdepth 1 -type d | head -1)"
echo "$NDK_LLVM"
arm64-v8a
android-arm64.jamusing clang : android-arm64 :
$NDK_LLVM/bin/aarch64-linux-android28-clang++ ;
./b2 --user-config=android-arm64.jam toolset=clang-android-arm64 target-os=android architecture=arm address-model=64 abi=aapcs binary-format=elf link=static variant=release --prefix="$HOME/Boost/1.92.0/android-arm64-v8a" install
armeabi-v7a
android-armv7.jamusing clang : android-armv7 :
$NDK_LLVM/bin/armv7a-linux-androideabi28-clang++ ;
./b2 --user-config=android-armv7.jam toolset=clang-android-armv7 target-os=android architecture=arm address-model=32 abi=aapcs binary-format=elf link=static variant=release --prefix="$HOME/Boost/1.92.0/android-armeabi-v7a" install
x86_64
android-x86_64.jamusing clang : android-x86_64 :
$NDK_LLVM/bin/x86_64-linux-android28-clang++ ;
./b2 --user-config=android-x86_64.jam toolset=clang-android-x86_64 target-os=android architecture=x86 address-model=64 binary-format=elf link=static variant=release --prefix="$HOME/Boost/1.92.0/android-x86_64" install
iOS device and Simulator.
Boost headers can be shared, but compiled Boost libraries must match the exact Apple SDK and architecture used by the application. In the current Genyleap Qt baseline, device libraries use arm64 and Simulator libraries use x86_64, so keep the two binary prefixes separate.
export IOS_DEVICE_SDK="$(xcrun --sdk iphoneos --show-sdk-path)"
export IOS_SIMULATOR_SDK="$(xcrun --sdk iphonesimulator --show-sdk-path)"
xcrun --sdk iphoneos --find clang++
xcrun --sdk iphonesimulator --find clang++
echo "$IOS_DEVICE_SDK"
echo "$IOS_SIMULATOR_SDK"
iOS device · arm64
cd "$BOOST_SRC"
./b2 \
toolset=clang \
target-os=iphone \
architecture=arm \
address-model=64 \
abi=aapcs \
binary-format=mach-o \
threading=multi \
link=static \
variant=release \
cxxflags="-arch arm64 -isysroot $IOS_DEVICE_SDK -miphoneos-version-min=18" \
linkflags="-arch arm64 -isysroot $IOS_DEVICE_SDK -miphoneos-version-min=18" \
--prefix="$HOME/Boost/1.92.0/ios-device" \
install
iOS Simulator · x86_64
cd "$BOOST_SRC"
./b2 \
toolset=clang \
target-os=iphone \
architecture=x86 \
address-model=64 \
binary-format=mach-o \
threading=multi \
link=static \
variant=release \
cxxflags="-arch x86_64 -isysroot $IOS_SIMULATOR_SDK -mios-simulator-version-min=18" \
linkflags="-arch x86_64 -isysroot $IOS_SIMULATOR_SDK -mios-simulator-version-min=18" \
--prefix="$HOME/Boost/1.92.0/ios-simulator" \
install
The current Qt iOS Simulator libraries are x86_64. On Apple Silicon, build the compiled Boost Simulator libraries as x86_64 too so they can link into the same Qt application, and run that Simulator destination under Rosetta.
Optional XCFramework packaging
When you need one Apple package containing device and Simulator slices, create one XCFramework per compiled Boost library. Header-only Boost components do not need an XCFramework.
mkdir -p "$HOME/Boost/1.92.0/xcframeworks"
xcodebuild -create-xcframework \
-library "$HOME/Boost/1.92.0/ios-device/lib/libboost_filesystem.a" \
-headers "$HOME/Boost/1.92.0/ios-device/include" \
-library "$HOME/Boost/1.92.0/ios-simulator/lib/libboost_filesystem.a" \
-headers "$HOME/Boost/1.92.0/ios-simulator/include" \
-output "$HOME/Boost/1.92.0/xcframeworks/BoostFilesystem.xcframework"
lipo -info "$HOME/Boost/1.92.0/ios-device/lib/libboost_filesystem.a"
lipo -info "$HOME/Boost/1.92.0/ios-simulator/lib/libboost_filesystem.a"
For current Genyleap builds, use Xcode 16 or newer whenever the surrounding Qt/Apple toolchain requires it.
Consume Boost with modern CMake targets.
Do not add global include directories or manually concatenate library filenames. Point CMake at the architecture-specific Boost prefix and link imported Boost targets to the target that owns the dependency.
find_package(Boost 1.92.0 CONFIG REQUIRED
COMPONENTS
asio
filesystem
json
program_options
)
target_link_libraries(genyleap_core
PRIVATE
Boost::asio
Boost::filesystem
Boost::json
Boost::program_options
)
cmake -S . -B build/dev -G Ninja -DCMAKE_PREFIX_PATH="$HOME/Boost/1.92.0/macos-arm64"
cmake --build build/dev --parallel
Current Boost CMake package configuration can expose header-only libraries as named components too. Prefer imported targets such as Boost::asio или Boost::mp11 over directory-wide include/link settings.
Verify the library boundary, not only the install command.
find "$HOME/Boost/1.92.0/macos-arm64" -maxdepth 2 -type f | head
file "$HOME/Boost/1.92.0/macos-arm64/lib/"*
Then configure and build a small real target through find_package(Boost CONFIG ...). That verifies the installed CMake package, include paths, binary architecture and transitive component graph together.