Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make fails with Postgresql 11 on Ubuntu 18.04 #34

Closed
adamjforster opened this issue Jun 18, 2020 · 4 comments
Closed

Make fails with Postgresql 11 on Ubuntu 18.04 #34

adamjforster opened this issue Jun 18, 2020 · 4 comments

Comments

@adamjforster
Copy link

When trying to build master (0be3a4c) with Postgresql 11 on Ubuntu 18.04 make fails because it can't find postgres_ext.h. Here are the commands that I'm using:

$ su -
# git clone https://github.com/cybertec-postgresql/pg_squeeze.git /usr/local/src/pg_squeeze
# which pg_config
/usr/bin/pg_config
# export PG_CONFIG="/usr/bin/pg_config"
# cd pg_squeeze/
# make
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -I. -I./ -I/usr/include/postgresql/11/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o pg_squeeze.o pg_squeeze.c
In file included from pg_squeeze.h:12:0,
                 from pg_squeeze.c:10:
/usr/include/postgresql/internal/c.h:49:10: fatal error: postgres_ext.h: No such file or directory
 #include "postgres_ext.h"
          ^~~~~~~~~~~~~~~~
compilation terminated.
<builtin>: recipe for target 'pg_squeeze.o' failed
make: *** [pg_squeeze.o] Error 1

I can confirm that postgres_ext.h exists on the filesystem:

# locate postgres_ext.h
/usr/include/postgresql/postgres_ext.h

And that pg_config defines INCLUDEDIR correctly:

# pg_config
BINDIR = /usr/lib/postgresql/11/bin
DOCDIR = /usr/share/doc/postgresql-doc-11
HTMLDIR = /usr/share/doc/postgresql-doc-11
INCLUDEDIR = /usr/include/postgresql
PKGINCLUDEDIR = /usr/include/postgresql
INCLUDEDIR-SERVER = /usr/include/postgresql/11/server
LIBDIR = /usr/lib/x86_64-linux-gnu
PKGLIBDIR = /usr/lib/postgresql/11/lib
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/postgresql/11/man
SHAREDIR = /usr/share/postgresql/11
SYSCONFDIR = /etc/postgresql-common
PGXS = /usr/lib/postgresql/11/lib/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=/usr/include' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-silent-rules' '--libdir=/usr/lib/x86_64-linux-gnu' '--libexecdir=/usr/lib/x86_64-linux-gnu' '--disable-maintainer-mode' '--disable-dependency-tracking' '--with-icu' '--with-tcl' '--with-perl' '--with-python' '--with-pam' '--with-openssl' '--with-libxml' '--with-libxslt' 'PYTHON=/usr/bin/python3' '--mandir=/usr/share/postgresql/11/man' '--docdir=/usr/share/doc/postgresql-doc-11' '--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/' '--datadir=/usr/share/postgresql/11' '--bindir=/usr/lib/postgresql/11/bin' '--libdir=/usr/lib/x86_64-linux-gnu/' '--libexecdir=/usr/lib/postgresql/' '--includedir=/usr/include/postgresql/' '--with-extra-version= (Ubuntu 11.8-1.pgdg18.04+1)' '--enable-nls' '--enable-integer-datetimes' '--enable-thread-safety' '--enable-tap-tests' '--enable-debug' '--enable-dtrace' '--disable-rpath' '--with-uuid=e2fs' '--with-gnu-ld' '--with-pgport=5432' '--with-system-tzdata=/usr/share/zoneinfo' '--with-llvm' 'LLVM_CONFIG=/usr/bin/llvm-config-6.0' 'CLANG=/usr/bin/clang-6.0' '--with-systemd' '--with-selinux' 'MKDIR_P=/bin/mkdir -p' 'TAR=/bin/tar' 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now' '--with-gssapi' '--with-ldap' '--with-includes=/usr/include/mit-krb5' '--with-libs=/usr/lib/mit-krb5' '--with-libs=/usr/lib/x86_64-linux-gnu/mit-krb5' 'build_alias=x86_64-linux-gnu' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security'
CC = gcc
CPPFLAGS = -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include/mit-krb5
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer
CFLAGS_SL = -fPIC
LDFLAGS = -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -L/usr/lib/llvm-6.0/lib -L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,--as-needed
LDFLAGS_EX = 
LDFLAGS_SL = 
LIBS = -lpgcommon -lpgport -lpthread -lselinux -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz -ledit -lrt -lcrypt -ldl -lm 
VERSION = PostgreSQL 11.8 (Ubuntu 11.8-1.pgdg18.04+1)

Can you please help?

@kmoppel
Copy link
Contributor

kmoppel commented Jun 19, 2020

Just an idea - it could have something to do with going "root" so I'd try with a normal user or postgres user.

@adamjforster
Copy link
Author

@kmoppel thank you for the suggestion but I get exactly the same result with both my user and the postgres user.

@ahouska
Copy link
Contributor

ahouska commented Jun 23, 2020

Other extensions can be built? I wonder if you have the postgresql11-devel package installed.

@adamjforster
Copy link
Author

Other extensions can be built? I wonder if you have the postgresql11-devel package installed.

Thank you @ahouska . It should have been obvious to me but the package name was non-standard:

$ sudo apt install postgresql-server-dev-11

Make completes without error now. Thank you both for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants