Thread: cannot find PGXS file when installing an extension?

cannot find PGXS file when installing an extension?

From
Luca Ferrari
Date:
I'm using 11.0 on FreeBSD:

testdb=> select version();
                                                 version
---------------------------------------------------------------------------------------------------------
 PostgreSQL 11.0 on x86_64-unknown-freebsd11.1, compiled by gcc
(FreeBSD Ports Collection) 6.4.0, 64-bit

I've a very basic extension made by my own:

cleopatra% ls
Makefile        fluca--1.0.sql  fluca.control

cleopatra% cat Makefile
EXTENSION = fluca
DATA = fluca--1.0.sql

PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)

but when I launch make I got an error about a "cannot find" on the
line of the include directive:

cleopatra% sudo make install
make: "/usr/home/luca/tmp/fluca/Makefile" line 6: Could not find
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/home/luca/tmp/fluca


but seems to me everything is in place:

cleopatra% pg_config --pgxs
/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk


I've then tried to force the inclusion of the file adding it to the Makefile:

cleopatra% cat Makefile
EXTENSION = fluca
DATA = fluca--1.0.sql

PG_CONFIG = pg_config
include /opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk


which produces a verbose error output:

cleopatra% sudo make install
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 63:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 64:
Need an operator
make: Unknown modifier ' '
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 65:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 66:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 67:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 70:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 44:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 49:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 51:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 52:
Missing dependency operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 55:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 58:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 59:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 60:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 65:
Missing dependency operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 68:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 72:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 73:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 93:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 105:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 106:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 108:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 109:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 112:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 113:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 115:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 116:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 121:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 122:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 124:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 125:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 130:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 131:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 133:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 134:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 139:
Need an operator


What am I missing here?

Thanks,
Luca


Re: cannot find PGXS file when installing an extension?

From
Pavel Luzanov
Date:
Luca,

'sudo make install' command works in the environment of the superuser and most likely does not see
pg_config utility .

Specify the location of pg_config explicitly:
sudo make install PG_CONFIG=/opt/pg11/bin/pg_config
-----
Pavel Luzanov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
On 02.11.2018 14:17, Luca Ferrari wrote:
I'm using 11.0 on FreeBSD:

testdb=> select version();                                                version
---------------------------------------------------------------------------------------------------------PostgreSQL 11.0 on x86_64-unknown-freebsd11.1, compiled by gcc
(FreeBSD Ports Collection) 6.4.0, 64-bit

I've a very basic extension made by my own:

cleopatra% ls
Makefile        fluca--1.0.sql  fluca.control

cleopatra% cat Makefile
EXTENSION = fluca
DATA = fluca--1.0.sql

PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)

but when I launch make I got an error about a "cannot find" on the
line of the include directive:

cleopatra% sudo make install
make: "/usr/home/luca/tmp/fluca/Makefile" line 6: Could not find
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/home/luca/tmp/fluca


but seems to me everything is in place:

cleopatra% pg_config --pgxs
/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk


I've then tried to force the inclusion of the file adding it to the Makefile:

cleopatra% cat Makefile
EXTENSION = fluca
DATA = fluca--1.0.sql

PG_CONFIG = pg_config
include /opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk


which produces a verbose error output:

cleopatra% sudo make install
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 63:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 64:
Need an operator
make: Unknown modifier ' '
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 65:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 66:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 67:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/makefiles/pgxs.mk" line 70:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 44:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 49:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 51:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 52:
Missing dependency operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 55:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 58:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 59:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 60:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 65:
Missing dependency operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 68:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 72:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 73:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 93:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 105:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 106:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 108:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 109:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 112:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 113:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 115:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 116:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 121:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 122:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 124:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 125:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 130:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 131:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 133:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 134:
Need an operator
make: "/opt/pg11/lib/postgresql/pgxs/src/Makefile.global" line 139:
Need an operator


What am I missing here?

Thanks,
Luca


Re: cannot find PGXS file when installing an extension?

From
Luca Ferrari
Date:
On Fri, Nov 2, 2018 at 12:46 PM Pavel Luzanov <p.luzanov@postgrespro.ru> wrote:
>
> Luca,
>
> 'sudo make install' command works in the environment of the superuser and most likely does not see pg_config utility
.
>
> Specify the location of pg_config explicitly:
> sudo make install PG_CONFIG=/opt/pg11/bin/pg_config

No, it's not a path problem since I'm unable to run make even with my user:

cleopatra% which pg_config && make
/opt/pg11/bin/pg_config
make: "/usr/home/luca/tmp/fluca/Makefile" line 5: Could not find
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/home/luca/tmp/fluca


By the way:

cleopatra% sudo make install PG_CONFIG=/opt/pg11/bin/pg_config
Password:
make: "/usr/home/luca/tmp/fluca/Makefile" line 5: Could not find
make: Fatal errors encountered -- cannot continue
make: stopped in /usr/home/luca/tmp/fluca


Any other idea?
Thanks,
Luca


Re: cannot find PGXS file when installing an extension?

From
Luca Ferrari
Date:
On Fri, Nov 2, 2018 at 1:16 PM Luca Ferrari <fluca1978@gmail.com> wrote:
>
> On Fri, Nov 2, 2018 at 12:46 PM Pavel Luzanov <p.luzanov@postgrespro.ru> wrote:
> >
> > Luca,
> >
> > 'sudo make install' command works in the environment of the superuser and most likely does not see pg_config
utility.
 
> >
> > Specify the location of pg_config explicitly:
> > sudo make install PG_CONFIG=/opt/pg11/bin/pg_config
>
> No, it's not a path problem since I'm unable to run make even with my user:
>
> cleopatra% which pg_config && make
> /opt/pg11/bin/pg_config
> make: "/usr/home/luca/tmp/fluca/Makefile" line 5: Could not find
> make: Fatal errors encountered -- cannot continue
> make: stopped in /usr/home/luca/tmp/fluca
>

Shame on me!
I need to run 'gmake' on FreeBSD.
Sorry for the noise.

Luca