userver: Build instructions for userver's own samples, tests and benchmarks
Loading...
Searching...
No Matches
Build instructions for userver's own samples, tests and benchmarks

Warning
if you are new to userver please start with quick start for beginners. This section is for opensourse userver development ONLY.

Usually there's no need to build userver itself. Refer to Configure, Build and Install section to make a service from a template and build it. If there's a strong need to build the userver and run its tests, then:

  1. Download and extract the latest release from https://github.com/userver-framework/userver
    git clone git@github.com:userver-framework/userver.git
    cd userver
  2. Install the build dependencies

    Alternatively you could use a docker container with all the building dependencies installed from Docker.

  3. Build userver:

    mkdir build_debug
    cd build_debug
    # Adjust with flags from "Platform-specific build dependencies" section
    cmake -S .. \
    -DCMAKE_C_COMPILER=clang-16 \
    -DCMAKE_CXX_COMPILER=clang++-16 \
    -DCMAKE_BUILD_TYPE=Debug \
    -DCPM_SOURCE_CACHE=~/cpm \
    -DUSERVER_BUILD_ALL_COMPONENTS=1 \
    -DUSERVER_BUILD_SAMPLES=1 \
    -DUSERVER_BUILD_TESTS=1
    cmake --build . -j$(nproc)
    See also
    cmake_options
  4. Run tests via ulimit -n 4096 && ctest -V

If you need to edit or make your own docker image with custom configuration, read about it at Building Docker container for userver.