powa-team/pg_stat_kcache

unable to use it on pg11 beta3

Closed this issue · 9 comments

When will it be usable on PG11? I get errors trying to use it on pg 11 beta 3, but it installs fine on pg10.
pgxn install pg_stat_kcache --pg_config /usr/pgsql-11/bin/pg_config

INFO: best version: pg_stat_kcache 2.1.1
INFO: saving /tmp/tmpdx5LMc/pg_stat_kcache-2.1.1.zip
INFO: unpacking: /tmp/tmpdx5LMc/pg_stat_kcache-2.1.1.zip
INFO: building extension
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o pg_stat_kcache.o pg_stat_kcache.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -shared -o pg_stat_kcache.so pg_stat_kcache.o -L/usr/pgsql-11/lib  -Wl,--as-needed -L/usr/lib64/llvm5.0/lib  -L/usr/lib64 -Wl,--as-needed -Wl,-rpath,'/usr/pgsql-11/lib',--enable-new-dtags
/opt/rh/llvm-toolset-7/root/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2  -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include -flto=thin -emit-llvm -c -o pg_stat_kcache.bc pg_stat_kcache.c
gmake: /opt/rh/llvm-toolset-7/root/usr/bin/clang: Command not found
gmake: *** [pg_stat_kcache.bc] Error 127
ERROR: command returned 2: gmake PG_CONFIG=/usr/pgsql-11/bin/pg_config all
df7cb commented

If your PG11 was built --with-llvm aka JIT support, you need clang installed to build extension modules. This isn't stat_kcache's fault, it's how extensions are built in general. In this case, you need to install /opt/rh/llvm-toolset-7/root/usr/bin/clang to proceed.

You may want to leave issues open for a day or 2 just so we can make additional comments on open issues.

I would suggest that you add this information to the installation section, since everybody is going to have to install clang since I downloaded the binary beta3 for pg 11, so I expect the official binaries would also need to do this later. Just a suggestion. Will test this tomorrow just to make sure there are no other issues and will add another comment tomorrow.

rjuju commented

Wouldn't the same problem occur with any extension compile against pg11? That's indeed quite a problem, but this would need to be documented in postgres if that's not already present rather than in all extensions :(. As far as powa's extensions are concerned, the official binaries are the one provided by apt.postgresql.org and yum.postgresql.org, which should deal with this dependency.

This extension should be compatible with pg 11. I just tried and I didn't notice any issue (I have clang available though).

df7cb commented

It's a general issue, not specific to pg_stat_kcache.
On Debian, clang/llvm-dev is automatically pulled in if you install the necessary postgresql-server-dev-11 package. The yum.pg.o rpms should hopefully do that as well.

df7cb commented

FWIW, you can get away by passing CLANG=true to make:

$ make CLANG=true
$ make -k install CLANG=true

Please reopen this issue again until I get it resolved, thanks in advance.

Clang is not installed with the pg dev package for pg 11 beta 3 on CentOS 7. I was able to install it since I have the extra repos enabled: yum install clang. But I still have problems accessing it when i try to install again.

pgxn install pg_stat_kcache --pg_config /usr/pgsql-11/bin/pg_config
INFO: best version: pg_stat_kcache 2.1.1
INFO: saving /tmp/tmptzjkGW/pg_stat_kcache-2.1.1.zip
INFO: unpacking: /tmp/tmptzjkGW/pg_stat_kcache-2.1.1.zip
INFO: building extension
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o pg_stat_kcache.o pg_stat_kcache.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -shared -o pg_stat_kcache.so pg_stat_kcache.o -L/usr/pgsql-11/lib  -Wl,--as-needed -L/usr/lib64/llvm5.0/lib  -L/usr/lib64 -Wl,--as-needed -Wl,-rpath,'/usr/pgsql-11/lib',--enable-new-dtags
/opt/rh/llvm-toolset-7/root/usr/bin/clang -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2  -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include -flto=thin -emit-llvm -c -o pg_stat_kcache.bc pg_stat_kcache.c
gmake: /opt/rh/llvm-toolset-7/root/usr/bin/clang: Command not found
gmake: *** [pg_stat_kcache.bc] Error 127
ERROR: command returned 2: gmake PG_CONFIG=/usr/pgsql-11/bin/pg_config all

df7cb commented

Try make CLANG=/path/to/your/clang. (This is an issue with PG11 on Centos, not a pg_stat_kcache issue.)

Hi @MichaelDBA
Maybe you've already solved this but FWIW I encountered the same issue when trying to build hostname. Installing the packages llvm5.0 devtoolset-7 llvm-toolset-7 listed by theory here resolved the issue for me.

well, the CentOS 7 distro now has pg_stat_kcache, so the issue is moot now. I will install it via the package instead of via PGXN.