6

I'm trying to compile the latest PostGIS 2.1.0 beta and the configure process fails at:

checking GDAL version... 1.10.0
checking for OGR enabled... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking ogr_api.h usability... yes 
checking ogr_api.h presence... yes
checking for ogr_api.h... yes
checking cpl_conv.h usability... yes
checking cpl_conv.h presence... yes
checking for cpl_conv.h... yes
checking for library containing GDALAllRegister... no
configure: error: could not find GDAL

GDAL is installed to the normal /usr, and gdal-config is in my path, and the process still fails if I specify its location when I call ./configure. Configuration works if I specify --without-raster, but none of the PostGIS extensions are built, only the old fasioned .sql files so I can use ALTER EXTENSION to update my PostGIS database. Any ideas?

6
  • How did you install gdal?
    – L_Holcombe
    Commented May 31, 2013 at 1:56
  • Built it myself with the following options: ./configure --prefix=/usr --with-netcdf --with-libtiff --with-sqlite3 \ --with-geotiff --with-mysql --with-python --without-libtool --with-curl \ --with-hdf5 --with-perl --with-geos --with-png \ --with-fgdb=/opt/FileGDB_API Commented May 31, 2013 at 2:16
  • It worked just fine with PostGIS the last time I compiled it, that was a SVN pull of PostGIS Commented May 31, 2013 at 2:17
  • 1
    Have you tried compiling using the -with-gdal-config flag? Example from my system: –with-gdalconfig=/usr/local/bin/gdal-config
    – L_Holcombe
    Commented May 31, 2013 at 3:28
  • Take a minute to look the "config.log", usually you can find the error explained.
    – Taber
    Commented May 31, 2013 at 6:58

1 Answer 1

5

I had this problem and I found out the path to the libraries was missing. To see if something is missing, check the /root/postgis-2.1.0/config.log for hints.

I had traced the following problems while searching for errors in the config.log file by the string 'needed by'.

/usr/bin/ld: warning: libhdf5.so.6, needed by /usr/lib64/libgdal.so, not found
/usr/bin/ld: warning: libpq.so.5, needed by /usr/lib64/libgdal.so, not found
/usr/bin/ld: warning: libhdf5_hl.so.6, needed by /usr/lib64//libnetcdf.so.6

Solution: I searched for their location by searching for the missing files, E.G. find / -name 'libhdf5.so.6' and I found them.

They were in:

/usr/lib64/mpich2/lib/libhdf5.so.6.
/usr/lib64/mpich2/lib/libhdf5_hl.so.6
/opt/postgresql/9.3/lib/libpq.so.5

I simply added the paths to the file /etc/ld.so.conf which now looks like:

include ld.so.conf.d/*.conf
/opt/postgresql/9.3/lib/
/usr/lib64/mpich2/lib/

Then run ldconfig and it all worked!

1
  • My config.log didn't show these info. I had to do ldd on libgdal itself to get the info on the missing libraries. Hope this helps others too!
    – janechii
    Commented May 6, 2015 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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