Skip to main content
Version: Stable-3.1

How to build StarRocks

In general, you can build StarRocks by just executing


This command will check if all the thirdpary dependencies are ready at first. If all dependencies are ready, it will build StarRocks Backend and Frontend.

After this command executes succefully, the generated binary will be in output directory.

build FE/BE separately

You don't need to build both FE and BE each time, you can build them separately. For example, you can only build BE by

./ --be

and, only build FE by

./ --fe

How to run unit test

Unit tests of BE and FE are separted. In general, you can run BE test by


run FE test by


How to run BE UT in command line

Now, BE UT needs some dependency to run, and ./ helps it. But it is not flexible enough. When you want to run UT in the command-line, you can execute

UDF_RUNTIME_DIR=./ STARROCKS_HOME=./ LD_LIBRARY_PATH=/usr/lib/jvm/java-18-openjdk-amd64/lib/server ./be/ut_build_ASAN/test/starrocks_test

StarRocks Backend UT is built on top of google-test, so you can pass filter to run some of the UT, For example, you want to test only MapColumn related tests, you can execute

UDF_RUNTIME_DIR=./ STARROCKS_HOME=./ LD_LIBRARY_PATH=/usr/lib/jvm/java-18-openjdk-amd64/lib/server ./be/ut_build_ASAN/test/starrocks_test --gtest_filter="*MapColumn*"

Build options

build with clang

You can build StarRocks by clang too

CC=clang CXX=clang++ ./ --be

Then you can see the following similar message in the build message

-- compiler Clang version 14.0.0

build with different linker

The default linker is slow, developer can specify different linker to speed up linking. For example, you can use lld, the LLVM-based linker.

You need to install lld firstly.

sudo apt install lld

Then you set the environment variable STARROCKS_LINKER with the linker you want to use. For example:


build different type

You can build StarRocks with different types with different BUILD_TYPE variable, the default BUILD_TYPE is RELEASE. For example, you can build StarRocks with ASAN type by