Closed nurey closed 1 year ago
I am getting a similar issue, slightly different error at first though. ./configure
is failing for me with:
configure: error: could not find proj_api.h - you may need to specify the directory of a PROJ.4 installation using --with-projdir
I tried running ./configure
manually from the build directory, it still didn't work. After reviewing config.log
, I discovered that I needed CFLAGS=-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
, which gets past the above error.
After getting past that, and fixing a few other issues (not having GDAL installed, etc.). Then I got your error.
I solved it with this: PG_CPPFLAGS='-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/local/include' CFLAGS='-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H -I/usr/local/include' pex install postgis
Basically, since Homebrew installs proj in /usr/local/include, you need -I/usr/local/include
. And, since the proj-api.h
is deprecated in newer proj versions, you need to pass -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
. And then, finally, the PostGIS build process sometimes will respect CFLAGS
, other steps ignore CFLAGS
but will respect PG_CPPFLAGS
. Not sure why this is, but anyway, passing both will get past your problem.
PS: After a lot of mucking around, I actually got postgis installed with pex, here are my notes in case anyone else encounters any of the same issues: https://gist.github.com/skissane/0487c097872a7f6d0dcc9bcd120c2ccd
I'm trying to install postgis using pex and I'm getting stuck on the error below. Proj is installed from homebrew.
/usr/local/include/proj_api.h
is available.