pramsey / pgsql-ogr-fdw

PostgreSQL foreign data wrapper for OGR
MIT License
237 stars 34 forks source link

make command fails, short how-to for installation could be helpful #236

Closed clustermass closed 2 years ago

clustermass commented 2 years ago

Hello, I am trying to install pgsql-ogr- on fresh Ubuntu server 22.04 I downloaded package, installed Postgresql 14.4, Postgresql dev tool with sudo apt install postgresql-server-dev-14 Installed make utility for Ubuntu But when I run make command in the unpacked directory I am getting this error:

max@linux-playground:/home/db/utils/pgsql-ogr-fdw-1.1.2$ make make: gdal-config: No such file or directory make: gdal-config: No such file or directory gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -I. -I./ -I/usr/include/postgresql/14/server -I/usr/include/postgresql/internal -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2 -c -o ogr_fdw.o ogr_fdw.c In file included from ogr_fdw.h:72, from ogr_fdw.c:40: ogr_fdw_gdal.h:36:10: fatal error: gdal.h: No such file or directory 36 | #include "gdal.h" | ^~~~~~~~ compilation terminated. make: *** [<builtin>: ogr_fdw.o] Error 1

What am I missing here?

clustermass commented 2 years ago

Ok, so for those who is facing the same issue, installing libgdal-dev solved it for me: sudo apt-get installlibgdal-dev``

export CPLUS_INCLUDE_PATH=/usr/include/gdal

export C_INCLUDE_PATH=/usr/include/gdal