- CMake
>= 3.16
- C++ Compiler
>= C++17
- and see Dockerfile section
# retrieve third party modules
git submodule update --init --recursive
FROM ubuntu:22.04
RUN apt update -y && apt install -y git build-essential cmake ninja-build libboost-filesystem-dev libboost-system-dev libboost-container-dev libboost-thread-dev libboost-stacktrace-dev libgoogle-glog-dev libgflags-dev doxygen libtbb-dev libnuma-dev libssl-dev
optional packages:
doxygen
graphviz
clang-tidy-14
This requires below tsurugidb modules to be installed.
mkdir -p build-third_party/concurrentqueue
cd build-third_party/concurrentqueue
cmake -G Ninja -DCMAKE_INSTALL_PREFIX=[/path/to/install-prefix] ../../third_party/concurrentqueue
cmake --build . --target install
see https://github.com/cameron314/concurrentqueue
mkdir -p build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
available options:
-DCMAKE_INSTALL_PREFIX=<installation directory>
- change install location-DCMAKE_PREFIX_PATH=<installation directory>
- indicate prerequisite installation directory-DCMAKE_IGNORE_PATH="/usr/local/include;/usr/local/lib/"
- specify the libraries search paths to ignore. This is convenient if the environment has conflicting version installed on system default search paths. (e.g. gflags in /usr/local)-DBUILD_SHARED_LIBS=OFF
- create static libraries instead of shared libraries-DBUILD_TESTS=OFF
- don't build test programs-DBUILD_DOCUMENTS=OFF
- don't build documents by doxygen-DINSTALL_EXAMPLES=ON
- install example applications-DBUILD_BENCHMARK=ON
- build benchmark programs-DSHARKSFIN_IMPLEMENTATION=<implementation name>
- switch sharksfin implementation. Available options arememory
andshirakami
(default:memory
)-DENABLE_ALTIMETER=ON
- turn on thealtimeter logging
.-DMC_QUEUE=ON
- use moody camel queue instead of tbb queue to store tasks in tateyama task scheduler.-DENABLE_DEBUG_SERVICE=OFF
- turn off thedebug service
.- for debugging only
-DENABLE_SANITIZER=OFF
- disable sanitizers (requires-DCMAKE_BUILD_TYPE=Debug
)-DENABLE_UB_SANITIZER=ON
- enable undefined behavior sanitizer (requires-DENABLE_SANITIZER=ON
)-DENABLE_COVERAGE=ON
- enable code coverage analysis (requires-DCMAKE_BUILD_TYPE=Debug
)-DTRACY_ENABLE=ON
- enable tracy profiler for multi-thread debugging. See section below.
cmake --build . --target install
Execute the test as below:
ctest -V
cmake --build . --target doxygen
You can customize logging in the same way as sharksfin. See sharksfin README.md for more details.
GLOG_minloglevel=0 ./group-cli --minimum
You can use Tracy Profiler to graphically display the threads operations and improve printf debug by printing messages on the tooltips on the Tracy profiler UI.
By setting cmake build option -DTRACY_ENABLE=ON
, TracyClient.cpp file is added to the build and tracing macros are enabled.
Prerequirement:
- ensure tracy code is located under
third_party/tracy
directory.
git submodule update --init third_party/tracy
- include common.h at the top of files that requires tracing.
#include <tateyama/common.h>
- Put
trace_scope
at the beginning of the scope to trace, or use other tracing functions defined in common.h.