pg_config header files are missing - Postgres 13 - Amazon Linux 2 - Mailing list pgsql-general

From Hasan Marzooq
Subject pg_config header files are missing - Postgres 13 - Amazon Linux 2
Date
Msg-id CANvhf8Jzi_yB3a61X5x809Evm9TTr09ON92eVAHt3x-BrXBZ1g@mail.gmail.com
Whole thread Raw
Responses Re: pg_config header files are missing - Postgres 13 - Amazon Linux 2  (Magnus Hagander <magnus@hagander.net>)
List pgsql-general
Hello!

We've a web application in play framework which uses Postgres 9.6 with plv8 and uuid-ossp extension. We now want to use Postgres 13 instead of 9.6. To achieve this, I'm trying to install Postgres 13 (on the same host where 9.6 is installed) with plv8 and uuid-ossp extension.

PLV8 "make" uses "pg_config" to get the latest version of Postgres (in case multiple Postgres are installed). However, when running "make" with Postgres 13's pg_config, its giving error:

cat: /usr/pgsql-13/include/server/pg_config*.h: No such file or directory

using command: make PG_CONFIG=/usr/pgsql-13/bin/pg_config

I see the header files are missing, in fact there is no "include" folder inside "/usr/pgsql-13/"
--
# ll /usr/pgsql-13
total 16
drwxr-xr-x 2 root root 4096 Dec 29 02:31 bin
drwxr-xr-x 3 root root   23 Dec 29 02:31 doc
drwxr-xr-x 3 root root 4096 Dec 29 02:31 lib
drwxr-xr-x 8 root root 4096 Dec 29 02:31 share
---

Header files (and include folder) do exist in Postgres 9.6's pg_config.

After a bit of research I found that probably installing "postgresql13-devel.x86_64" will install pg_config with headers. However, when installing "postgresql13-devel.x86_64" via yum, it says, 
--
Error: Package: postgresql13-devel-13.5-1PGDG.rhel7.x86_64 (pgdg13)
           Requires: llvm-toolset-7-clang >= 4.0.1
--
I didn't find "llvm-toolset-7-clang" from yum repo, except from the RHEL subscription manager, which is paid for non-dev stuff. So I tried to build llvm-toolset-clang from scratch, but that doesn't solve the problem.

I'm not sure why the header files of Postgres 13's pg_config are missing? It appears pg_config got installed as part of Postgres 13 itself. I'm also not sure if copying 9.6 pg_config header files to 13 is the correct way? 

What would be the next steps here? Please advise.

Some info about host machine: This is Amazon Linux 2
---
# cat /proc/version
Linux version 4.14.256-197.484.amzn2.x86_64 (mockbuild@ip-10-0-37-156) (gcc version 7.3.1 20180712 (Red Hat 7.3.1-13) (GCC)) #1 SMP Tue Nov 30 00:17:50 UTC 2021
---
--
yum list installed | grep -i postgre
postgresql13.x86_64                13.5-1PGDG.rhel7                  @pgdg13
postgresql13-contrib.x86_64        13.5-1PGDG.rhel7                  @pgdg13
postgresql13-libs.x86_64           13.5-1PGDG.rhel7                  @pgdg13
postgresql13-server.x86_64         13.5-1PGDG.rhel7                  @pgdg13
postgresql96.x86_64                9.6.24-1PGDG.rhel6                @pgdg96
postgresql96-contrib.x86_64        9.6.24-1PGDG.rhel6                @pgdg96
postgresql96-devel.x86_64          9.6.24-1PGDG.rhel6                @pgdg96
postgresql96-libs.x86_64           9.6.24-1PGDG.rhel6                @pgdg96
postgresql96-server.x86_64         9.6.24-1PGDG.rhel6                @pgdg96
---

Thanks!
Naqvi










pgsql-general by date:

Previous
From: john polo
Date:
Subject: Re: Find missing data in a column
Next
From: Guillaume Lelarge
Date:
Subject: Re: csv copy error