-1

I installed postgres version 13 from source code using

wget https://ftp.postgresql.org/pub/source/v13.5/postgresql-13.5.tar.gz && tar -xvf postgresql-13.5.tar.gz && rm -f postgresql-13.5.tar.gz

./configure --enable-debug --enable-cassert --prefix=$(pwd) CFLAGS="-ggdb -Og -fno-omit-frame-pointer"

make install

It installed sucessfully and I tried installing AGE using git clone https://github.com/apache/age.git

Then I switched to the branch 1.3.0 using git switch release/PG13/1.3.0

from the AGE directory I set the PG_CONFIG environment variable to the pg_config path using sudo make PG_CONFIG=/home/chidera/bitnine/postgresql-13.5/src/bin/pg_config install

I keep getting this error make: pg_config: Not a directory make: *** No rule to make target 'installcheck'. Stop.

when I run this find / -name pg_config command inside the directory where my postgresql was installed. I get this as a response ./home/chidera/bitnine/postgresql-13.5/src/bin/pg_config

I am using WSL and ubuntu.

Adrian Klaver
  • 15,886
  • 2
  • 17
  • 28
  • Install postgres development files before downloading tar file using `sudo apt install postgresql-server-dev-all`. This error shows that your bin folder does not have the file pg_config. I faced the same error sometime ago and the fix suggested helped. – Zainab Saad Apr 12 '23 at 17:31
  • I think this is probably some WSL-specific defect. Is this WSL1 or WSL2? You should probably add a tag for it. As far as I know, WSL1 is known to be broken for use with PostgreSQL. – jjanes Apr 12 '23 at 20:26

8 Answers8

1

I replicated this error on Ubuntu 22.04 LTS by running the commands you provided in the question, and what worked was removing src/ from the directory that is pointing to PG_CONFIG like this:

sudo make PG_CONFIG=/home/chidera/bitnine/postgresql-13.5/bin/pg_config install

It is also good practice to set the following environment variables after installing PostgreSQL, replacing /path/to/postgres with your PostgreSQL installation directory:

export PATH=/path/to/postgres/bin:$PATH
export PGDATA=/path/to/postgres/bin/data
Carla
  • 326
  • 1
  • 7
0

You need to remove the /pg_config from your path. The correct command should be

sudo make PG_CONFIG=/home/chidera/bitnine/postgresql-13.5/src/bin
  • I did as you stated, but this new error cropped up, make: I: No such file or directory make: [Makefile:125: src/include/parser/cypher_kwlist_d.h] Error 127 (ignored)cc -c -o src/backend/parser/cypher_keywords.o src/backend/parser/cypher_keywords.c src/backend/parser/cypher_keywords.c:25:10: fatal error: postgres.h: No such file or directory 25 | #include "postgres.h" | ^~~~~~~~~~~~ compilation terminated. make: *** [: src/backend/parser/cypher_keywords.o] Error 1 – Chidera Stella Onumajuru Apr 12 '23 at 15:49
  • Yes it seemed i made an error. You do need the `pg_config` an the end of the path. However when you installed postgres and u provided --prefix as a flag, what was the exact path of the $(pwd)? – Panagiotis Foliadis Apr 12 '23 at 16:57
0

While running the ./configure query before postgreSQL installation, specify the base installation directory as pwd(present working directory). It will install your postgreSQL in your custom directory i.e., pwd since you probably have multiple instances of posgreSQL installed.

./configure --prefix=$(pwd) --enable-cassert --enable-debug CFLAGS="-glldb -ggdb -Og -g3 -fno-omit-frame-pointer"

Repeat the next installation steps.

Safi50
  • 379
  • 1
  • 7
0

I think as mentioned above there's a problem with the path youre providing currently for PF-CONFIG. So the first step is to check the path and its correctness, one way to do this is to run the following command

ls /home/chidera/bitnine/postgresql-13.5/src/bin/pg_config

The result of this should be pg-config file. If it doesnt return, then you have the installation again.

However, if the issue still occurs then try to install AGE as follows:

sudo make USE_PGXS=1 PG_CONFIG=/home/chidera/bitnine/postgresql 13.5/src/bin/pg_config install

Hope it helped!

0

I also encountered this error while installing postgresql and I also use WSL Ubuntu.

Firstly, I would advice remove all previous installations using

make clean

And then reconfigure postgresql using

./configure --prefix=$(pwd) --enable-debug --enable-cassert

--prefix specifies where you want to install postgresql, and in this case it will be in the present working directory.

And then reinstall postgresql

gmake; gmake install;

After the installation you should see the bin directory in the pwd, the pg_config file is in the bin directory not in the src/bin directory.

And then you can try running PG_CONFIG again from your Age directory, this time try to use a relative path. Eg;

sudo make PG_CONFIG=../postgresql-13.5/bin/pg_config install

If postgresql and Age are in the same directory. I hope this helps.

0

Installing postgres development files by using this command sudo apt install postgresql-server-dev-all before downloading the tar file as stated earlier by someone helped.

0

follow these commands

make clean 
./configure   
 export PATH=/usr/local/pgsql/bin/:$PATH
    export PGDATA=/usr/local/pgsql/bin/data
make -j8
make install -j8
sudo make PG_CONFIG=/postgresql-12.0/bin/pg_config install

now in age dir

export PATH="$PATH:/home/pg/dist/postgresql-12.0/bin/";
export LD_LIBRARY_PATH="/home/pg/dist/postgresql-12.0/lib/"
make install
0

So i just tried recreating your scenario on my system. kindly confirm the pg_config path. After installing i found two valid pg_config path, using the find command.

The first path being

postgresql-13.5/bin/pg_config

The second path being.

postgresql-13.5/src/bin/pg_config/pg_config

Setting any of the above path as your PG_CONFIG while running make install works for me. So i think the path you're using above is not the full path. Confirm that the pg_config path above is pointing to the pg_config executable file and not a directory, i think that seems to be the problem. The path you used is pointing to a directory not the actual executable file.

Peter
  • 43
  • 4