boostorg / redis

An async redis client designed for performance and scalability
https://www.boost.org/doc/libs/develop/libs/redis/doc/html/index.html
Boost Software License 1.0
212 stars 38 forks source link

Problem with installation #198

Closed SergeyPod closed 2 months ago

SergeyPod commented 2 months ago

Hi, I tried to install Boost.Redis in two ways, both failed. The fist approach, as suggested here (*):

(base) <username>@<machinename>:~/tmp/redis$ BOOST_ROOT=/usr/local cmake --preset g++-11
Preset CMake variables:

  CMAKE_BUILD_TYPE="Debug"
  CMAKE_CXX_COMPILER="g++-11"
  CMAKE_CXX_EXTENSIONS="OFF"
  CMAKE_CXX_FLAGS="-Wall -Wextra -fsanitize=address"
  CMAKE_CXX_STANDARD_REQUIRED="ON"
  CMAKE_SHARED_LINKER_FLAGS="-fsanitize=address"
  PROJECT_BINARY_DIR="/home/<username>/tmp/redis/build/g++-11"

CMake Error at CMakeLists.txt:84 (add_subdirectory):
  add_subdirectory given source "../system" which is not an existing
  directory.

CMake Error at CMakeLists.txt:84 (add_subdirectory):
  add_subdirectory given source "../assert" which is not an existing
  directory.
....

CMake Error at CMakeLists.txt:84 (add_subdirectory):
  add_subdirectory given source "../json" which is not an existing directory.

CMake Error at CMakeLists.txt:84 (add_subdirectory):
  add_subdirectory given source "../endian" which is not an existing
  directory.

-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so (found version "3.12.4")
-- Configuring incomplete, errors occurred!

The second is compilation of entire boost library. It looks like redis is not in the list of boost modules:

(base) <username>@<machinename>:~/tmp/boost_1_85_0$ ./b2 --show-libraries
The following libraries require building:
    - atomic
    - charconv
    - chrono
    - cobalt
    - container
    - context
    - contract
    - coroutine
    - date_time
    - exception
    - fiber
    - filesystem
    - graph
    - graph_parallel
    - headers
    - iostreams
    - json
    - locale
    - log
    - math
    - mpi
    - nowide
    - program_options
    - python
    - random
    - regex
    - serialization
    - stacktrace
    - system
    - test
    - thread
    - timer
    - type_erasure
    - url
    - wave

Can you help with this? Thanks a lot in advance.

(*) https://www.boost.org/doc/libs/1_85_0/libs/redis/doc/html/index.html

anarthal commented 2 months ago

This is a header-only library, so you don't actually need to build it with b2.

I'd advise to:

IIRC (Marcelo can probably tell you better), you also need to include the file boost/redis/src.hpp exactly in one of your .cpp files.

Hope it helps.

anarthal commented 2 months ago

The instructions to consume the library seem outdated, from the time before Redis was included in Boost. We should update them.

SergeyPod commented 2 months ago

Thank you, @anarthal , provided suggestion worked for me.