Genyleap/Docs
Stack Development Guide · Boost

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.

Current Boost 1.92.0 ソース official release archive 開発 Boost.Build / b2 Consume CMake imported targets

Use Boost deliberately.

Standard library first

Do not keep a Boost dependency only because older C++ standards once lacked the equivalent facility.

Library-level dependencies

Link only the Boost components a target actually needs; avoid turning the whole Boost tree into an implicit global dependency.

Header-only is still a dependency

Header-only libraries affect compile time, warnings, feature requirements and transitive dependencies even when no binary is linked.

Compiled libraries are architecture-specific

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.

ShellDownload and extract
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.

POSIX shellBootstrap Boost.Build
cd "$BOOST_SRC"
./bootstrap.sh

./b2 --version
WindowsBootstrap Boost.Build
cd C:\Boost\Src\boost_1_92_0bootstrap.bat

b2.exe --version
Keep source, build products and install prefixes separate.

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

ShellApple Silicon
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

ShellIntel macOS
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
ShellVerify architecture
file "$HOME/Boost/1.92.0/macos-arm64/lib/"*
file "$HOME/Boost/1.92.0/macos-x86_64/lib/"*

Linux architectures.

ArchitectureToolchainBuild model
x86_64GCC or ClangNative
arm64 / aarch64GCC or ClangNative or cross-compiled
armv7 / armhfarm-linux-gnueabihfUsually cross-compiled
riscv64Target-specific GCC/ClangCross-compiled/custom Linux

Native x86_64

ShellGCC
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

ShellGCC
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.

Boost.Builduser-config-armv7.jam
using gcc : armv7 : arm-linux-gnueabihf-g++ ;
ShellARMv7 hard-float
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

Developer PowerShellx64
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

ARM64 Developer PowerShellARM64
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.

ABINDK compiler prefixBoost architecture
arm64-v8aaarch64-linux-android28-clang++arm / 64
armeabi-v7aarmv7a-linux-androideabi28-clang++arm / 32
x86_64x86_64-linux-android28-clang++x86 / 64
x86i686-linux-android28-clang++x86 / 32
ShellResolve the NDK LLVM toolchain
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

Boost.Buildandroid-arm64.jam
using clang : android-arm64 :
    $NDK_LLVM/bin/aarch64-linux-android28-clang++ ;
Shell開発
./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

Boost.Buildandroid-armv7.jam
using clang : android-armv7 :
    $NDK_LLVM/bin/armv7a-linux-androideabi28-clang++ ;
Shell開発
./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

Boost.Buildandroid-x86_64.jam
using clang : android-x86_64 :
    $NDK_LLVM/bin/x86_64-linux-android28-clang++ ;
Shell開発
./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.

ShellResolve Apple SDKs
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

ShellBoost static libraries for iphoneos
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

ShellBoost static libraries for iphonesimulator
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
Match Qt's Simulator architecture.

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.

ShellExample: Boost.Filesystem
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"
ShellVerify slices
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.

CMakeCompiled + header-only components
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
)
ShellSelect one architecture-specific prefix
cmake -S . -B build/dev -G Ninja   -DCMAKE_PREFIX_PATH="$HOME/Boost/1.92.0/macos-arm64"

cmake --build build/dev --parallel
Boost 1.92.0 has modern CMake component support.

Current Boost CMake package configuration can expose header-only libraries as named components too. Prefer imported targets such as Boost::asio or Boost::mp11 over directory-wide include/link settings.

Verify the library boundary, not only the install command.

ShellInspect installation
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.

現在の upstream リファレンス。