pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Travis Allison <travisallison@gmail.com>
To: pgsql-general@postgresql.org
Subject: Re: What generates pg_config.h?
Date: Fri, 5 Jan 2018 10:24:57 -0800
Message-ID: <59902831-ba5d-6fb9-8db8-a074c08e8106@aklaver.com> (raw)
In-Reply-To: <CAEJ64tZN99gU+1VaGjUJa8zEQia61GRhZGD-1DXjoC7jgQt2OQ@mail.gmail.com>
References: <CAEJ64tZN99gU+1VaGjUJa8zEQia61GRhZGD-1DXjoC7jgQt2OQ@mail.gmail.com>

On 01/05/2018 09:07 AM, Travis Allison wrote:
> Hi,
> 
> I have postgres 9.5 and 9.6 installed.  pg_config points to 9.6.
> I am trying to compile a postgresql plugin (Timescaledb).  I am getting 
> an error:
> -----------------------------------------------
> /usr/include/postgresql/pg_config.h:733:0: warning: "PACKAGE_VERSION" 
> redefined
>   #define PACKAGE_VERSION "10.0"
>   ^
> In file included from /usr/include/postgresql/9.6/server/c.h:53:0,
>                   from /usr/include/postgresql/9.6/server/postgres.h:47,
>                   from /mnt/data/timescaledb/src/init.c:1:
> /usr/include/postgresql/9.6/server/pg_config.h:740:0: note: this is the 
> location of the previous definition
>   #define PACKAGE_VERSION "9.6.5"
> -----------------------------------------------------
> 
> The command pg_config gives the following:
> 
> ---------------------------------------
> BINDIR = /usr/lib/postgresql/9.6/bin
> DOCDIR = /usr/share/doc/postgresql-doc-9.6
> HTMLDIR = /usr/share/doc/postgresql-doc-9.6
> INCLUDEDIR = /usr/include/postgresql
> PKGINCLUDEDIR = /usr/include/postgresql
> INCLUDEDIR-SERVER = /usr/include/postgresql/9.6/server
> LIBDIR = /usr/lib/x86_64-linux-gnu
> PKGLIBDIR = /usr/lib/postgresql/9.6/lib
> LOCALEDIR = /usr/share/locale
> MANDIR = /usr/share/postgresql/9.6/man
> SHAREDIR = /usr/share/postgresql/9.6
> SYSCONFDIR = /etc/postgresql-common
> PGXS = /usr/lib/postgresql/9.6/lib/pgxs/src/makefiles/pgxs.mk 
> <http://pgxs.mk;
> CONFIGURE = '--with-tcl' '--with-perl' '--with-python' '--with-pam' 
> '--with-openssl' '--with-libxml' '--with-libxslt' 
> '--with-tclconfig=/usr/lib/x86_64-linux-gnu/tcl8.6' 
> '--with-includes=/usr/include/tcl8.6' 'PYTHON=/usr/bin/python' 
> '--mandir=/usr/share/postgresql/9.6/man' 
> '--docdir=/usr/share/doc/postgresql-doc-9.6' 
> '--sysconfdir=/etc/postgresql-common' '--datarootdir=/usr/share/' 
> '--datadir=/usr/share/postgresql/9.6' 
> '--bindir=/usr/lib/postgresql/9.6/bin' 
> '--libdir=/usr/lib/x86_64-linux-gnu/' 
> '--libexecdir=/usr/lib/postgresql/' 
> '--includedir=/usr/include/postgresql/' '--enable-nls' 
> '--enable-integer-datetimes' '--enable-thread-safety' 
> '--enable-tap-tests' '--enable-debug' '--disable-rpath' 
> '--with-uuid=e2fs' '--with-gnu-ld' '--with-pgport=5432' 
> '--with-system-tzdata=/usr/share/zoneinfo' '--with-systemd' 'CFLAGS=-g 
> -O2 -fstack-protector-strong -Wformat -Werror=format-security -fPIC -pie 
> -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' '--with-selinux' 
> 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'
> CC = gcc
> CPPFLAGS = -DFRONTEND -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 -g -g -O2 -fstack-protector-strong -Wformat 
> -Werror=format-security -fPIC -pie -fno-omit-frame-pointer
> CFLAGS_SL = -fPIC
> LDFLAGS = -L../../src/common -Wl,-Bsymbolic-functions -Wl,-z,relro 
> -Wl,-z,now -L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,--as-needed
> LDFLAGS_EX =
> LDFLAGS_SL =
> LIBS = -lpgcommon -lpgport -lselinux -lxslt -lxml2 -lpam -lssl -lcrypto 
> -lgssapi_krb5 -lz -ledit -lrt -lcrypt -ldl -lm
> VERSION = PostgreSQL 9.6.5
> -------------------------------------------------
> 
> So my question is: what is generating the 
> /usr/include/postgresql/pg_config.h file?  Why is it different than the 
> /usr/include/postgresql/9.6/server/pg_config.h file?

I am guessing you have some part of Postgres 10 installed. During the 
build the extension is getting to /usr/include/postgresql/pg_config.h 
before it gets to /usr/include/postgresql/9.6/server/pg_config.h.  Crank 
up your package manager and see what your distro has installed? Along 
that line knowing what distro and version you are using as well as how 
you installed Postgres 9.5 and 9.6 would be helpful.

> 
> Thanks!
> 
> Travis


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (18+ messages)  latest in thread

Message-ID: <59902831-ba5d-6fb9-8db8-a074c08e8106@aklaver.com>
Permalink:  ../59902831-ba5d-6fb9-8db8-a074c08e8106@aklaver.com/
Also on:    postgresql.org/message-id/59902831-ba5d-6fb9-8db8-a074c08e8106@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, travisallison@gmail.com
  Subject: Re: What generates pg_config.h?
  In-Reply-To: <59902831-ba5d-6fb9-8db8-a074c08e8106@aklaver.com>
  References: <CAEJ64tZN99gU+1VaGjUJa8zEQia61GRhZGD-1DXjoC7jgQt2OQ@mail.gmail.com> <59902831-ba5d-6fb9-8db8-a074c08e8106@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox