powa-team/pg_stat_kcache

make: "/postgres_extensions/pg_stat_kcache/Makefile" line 26: Could not find

fahadshery opened this issue · 3 comments

Hi,

Trying to install this on FreeBSD.

git clone https://github.com/powa-team/pg_stat_kcache.git
cd pg_stat_kcache
make

getting the following error:

make: "/postgres_extensions/pg_stat_kcache/Makefile" line 26: Could not find
make: Fatal errors encountered -- cannot continue
make: stopped in /postgres_extensions/pg_stat_kcache

My pg_config executes and displays the following:

BINDIR = /usr/local/bin
DOCDIR = /usr/local/share/doc/postgresql
HTMLDIR = /usr/local/share/doc/postgresql
INCLUDEDIR = /usr/local/include
PKGINCLUDEDIR = /usr/local/include/postgresql
INCLUDEDIR-SERVER = /usr/local/include/postgresql/server
LIBDIR = /usr/local/lib
PKGLIBDIR = /usr/local/lib/postgresql
LOCALEDIR = /usr/local/share/locale
MANDIR = /usr/local/man
SHAREDIR = /usr/local/share/postgresql
SYSCONFDIR = /usr/local/etc/postgresql
PGXS = /usr/local/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE =  '--with-libraries=/usr/local/lib' '--with-includes=/usr/local/include' '--enable-thread-safety' '--disable-debug' '--without-gssapi' '--enable-nls' '--without-pam' '--with-openssl' '--prefix=/usr/local' '--localstatedir=/var' '--mandir=/usr/local/man' '--infodir=/usr/local/share/info/' '--build=amd64-portbld-freebsd12.2' 'build_alias=amd64-portbld-freebsd12.2' 'CC=cc' 'CFLAGS=-O2 -pipe  -fstack-protector-strong -fno-strict-aliasing ' 'LDFLAGS= -L/usr/local/lib -lpthread -L/usr/local/lib  -fstack-protector-strong ' 'LIBS=' 'CPPFLAGS=-I/usr/local/include' 'CXX=c++' 'CXXFLAGS=-O2 -pipe -fstack-protector-strong -fno-strict-aliasing  ' 'CPP=cpp' 'PKG_CONFIG=pkgconf' 'LDFLAGS_SL='
CC = cc
CPPFLAGS = -I/usr/local/include -I/usr/local/include -I/usr/local/include
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing
CFLAGS_SL = -fPIC -DPIC
LDFLAGS = -L/usr/local/lib -lpthread -L/usr/local/lib -fstack-protector-strong -L/usr/local/lib -Wl,--as-needed -Wl,-R'/usr/local/lib'
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lintl -lssl -lcrypto -lz -lreadline -lexecinfo -lm
VERSION = PostgreSQL 14.1
rjuju commented

Hi,

I'm a bit curious about this line:

make: "/postgres_extensions/pg_stat_kcache/Makefile" line 26: Could not find

there's no indication of what wasn't found? Line 26 is the include of pxs, is the file /usr/local/lib/postgresql/pgxs/src/makefiles/pgxs.mk present and readable? Is your make the BSD one or GNU make? I think that postgres is only compatible with GNU make.

there's no indication of what wasn't found? Line 26 is the include of pxs, is the file /usr/local/lib/postgresql/pgxs/src/makefiles/pgxs.mk present and readable?

yes, the file is available:

/usr/local/lib/postgresql/pgxs/src/makefiles # ls -la
total 9
-rw-r--r--  1 root  wheel  14768 Jan 14 04:33 pgxs.mk

Is your make the BSD one or GNU make? I think that postgres is only compatible with GNU make.

I am using:

gmake -v
GNU Make 4.3
Built for amd64-portbld-freebsd12.2
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Hi,

I was able to install using gmake. So pkg install gmake done the trick:

git clone https://github.com/powa-team/pg_stat_kcache.git
cd pg_stat_kcache/
gmake
gmake install
/bin/mkdir -p '/usr/local/lib/postgresql'
/bin/mkdir -p '/usr/local/share/postgresql/extension'
/bin/mkdir -p '/usr/local/share/postgresql/extension'
/usr/bin/install -c -m 755  pg_stat_kcache.so '/usr/local/lib/postgresql/pg_stat_kcache.so'
/usr/bin/install -c -m 644 .//pg_stat_kcache.control '/usr/local/share/postgresql/extension/'
/usr/bin/install -c -m 644 .//pg_stat_kcache--2.1.0--2.1.1.sql .//pg_stat_kcache--2.1.0.sql .//pg_stat_kcache--2.1.1--2.1.2.sql .//pg_stat_kcache--2.1.1.sql .//pg_stat_kcache--2.1.2--2.1.3.sql .//pg_stat_kcache--2.1.2.sql .//pg_stat_kcache--2.1.3--2.2.0.sql .//pg_stat_kcache--2.1.3.sql .//pg_stat_kcache--2.2.0.sql  '/usr/local/share/postgresql/extension/'

then load using:

cd /var/db/postgres/data14/
vi postgresql.conf
shared_preload_libraries = 'pg_stat_kcache'
service postgresql restart

verify by:

su postgres
psql
select * from pg_available_extensions;

should be listed now.
Now simply load within PostgreSQL using:

CREATE EXTENSION pg_stat_kcache