Bear should be quite portable on UNIX operating systems. It has been tested on FreeBSD, GNU/Linux and OS X.
- C++ compiler, to compile the sources. (Shall support C++17 dialect.)
- CMake, to configure the build. (Minimum version is 3.12) And a build tool supported by CMake.
- pkg-config to look up for dependencies' compiler flags.
- protoc and grpc_cpp_plugin commands. (See gRPC dependencies.)
The dependencies can come from OS packages or the build will fetch the sources and build locally.
Developer dependencies:
- python >= 3.5
- googletest >= 1.10
- lit >= 0.7
Install dependencies from packages on Fedora 32
dnf install python cmake pkg-config
dnf install json-devel spdlog-devel fmt-devel grpc-devel grpc-plugins
dnf install gtest-devel gmock-devel # optional for running the tests
Install dependencies from packages on Arch
pacman -S python cmake pkg-config
pacman -S grpc spdlog fmt nlohmann-json
pacman -S gtest gmock # optional for running the tests
Install dependencies from packages on Ubuntu 20.04
apt-get install python cmake pkg-config
apt-get install libfmt-dev libspdlog-dev nlohmann-json3-dev
apt-get install libgrpc++-dev protobuf-compiler-grpc libssl-dev
Install dependencies from packages from Brew
brew install fmt spdlog nlohmann-json grpc pkg-config
Install dependencies from packages on Alpine edge
apk add git cmake pkgconf make g++
apk add protobuf-dev grpc-dev fmt-dev spdlog-dev nlohmann-json c-ares-dev
Ideally, you should build Bear in a separate build directory.
cmake -DENABLE_UNIT_TESTS=OFF -DENABLE_FUNC_TESTS=OFF $BEAR_SOURCE_DIR
make all
make install
You can configure the build process with passing arguments to cmake.
To run test during the build process, you will need to install the test frameworks and re-configure the build. For unit testing Bear uses googletest, which will be built from source if you not install it before.
# install `lit` the functional test framework into a python virtualenv
mkvirtualenv bear
pip install lit
# it's important to re-run the configure step again
cmake $BEAR_SOURCE_DIR
cmake --build $build_dir --parallel 4