orthanc-postgresql plugin does not build for Postgresql 11.4 (PostgreSQL_TYPE_INCLUDE_DIR)

Hi,

when building the postgres plugin for Tumbleweed there is an issue with some variables:

[ 2s] – The C compiler identification is GNU 9.1.1
[ 3s] – The CXX compiler identification is GNU 9.1.1
[ 3s] – Check for working C compiler: /var/lib/build/ccache/bin/cc
[ 3s] – Check for working C compiler: /var/lib/build/ccache/bin/cc – works
[ 3s] – Detecting C compiler ABI info
[ 3s] – Detecting C compiler ABI info - done
[ 3s] – Detecting C compile features
[ 3s] – Detecting C compile features - done
[ 3s] – Check for working CXX compiler: /var/lib/build/ccache/bin/c++
[ 3s] – Check for working CXX compiler: /var/lib/build/ccache/bin/c++ – works
[ 3s] – Detecting CXX compiler ABI info
[ 3s] – Detecting CXX compiler ABI info - done
[ 3s] – Detecting CXX compile features
[ 4s] – Detecting CXX compile features - done
[ 4s] – Found PythonInterp: /usr/bin/python3.7 (found version “3.7.3”)
[ 4s] – Found OpenSSL: /usr/lib64/libcrypto.so (found version “1.1.1c”)
[ 4s] – Found ZLIB: /usr/lib64/libz.so (found version “1.2.11”)
[ 4s] – Found GTest: /usr/lib64/libgtest.so
[ 4s] JsonCpp include dir: /usr/include
[ 4s] – Looking for C++ include /usr/include/json/reader.h
[ 4s] – Looking for C++ include /usr/include/json/reader.h - found
[ 4s] JsonCpp major version: 1
[ 4s] Switching to C++11 standard in gcc/clang, as version of JsonCpp is >= 1.0.0
[ 4s] – Looking for uuid/uuid.h
[ 4s] – Looking for uuid/uuid.h - found
[ 4s] – Looking for uuid_generate_random in /usr/lib64/libuuid.so
[ 4s] – Looking for uuid_generate_random in /usr/lib64/libuuid.so - found
[ 4s] – Boost version: 1.69.0
[ 4s] – Found Threads: TRUE
[ 4s] – Boost version: 1.69.0
[ 4s] – Found the following Boost libraries:
[ 4s] – filesystem
[ 4s] – thread
[ 4s] – system
[ 4s] – date_time
[ 4s] – regex
[ 4s] – chrono
[ 4s] – Could NOT find PostgreSQL (missing: PostgreSQL_TYPE_INCLUDE_DIR) (found version “11.4”)
[ 4s] – Looking for C++ include orthanc/OrthancCDatabasePlugin.h
[ 5s] – Looking for C++ include orthanc/OrthancCDatabasePlugin.h - found
[ 5s] Setting the version of the libraries to 3.2
[ 5s] CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
[ 5s] Please set them or make sure they are set and tested correctly in the CMake files:
[ 5s] PostgreSQL_TYPE_INCLUDE_DIR (ADVANCED)
[ 5s] used as include directory in directory /home/abuild/rpmbuild/BUILD/OrthancPostgreSQL-3.2/PostgreSQL

For older versions of Postgres, as used in Leap, this compiles fine. and yes, postgresql-devel is installed…

Any ideas?
Axel

Hi Axel,

[ 4s] – Could NOT find PostgreSQL (missing: PostgreSQL_TYPE_INCLUDE_DIR) (found version “11.4”) […]

[ 5s] CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
[ 5s] Please set them or make sure they are set and tested correctly in the CMake files:
[ 5s] PostgreSQL_TYPE_INCLUDE_DIR (ADVANCED)
[ 5s] used as include directory in directory /home/abuild/rpmbuild/BUILD/OrthancPostgreSQL-3.2/PostgreSQL

For older versions of Postgres, as used in Leap, this compiles fine. and yes, postgresql-devel is installed…

This issue looks like the following problem:
https://book.orthanc-server.com/plugins/postgresql.html#dynamic-linking-on-other-gnu-linux-distributions

Have you tried adding “11.4” to the variable “PostgreSQL_ADDITIONAL_VERSIONS”?

HTH,
Sébastien-

Hi Sebastien

Hello Axel,

I managed to build the PostgreSQL plugin in Tumbleweed using the Docker scripts attached to this mail.

HTH,
Sébastien-

build-postgresql.sh (428 Bytes)

Dockerfile (1.16 KB)

My bad. As pointed out by Axel, my Dockerfile uses an incorrect version of PostgreSQL (it was that for Leap 15.1).

Anyway, compilation works with the attached updated Docker scripts.

HTH,
Sébastien-

build-postgresql.sh (444 Bytes)

Dockerfile (999 Bytes)

I have it building in between as well! Postgres 11.4 needed only postgres-devel, 11.5 on Tumbleweed needs postgres-server-devel as well…

Thanks
Axel