Skip to content

Fix build with libpqxx >= 5.1.1

Bram Veenboer requested to merge fix-pqxx into master

Compilation with -BUILD_PACKAGES=Online_Cobalt on a Rocky Linux 8.7 doesn't work, due to a dependency on ancient libpqxx (version 4.0.1 on CentOS 7.6). Rocky Linux 8 (or EPEL) does not provide libpxqq. The library can be installed from source, but the oldest version available is 5.0.0.

With the help of @dijkema, some modifications to the code are made to make compilation with version 5.1.1 work. Version 6.4.8 of libpqxx also works, but version 7.7.4 gives other compiler errors that were not investigated any further. For all cases, libpqxx was built on top of postgres 14.0. Version 9.2.24 (as in CentOS 7.6) also works fine.

The CMake configuration is updated to check whether the detected libpqxx version is in range.

Note that these changes will break compilation on COBALT-2, as no libpqxx version 5.x.x or 6.x.x is (currently) available. Supporting both the 4.x.x and newer APIs in the code seems like a hassle, so maybe we can install a more recent version of libpqxx by hand? Advice from e.g. @mol is needed on how to proceed.

Merge request reports