Error :
Makefile:120: /usr/lib/postgresql/12/lib/pgxs/src/makefiles/pgxs.mk: No such file or directory make: *** No rule to make target '/usr/lib/postgresql/12/lib/pgxs/src/makefiles/pgxs.mk'.
I'm using pgenv
for postgreSQL version management, before I was using PostgreSQL 12 and 13 via pgenv
only and sudo make install
was working.
I wanted to test Apache-AGE on PG14, so I installed PG14 using pgenv build 14.0
.
PostgreSQL server is up and running I've test some queries.
But I'm getting error while installing from source. Error on line 120 in makefile i.e
PG_CONFIG ?= pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
Make file is executing pg_config --pgxs
command to get pgxs
path, and it's getting old pgxs path when we install postgreSQL by conventional method i.e from apt repository.
HOWEVER I'm executing the same command pg_config --pgxs
I'm getting the correct path in terminal
~ pg_config --pgxs
/home/sarthak/pgenv/pgsql-14.0/lib/pgxs/src/makefiles/pgxs.mk
I've tried this command on default shell zsh and bash.
So if it's giving proper path of pgxs, why make file is getting different path on running the same command?
Now I'm getting this error on all postgreSQL version, before which was working on that too.
EDIT: adding output of pg_config
when run from terminal
pg_config ✔ 10.4G
BINDIR = /home/sarthak/pgenv/pgsql-14.0/bin
DOCDIR = /home/sarthak/pgenv/pgsql-14.0/share/doc
HTMLDIR = /home/sarthak/pgenv/pgsql-14.0/share/doc
INCLUDEDIR = /home/sarthak/pgenv/pgsql-14.0/include
PKGINCLUDEDIR = /home/sarthak/pgenv/pgsql-14.0/include
INCLUDEDIR-SERVER = /home/sarthak/pgenv/pgsql-14.0/include/server
LIBDIR = /home/sarthak/pgenv/pgsql-14.0/lib
PKGLIBDIR = /home/sarthak/pgenv/pgsql-14.0/lib
LOCALEDIR = /home/sarthak/pgenv/pgsql-14.0/share/locale
MANDIR = /home/sarthak/pgenv/pgsql-14.0/share/man
SHAREDIR = /home/sarthak/pgenv/pgsql-14.0/share
SYSCONFDIR = /home/sarthak/pgenv/pgsql-14.0/etc
PGXS = /home/sarthak/pgenv/pgsql-14.0/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--prefix=/home/sarthak/pgenv/pgsql-14.0'
CC = gcc
CPPFLAGS = -D_GNU_SOURCE
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing-fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,--as-needed -Wl,-rpath,'/home/sarthak/pgenv/pgsql-14.0/lib',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lz -lreadline -lpthread -lrt -ldl -lm
VERSION = PostgreSQL 14.0