This document describes how to compile Apache Doris directly on Linux (using Ubuntu 24.04 or later as the example), without using a Docker image or the LDB Toolchain.
| Dimension | Description |
|---|---|
| Target audience | Developers on a newer distribution (such as Ubuntu 24.04+) who want to use the system's bundled GCC |
| Pros | Fewest steps; install dependencies directly through the system package manager |
| Cons | Older distributions may fail to compile because GCC or glibc is too old. In that case, use the LDB Toolchain instead |
| Component | Version requirement |
|---|---|
| Operating system | Ubuntu 24.04+ (or an equivalent version of another distribution) |
| JDK | 8+ (for version 2.1 and earlier); 17 (for version 3.0 and later, or the master branch) |
| GCC | 10+ |
| Python | 2.7+ |
| Apache Maven | 3.5+ |
| CMake | 3.19.2+ |
| Bison | 3.0+ |
Choose the JDK based on the target Doris version:
# To compile Doris 2.1 or earlier, install JDK 8 sudo apt install openjdk-8-jdk # To compile Doris 3.0 or later, or the master branch, install JDK 17 sudo apt install openjdk-17-jdk
sudo apt install build-essential maven cmake byacc flex automake libtool-bin bison binutils-dev libiberty-dev zip unzip libncurses5-dev curl git ninja-build python sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa sudo apt update sudo apt install gcc-10 g++-10 sudo apt-get install autoconf automake libtool autopoint
cat /proc/cpuinfo | grep avx2
A non-empty output means the CPU supports AVX2, and you can use the default compile options. Otherwise, append USE_AVX2=0 to the build command.
# Default build, producing AVX2-enabled artifacts sh build.sh # When the CPU does not support AVX2, append USE_AVX2=0 USE_AVX2=0 sh build.sh # Build a Debug version of BE BUILD_TYPE=Debug sh build.sh
After the build completes, the artifacts are located under output/ in the source root directory.
Older distributions usually ship with versions of GCC and glibc that are too old. Use the LDB Toolchain or the Docker image instead.
AVX2 not supported.The CPU does not support the AVX2 instruction set. Rerun with USE_AVX2=0 sh build.sh, and download the no-avx2 series of prebuilt third-party libraries.
Too many open files.Raise the per-process file handle limit with ulimit -n 65536, or configure it permanently in /etc/security/limits.conf.
The message ninja failed with: signal: killed usually indicates OOM. Use a machine with at least 16 GB of memory, or reduce the parallelism (the -j parameter).