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

can't enable postgres support #1657

Closed
sebalaini opened this issue Jun 18, 2019 · 4 comments
Closed

can't enable postgres support #1657

sebalaini opened this issue Jun 18, 2019 · 4 comments

Comments

@sebalaini
Copy link

I'm trying to install Gdal 3.0 in Centos 7 with:

  • Geos 3.7
  • Proj 6.1
  • Gdal 3.0
  • PostGis 2.5
  • PostgreSQL 10

for some reason if I run ./configure -with-pg=/usr/pgsql-10/bin/pg_config it completely ignore the check for PostgreSQL

check for PostgreSQL... NO
PostgreSQL support: NO

How can I enable the PostgreSQL support in Gdal 3.0?

@sebalaini sebalaini changed the title cannot enable postgres support can't enable postgres support Jun 18, 2019
@rouault
Copy link
Member

rouault commented Jun 18, 2019

In GDAL 3.0, --with-pg supported values are only yes/no. You need to install the postgresql client lib, and pkg-config (pkg-config --modversion libpq must return the libpq version)

@sebalaini
Copy link
Author

I've installed posgresql10/server/devel/contrib but it doesn't work, what exactly is libpq? I'm on Centos 7.
is libpq coming from PG or is a separate library?

@rouault
Copy link
Member

rouault commented Jun 19, 2019

libpq is the postgresql client library that GDAL needs to link against. I'd expect it to be provided by a package named "postgresql-devel" or something approaching (depends on from which repository you get your postgresql). Like https://rpmfind.net/linux/RPM/centos/7.6.1810/x86_64/Packages/postgresql-devel-9.2.24-1.el7_5.x86_64.html
But looking at the list of files of that one it doesn't seem they provide pkg-config support...
An alternative is then to use the ./configure PQ_CFLAGS and PQ_LIBS option
This might be something like the following (but this is a completely blind guess, so check that the directory pointed by PQ_CFLAGS contains libpq-fe.h, and that the directory pointed by PQ_LIBS contains libpq.so. That might perhaps be /usr/pgsql-10/lib64)

./configure PQ_CFLAGS="-I/usr/pgsql-10/include" PQ_LIBS="-L/usr/pgsql-10/lib -lpq" --with-pg

If there is a /usr/pgsql-10/lib/pkgconfig/libpq.pc, you might also try

PKG_CONFIG_PATH=/usr/pgsql-10/lib/pkgconfig ./configure --with-pg

@sebalaini
Copy link
Author

i was actually checking for libpq.so in the server and I found it in usr/pgsql-10/lib/libpq.so .

I haven't run the make and make install yet but your last solution seems to work.

PKG_CONFIG_PATH=/usr/pgsql-10/lib/pkgconfig ./configure --with-pg

it say PostgreSQL support: yes

Thanks.

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

2 participants