skip to Main Content

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.

2

Answers


  1. PG_CONFIG is not the path to makefiles. It is path to the bin folder where all the binaries are.

    Try changing the value of PG_CONFIG using:

    export PG_CONFIG=/path/to/postgres/14/bin
    
    Login or Signup to reply.
  2. You should run

     pgenv config write 14.0 && pgenv config edit 14.0
    

    adjust ‘configure’ and ‘make’ options and flags and run build again

    You can read more about configuring pgevn build here.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search