Installation and Building
This section covers the build environment for Reldbase developers and the commands to build and install the library. For running tests, see Testing.
Core build requirements
C++23 compiler (clang++ 19 or later)
CMake 3.31 or later
PostgreSQL development libraries (libpq)
Documentation requirements (optional)
Doxygen
Python 3 with the Sphinx packages listed in
docs/requirements.txt
Testing requirements
Boost::ut for unit tests (fetched automatically via CMake’s
FetchContentwhen Reldbase is built as the top-level project)Catch2 for integration tests
Dependencies
Library |
Version * |
Purpose |
|---|---|---|
libpq |
17 |
PostgreSQL client library |
Catch2 |
3.15 |
Testing framework (tests only) |
Boost::ut |
2.3 |
Testing framework (tests only) |
* Minimum version requirement.
Installing dependencies on Debian/Ubuntu
sudo apt-get install libpq-dev catch2
Boost::ut is fetched via CMake’s FetchContent, so it does not need to be
installed.
Building
git clone https://codeberg.org/perseas/reldbase.git
cd reldbase
cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j$(nproc)
Build targets
Target |
Description |
|---|---|
|
Relational |
|
Database connection and query interface |
|
Unit tests (boost::ut) |
|
Integration tests (Catch2) |
|
Documentation (built by default) |
The unit tests are built as part of the default target. The integration suite requires a local PostgreSQL server and a test database; see Testing.
Using Reldbase from another project
Reldbase is consumed as a CMake subproject. Perseid, for example, pins a known-good commit:
include(FetchContent)
FetchContent_Declare(
reldbase
GIT_REPOSITORY https://codeberg.org/perseas/reldbase.git
GIT_TAG <commit>
)
FetchContent_MakeAvailable(reldbase)
This provides the reldbase::reltypes and reldbase::reldb targets.
When Reldbase is included via add_subdirectory(), its own tests and
documentation are skipped, so only the two libraries are built.
Documentation
The docs target builds the documentation by default.
pip install -r docs/requirements.txt
cmake --build build --target docs
This runs Doxygen to extract API docs, then Sphinx to generate the HTML
site in build/docs/html/.