I'm trying to install gdal-1.11.0 on CentOS 6 machine. Following the instructions, this is my config

./configure --prefix /usr/local  --with-fgdb=/usr/local/FileGDB_API --with-pg=/usr/pgsql-9.3/bin/pg_config

As the configure process runs, I see this in the output:

checking for PostgreSQL... yes

However, at the end of the configure output, I see this:

PostgreSQL support:        no

PostgreSQL 9.3 is up and running with postgis on it, the path to pg_config is correct. I know the configure is reading it, because if I put a bad path in --with-pg, it complains... I had prior installs of earlier versions of GDAL, and GDAL 1.11 without postgreSQL before I realized that I need to build it with PostgreSQL support. What am I missing?

  • 4
    Do you have postgresql-devel installed too? – SaultDon Jan 29 '15 at 15:18
  • I do not! Installing it now... – Julia Leder Jan 29 '15 at 15:25
  • 1
    You should post it as an answer and accept it as best answer. Glad you solved your problem! – TurboGraphxBeige Sep 13 '17 at 19:03

I had the same issue on Ubuntu 16.04 and has to install libpq-dev with sudo apt install libpq-dev.


I had similar problems with GDAL 3.0.1 with RHEL 7.x. Here are few notes, if you have problems to compile PostgreSQL Driver:

On 3.0.1 compile parameter for PostgreSQL has been change:

./configure --help | grep Post
  --with-pg=ARG           Include PostgreSQL GDAL/OGR Support (ARG=yes,no)

So, you can't give anymore path to pg_config. GDAL is now relating to pkg-config (rather than pg_config). Note: https://github.com/OSGeo/gdal/issues/1412

For some reason PostgreSQL 11 is installing necessary .pc -files (like libpq.pc) to directory which is unknown by pkg-config (not into /usr/lib64/pkgconfig or /usr/share/pkgconfig)

Before running ./configure, add following enviroment variable:

export PKG_CONFIG_PATH=/usr/pgsql-11/lib/pkgconfig/

Hope this helps somebody somewhere sometime,


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.