# 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](testing.md). ## 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 `FetchContent` when 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 ```bash sudo apt-get install libpq-dev catch2 ``` Boost::ut is fetched via CMake's `FetchContent`, so it does not need to be installed. ## Building ```bash 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 | |--------|-------------| | `reltypes` | Relational `attribute` and `reltuple` modules | | `reldb` | Database connection and query interface | | `attribute_test`, `reltuple_test`, `reldb_test` | Unit tests (boost::ut) | | `test_reldb` | Integration tests (Catch2) | | `docs` | 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](testing.md). ## Using Reldbase from another project Reldbase is consumed as a CMake subproject. Perseid, for example, pins a known-good commit: ```cmake include(FetchContent) FetchContent_Declare( reldbase GIT_REPOSITORY https://codeberg.org/perseas/reldbase.git GIT_TAG ) 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. ```bash 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/`.