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
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
Install dependencies from packages on Fedora 32/33
dnf install python cmake pkg-config
dnf install json-devel spdlog-devel fmt-devel sqlite-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 sqlite
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 libsqlite3-dev
apt-get install libgrpc++-dev protobuf-compiler-grpc libssl-dev
Install dependencies from packages from Brew
brew install fmt spdlog nlohmann-json sqlite grpc pkg-config
Install dependencies from packages on Alpine edge
apk add git cmake pkgconf make g++
apk add fmt-dev spdlog-dev nlohmann-json sqlite-dev
apk add protobuf-dev grpc-dev c-ares-dev
Xcode < 11 or macOS < 10.15 users should get LLVM Clang
binaries and headers. Make sure that clang++ -v
returns correct InstalledDir
.
This is because std::filesystem
is not available on Clang supplied with Xcode < 11,
and std::filesystem::path
is not available in system C++ dylib for macOS < 10.15.
If OpenSSL is installed via Brew, and it's keg-only, run the following (before the build) for pkg-config to find it as grpc's dependency:
export PKG_CONFIG_PATH=$(brew --prefix)/opt/[email protected]/lib/pkgconfig