Skip to main content
This guide covers building the Arrow C++ libraries from source. Arrow uses CMake as a build configuration system and supports both CMake presets and manual configuration.

System Requirements

Building Arrow C++ requires:
  • A C++20-enabled compiler (gcc 12+ on Linux)
  • CMake 3.25 or higher
  • make or ninja build utilities on Linux/macOS
  • At least 1GB RAM for minimal builds, 4GB for debug builds with tests, 8GB for full builds

Installing Dependencies

sudo apt-get install \
    build-essential \
    ninja-build \
    cmake

Building with CMake Presets

CMake presets (available in CMake 3.21+) provide preconfigured build configurations for common use cases.
1
Clone the repository
2
git clone https://github.com/apache/arrow.git
cd arrow/cpp
3
List available presets
4
cmake --list-presets
5
You’ll see presets like:
6
  • ninja-debug-minimal - Debug build without optional features
  • ninja-debug-basic - Debug build with tests and reduced dependencies
  • ninja-debug - Debug build with tests and more optional components
  • ninja-release-minimal - Release build with minimal features
  • ninja-release - Full release build
  • 7
    Create build directory and configure
    8
    mkdir build
    cd build
    cmake .. --preset ninja-debug-minimal
    
    9
    Build and install
    10
    cmake --build .
    cmake --install .
    
    You can override preset options by adding custom CMake flags:
    cmake .. --preset ninja-debug-minimal -DCMAKE_INSTALL_PREFIX=/usr/local
    
    CMake presets are provided for convenience and may change over time. For automated builds, CI systems, and release scripts, use manual configuration with explicit options.

    Manual Configuration

    For more control over the build, use manual CMake configuration.
    1
    Clone and navigate to cpp directory
    2
    git clone https://github.com/apache/arrow.git
    cd arrow/cpp
    
    3
    Create and configure a build directory
    4
    Release Build
    mkdir build-release
    cd build-release
    cmake ..
    make -j8  # Adjust -j flag based on CPU cores
    make install
    
    Debug Build with Tests
    # Initialize submodules for test data
    git submodule update --init --recursive
    export ARROW_TEST_DATA=$PWD/../testing/data
    
    mkdir build-debug
    cd build-debug
    cmake -DCMAKE_BUILD_TYPE=Debug \
          -DARROW_BUILD_TESTS=ON \
          ..
    make -j8
    make unittest  # Run tests
    make install
    
    5
    Build with Ninja (faster builds)
    6
    mkdir build
    cd build
    cmake -GNinja \
          -DCMAKE_BUILD_TYPE=Release \
          ..
    ninja
    ninja install
    

    Build Types

    • Debug: No optimizations, includes debugging symbols (-DCMAKE_BUILD_TYPE=Debug)
    • Release: Optimizations enabled, no debug info (default)
    • RelWithDebInfo: Optimizations with debug info (-DCMAKE_BUILD_TYPE=RelWithDebInfo)

    Optional Components

    Enable specific Arrow features by adding CMake flags:
    cmake -DCMAKE_BUILD_TYPE=Release \
          -DARROW_COMPUTE=ON \
          -DARROW_CSV=ON \
          -DARROW_DATASET=ON \
          -DARROW_FILESYSTEM=ON \
          -DARROW_FLIGHT=ON \
          -DARROW_FLIGHT_SQL=ON \
          -DARROW_GANDIVA=ON \
          -DARROW_HDFS=ON \
          -DARROW_JSON=ON \
          -DARROW_ORC=ON \
          -DARROW_PARQUET=ON \
          -DARROW_S3=ON \
          -DARROW_WITH_BROTLI=ON \
          -DARROW_WITH_BZ2=ON \
          -DARROW_WITH_LZ4=ON \
          -DARROW_WITH_SNAPPY=ON \
          -DARROW_WITH_ZLIB=ON \
          -DARROW_WITH_ZSTD=ON \
          ..
    

    Core Components

    OptionDescription
    ARROW_COMPUTEComputational kernel functions
    ARROW_CSVCSV reader module
    ARROW_DATASETDataset API (implies Filesystem API)
    ARROW_FILESYSTEMLocal and remote filesystem access
    ARROW_FLIGHTArrow Flight RPC system
    ARROW_GANDIVAExpression compiler (requires LLVM)
    ARROW_PARQUETApache Parquet support
    ARROW_JSONJSON reader module
    ARROW_ORCApache ORC integration
    ARROW_S3Amazon S3 filesystem support
    ARROW_GCSGoogle Cloud Storage support

    Compression Libraries

    OptionDescription
    ARROW_WITH_BROTLIBrotli compression
    ARROW_WITH_BZ2BZ2 compression
    ARROW_WITH_LZ4LZ4 compression
    ARROW_WITH_SNAPPYSnappy compression
    ARROW_WITH_ZLIBZlib (gzip) compression
    ARROW_WITH_ZSTDZSTD compression

    Development Options

    For development builds, enable additional targets:
    cmake -DCMAKE_BUILD_TYPE=Debug \
          -DARROW_BUILD_TESTS=ON \
          -DARROW_BUILD_BENCHMARKS=ON \
          -DARROW_BUILD_EXAMPLES=ON \
          -DARROW_BUILD_UTILITIES=ON \
          -DARROW_EXTRA_ERROR_CONTEXT=ON \
          ..
    
    OptionDescription
    ARROW_BUILD_TESTSBuild unit tests
    ARROW_BUILD_BENCHMARKSBuild benchmarks
    ARROW_BUILD_EXAMPLESBuild API examples
    ARROW_BUILD_UTILITIESBuild command-line utilities
    ARROW_EXTRA_ERROR_CONTEXTEnhanced error messages with stack traces
    ARROW_FUZZINGBuild fuzz testing targets

    Dependency Management

    Arrow supports multiple methods for resolving dependencies:
    -DARROW_DEPENDENCY_SOURCE=AUTO     # Try system, fallback to bundled (default)
    -DARROW_DEPENDENCY_SOURCE=BUNDLED  # Build from source
    -DARROW_DEPENDENCY_SOURCE=SYSTEM   # Use system packages only
    -DARROW_DEPENDENCY_SOURCE=CONDA    # Use conda environment
    -DARROW_DEPENDENCY_SOURCE=VCPKG    # Use vcpkg packages
    -DARROW_DEPENDENCY_SOURCE=BREW     # Use Homebrew (macOS)
    

    Override Individual Dependencies

    You can override specific dependency sources:
    cmake -DARROW_DEPENDENCY_SOURCE=SYSTEM \
          -DProtobuf_SOURCE=BUNDLED \
          ..
    
    When using BUNDLED dependencies, the build system will download source tarballs from the internet. For offline builds, use the thirdparty/download_dependencies.sh script to download sources in advance.

    Common Build Issues

    On some Linux distributions, set an explicit locale:
    export LC_ALL="en_US.UTF-8"
    
    On multi-architecture Linux systems, specify:
    cmake -DCMAKE_INSTALL_LIBDIR=lib ..
    
    Reduce parallel jobs or enable unity builds:
    make -j2  # Use fewer parallel jobs
    # OR
    cmake -DCMAKE_UNITY_BUILD=ON ..  # Unity builds (faster but needs more RAM)
    
    If conda is installed but not being used, explicitly disable:
    cmake -DARROW_DEPENDENCY_SOURCE=SYSTEM ..
    

    Modular Build Targets

    Build specific components instead of everything:
    make arrow          # Just Arrow core libraries
    make parquet        # Just Parquet libraries
    make gandiva        # Just Gandiva libraries
    
    make arrow-tests    # Arrow tests
    make parquet-all    # Parquet + tests + benchmarks
    
    With Ninja, use ninja arrow instead of make arrow.

    Platform-Specific Notes

    Windows

    See the dedicated Windows build guide for Visual Studio and MSVC-specific instructions.

    macOS with Xcode

    Generate an Xcode project for debugging:
    cd cpp
    mkdir xcode-build
    cd xcode-build
    cmake .. -G Xcode \
          -DARROW_BUILD_TESTS=ON \
          -DCMAKE_BUILD_TYPE=DEBUG
    open arrow.xcodeproj
    

    Next Steps

    Python bindings

    Build PyArrow with Arrow C++

    R package

    Build the Arrow R package

    Development guide

    Learn about C++ development workflows

    Testing

    Run tests and benchmarks

    Build docs developers (and LLMs) love