Skip to content

Building from source

Getting the sources

StormWeaver uses git submodules. These are not included in the tarballs generated by github, to get the sources, use git clone --recursive, or git clone and initialize the submodules in a separate command:

git clone --recursive https://github.com/Percona-Lab/stormweaver.git

Installing dependencies

The build process only requires two dependencies (other than git):

  • A modern C++ compilar, such as gcc and clang.
  • Conan 2, to download and build 3rd party libraries

The build process also uses CMake and ninja, but these will be installed by conan if not present on the system.

Conan profile

After installing Conan 2 (using the instructions at https://docs.conan.io/2/installation.html), it also requires a profile setup.

A default profile can be created using the following command:

conan profile detect

The default profile usually selects an older C++ standard, while StormWeaver uses C++23. This can be changed by editing ~/.conan2/profiles/default and setting compiler.cppstd to 23.

Building

The following command builds both StormWeaver and all of its conan managed dependencies:

conan build . --build=missing --settings=build_type=<Debug/Release>

During development, when the dependencies are already installed and only the main sources have to be rebuilt. the following commands provide a quicker result:

# or conan-release
cmake --build --target install --preset conan-debug

or with older CMake versions, which do not support this option:

# or Release
cd build/Debug
ninja install

Advanced build options

StormWeaver can be built with various sanitizers for debugging purposes. These can be enabled in the conan build command with various options, for example to build with the address (asan) and undefined behavior (ubsan) sanitizers:

conan build . --build=missing --settings=build_type=<Debug/Release> -o '&:asan=True' -o '&:ubsan=True'

Similarly, msan and tsan are also supported.

Note

Not all sanitizers can be combined together in a single build. While the above example with asan and ubsan works, other combinations can result in either a build failure or false positives in the report.