pramsey/pgsql-postal

postal.c:46:10: fatal error: 'libpostal/libpostal.h' file not found

Closed this issue · 5 comments

desoi commented
postal.c:46:10: fatal error: 'libpostal/libpostal.h' file not found
desoi commented

I adjusted the makefile as suggested but kept getting a not found error for the header file. Verified it was where it was supposed to be. After looking at pg_config, I changed "CFLAGS" to "CFLAGS_SL" on the line below and everything worked as expected. Not sure if this is my issue, a Mac issue, or a newer Postgres version issue, but I thought I would report it in case it is a new problem. I'm running Postgres 10.6 on macOS 10.14.

CFLAGS_SL += -I$(POSTAL_INCLUDE)

Thanks. Since that variable seems to be available as far back as 9.6, I just took your change directly.

I still got this error under mingw64 when building for windows (PG 11 and PG12) even after fixing the paths in the makefile.

Instead of changing the makefile script, I did this instead which worked

export REL_LIBPOSTAL_PATH=/projects/libpostal/rel-libpostal
make SHLIB_LINK="-L${REL_LIBPOSTAL_PATH}/lib -lpostgres -lpgport -lpostal" CFLAGS="-I. -I${REL_LIBPOSTAL_PATH}/include"
make install

That's really weird, frankly (but aren't all things on windows) since shlib_link shouldn't come into play until link time and at that point nobody cares about include files...

robe2 commented

Well would you believe I had two problems.

First was the include couldn't be found -- that was taken care of by the CFLAGS

Then I had the issue with failed compile at link time, that was take care of by the SHLIB_LINK I think.

I checked my paths twice in the make file to make sure I got it right, I don't rule out

Was what I initially tried in the makefile
/projects/libpostal/rel-libpostal/lib
/projects/libpostal/rel-libpostal/include

As far as I could tell looking at the gcc generated, I think maybe the pgxs was stripping it as it seemed it didn't have any of that stuff in there. I can give it another try if you are so interested, but I figure I'd rather mess with my make call than a makefile script which I may lose if I regit clone. A bit more portable.