This document describes how to install dependencies, compile from source, run, and prepare for local debugging of Apache Doris on macOS (Intel and Apple Silicon).
:::tip Compute-storage decoupled mode compilation and deployment is not yet supported on macOS. :::
Install the base dependencies with Homebrew:
brew install automake autoconf libtool pkg-config texinfo coreutils gnu-getopt \ python@3 cmake ninja ccache bison byacc gettext wget pcre maven llvm@22 llvm@20 openjdk@17 npm
Both LLVM versions are needed.
llvm@22compiles the BE (LLVM 22.1.8 is the first release whose AddressSanitizer runtime starts on macOS 26.4 and later).llvm@20compiles the third-party libraries when they are built from source:thirdparty/build-thirdparty.shstops if it is missing, andbuild.shstarts such a build by itself whenthirdparty/installedlacks a library it needs. The build scripts find both through Homebrew, so neither has to be added toPATH.
The arm64 version of brew on macOS does not include JDK 8 by default, so
openjdk@17is recommended. If you need JDK 8, install Zulu JDK 8 manually. Maven can also be downloaded separately from the Maven website and configured via environment variables.
Some dependencies on Apple Silicon also require manual environment variable configuration:
export PATH="/opt/homebrew/opt/bison/bin:$PATH" export PATH="/opt/homebrew/opt/texinfo/bin:$PATH" ln -s -f /opt/homebrew/bin/python3 /opt/homebrew/bin/python
cd ~ mkdir DorisDev && cd DorisDev git clone https://github.com/apache/doris.git export DORIS_HOME=~/DorisDev/doris export PATH=$DORIS_HOME/bin:$PATH
Thrift only needs to be installed separately when debugging FE alone. When debugging both BE and FE, the BE third-party libraries already include Thrift.
brew install thrift@0.16.0 mkdir -p ./thirdparty/installed/bin # Apple Silicon ln -s /opt/homebrew/Cellar/thrift@0.16.0/0.16.0/bin/thrift ./thirdparty/installed/bin/thrift # Intel ln -s /usr/local/Cellar/thrift@0.16.0/0.16.0/bin/thrift ./thirdparty/installed/bin/thrift
If brew install thrift@0.16.0 reports that the version cannot be found, handle it as follows:
brew tap homebrew/core --force brew tap-new $USER/local-tap brew extract --version='0.16.0' thrift $USER/local-tap brew install thrift@0.16.0
Reference: https://gist.github.com/tonydeng/02e571f273d6cce4230dc8d5f394493c
You can directly download the prebuilt third-party libraries provided by the community, which skips the process of compiling the third-party libraries:
cd thirdparty rm -rf installed # Intel chip curl -L https://github.com/apache/doris-thirdparty/releases/download/automation/doris-thirdparty-prebuilt-darwin-x86_64.tar.xz \ -o - | tar -Jxf - # Apple Silicon chip curl -L https://github.com/apache/doris-thirdparty/releases/download/automation/doris-thirdparty-prebuilt-darwin-arm64.tar.xz \ -o - | tar -Jxf - # Verify that protoc and thrift run correctly cd installed/bin ./protoc --version ./thrift --version
When running
protocandthrift, if you see a prompt cannot be opened because the developer cannot be verified, go toSecurity & Privacy → Generaland clickOpen Anyway. Reference: https://support.apple.com/zh-cn/HT202491
You can also download the third-party library source doris-thirdparty-source.tgz from the Apache Doris Third Party Prebuilt page and compile it yourself.
ulimit -n 65536 # Write to the startup script so it takes effect automatically next time the terminal opens # bash echo 'ulimit -n 65536' >>~/.bashrc # zsh echo 'ulimit -n 65536' >>~/.zshrc
cd $DORIS_HOME bash build.sh
cd output/be/bin && ./start_be.sh --daemon cd output/fe/bin && ./start_fe.sh --daemon
# Copy the build output to use as the runtime directory cp -r output ../doris-run
Then modify the following in the FE / BE conf:
min_file_descriptor_number = 10000 in BENext, configure debugging in your IDE:
When compiling BE, CMake may fail to find OpenMP and report the following errors:
Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) fatal error: 'omp.h' file not found
Install libomp, then check that its Homebrew installation contains omp.h:
brew install libomp LIBOMP_PREFIX="$(brew --prefix libomp)" test -f "${LIBOMP_PREFIX}/include/omp.h"
Add the following environment variables to custom_env.sh in the Doris source root:
LIBOMP_PREFIX="$(brew --prefix libomp)" export CPPFLAGS="-I${LIBOMP_PREFIX}/include ${CPPFLAGS:-}" export CFLAGS="-I${LIBOMP_PREFIX}/include ${CFLAGS:-}" export CXXFLAGS="-I${LIBOMP_PREFIX}/include ${CXXFLAGS:-}" export LDFLAGS="-L${LIBOMP_PREFIX}/lib ${LDFLAGS:-}" export EXTRA_CXX_FLAGS="-I${LIBOMP_PREFIX}/include ${EXTRA_CXX_FLAGS:-}"
The be/CMakeLists.txt file resets CMAKE_C_FLAGS and CMAKE_CXX_FLAGS, so CMake's OpenMP checks may not receive CPPFLAGS, CFLAGS, or CXXFLAGS. EXTRA_CXX_FLAGS passes the libomp include path to the BE build and is required for this workaround.
custom_env.sh is a local build configuration file. Do not commit it to the repository.
Error message:
opensslErrorStack: ['error:03000086:digital envelope routines::initialization error'] library: 'digital envelope routines' reason: 'unsupported' code: 'ERR_OSSL_EVP_UNSUPPORTED'
Solution:
export NODE_OPTIONS=--openssl-legacy-provider