Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Development Builds

Matt Butrovich edited this page Aug 22, 2018 · 20 revisions

Build Types

The CMAKE_BUILD_TYPE flag can be configured as:

  • debug: The default warning level for builds. Debug symbols are retained, and no optimizations are applied. Approximate to -ggdb -O0
  • release: Debug symbols are stripped, and all optimizations are applied. Approximate to -DNDEBUG -O3
  • fastdebug: Debug symbols are retained, and safe optimizations are applied. Approximate to -ggdb -O1
  • relwithdebinfo: Debug symbols are retained, and most optimizations are applied. Approximate to -ggdb -O2

You can change the build type by passing -DCMAKE_BUILD_TYPE=<setting> to CMake.

Warning Levels

Our CMake system has a BUILD_WARNING_LEVEL flag to adjust predefined warning levels. The available settings are:

  • checkin: The default warning level for builds. Warnings are reported as errors. Approximate to -Wall -Werror
  • production: Warnings are not reported as errors. Approximate to -Wall
  • everything: Pedantic warning level. Approximate to -Weverything -Werror on Clang and -Wall -Wpedantic -Wextra -Werror on GCC.

You can change the warning level by passing -DBUILD_WARNING_LEVEL=<setting> to CMake.

Build Targets

Developers should familiarize themselves with the following make targets:

  • terrier: builds the terrier binary and its dependencies.
  • unittest: builds our Google Test suite, executes them, and summarizes the results.
  • runbenchmark: builds our Google Benchmark suite, executes them, and summarizes the results.

See our Testing page for more details.

  • check-clang-tidy: Runs clang-tidy with our rules on the src, benchmark, test folder and summarizes the results.
  • check-format: Runs clang-format with our rules on the src folder and summarizes the results.
  • format: Runs clang-format with our rules on the src folder and fixes any issues.

See our Formatting page for more details.

Sanitizers

We have the following CMake flags to enable Google's Sanitizers:

You can enable Sanitizers by passing -D<sanitizer flag>=ON to CMake.

Memcheck

We have a TERRIER_TEST_MEMCHECK CMake flag to enable Valgrind's Memcheck on the Google Test suite. You can enable it by passing -DTERRIER_TEST_MEMCHECK=ON to CMake.

Continuous Integration

Pull requests are run through travis-ci and Jenkins for continuous integration. You can avoid build failures by running the following checks before submitting your pull request:

make format
make lint
make check-clang-tidy
make unittest

Use debug build type, checkin warning level, and AddressSanitizer enabled.