#5218 closed defect (invalid)

configure: error: could not find GDAL headers

Reported by: strk Owned by: strk
Priority: blocker Milestone: PostGIS 3.3.0
Component: build Version: master
Keywords: Cc: rouault

Description

After upgrading to Ubuntu 22.04 (jammy):

checking for gdal-config... /usr/local/bin/gdal-config
checking GDAL version... 3.2.2
checking for OGR enabled... yes
checking gdal.h usability... no
checking gdal.h presence... no
checking for gdal.h... no
configure: error: could not find GDAL headers

Dev packages are installed:

# dpkg -l | grep gdal
ii  gdal-data                                                   3.4.1+dfsg-1build4                                                    all          Geospatial Data Abstraction Library - Data files
ii  libgdal-dev                                                 3.4.1+dfsg-1build4                                                    amd64        Geospatial Data Abstraction Library - Development files
ii  libgdal30                                                   3.4.1+dfsg-1build4                                                    amd64        Geospatial Data Abstraction Library

This is with current master branch as of commit [7a08839fcec57b4a9a600b4da7d950589c31b548/git]

Change History (4)

comment:1 by strk, 21 months ago

Maybe #5015 (cirrus-ci) is also due to this, I didn't check

comment:2 by strk, 21 months ago

All stable branches are also affected. The /usr/include/gdal/gdal.h file exists on the system

comment:3 by strk, 21 months ago

Cc: rouault added

It looks like we're basically assuming gdal.h would be in a directory we are passing -I for, but we're not, and gdal-config does not expect us to either.

Rather, gdal expects us to #include <gdal/gdal.h>.

The problem is: since WHICH version of GDAL we need this ? As this sounds like a version-sensitive issue.

comment:4 by strk, 21 months ago

Resolution: invalid
Status: newclosed

Ok the problem was the configure script was picking the wrong gdal-config from /usr/local/bin, so this is invalid.

For the record: the gdal-config was a left-over from a manual make uninstall as the version of GDAL installed on the system (manually) did not have that rule, see https://github.com/OSGeo/gdal/issues/1446

Note: See TracTickets for help on using tickets.