pramsey / pgsql-postal

PostgreSQL binding for libpostal
MIT License
138 stars 20 forks source link

Building on RHEL 6 Fails #3

Closed wbuchanan closed 8 years ago

wbuchanan commented 8 years ago

Edited the variables in the Makefile:

POSTAL_INCLUDE = /usr/local/include/libpostal
POSTAL_LIBS = /usr/local/lib

Ran make install as a regular user:

[WilliamB@....]$ make install
/bin/mkdir -p '/usr/pgsql-9.5/lib'
/bin/mkdir -p '/usr/pgsql-9.5/share/extension'
/bin/mkdir -p '/usr/pgsql-9.5/share/extension'
/usr/bin/install -c -m 755  postal.so '/usr/pgsql-9.5/bin/lib/postal.so'
/usr/bin/install: cannot remove '/usr/pgsql-9.5/lib/postal.so': Permission denied
make: *** [install-lib-shared] Error 1

Ran the same thing with sudo:

[WilliamB@....]$ sudo make install
/bin/mkdir -p '/usr/pgsql-9.5/lib'
/bin/mkdir -p '/usr/pgsql-9.5/share/extension'
/bin/mkdir -p '/usr/pgsql-9.5/share/extension'
/usr/bin/install -c -m 755  postal.so '/usr/pgsql-9.5/bin/lib/postal.so'
/usr/bin/install -c -m 644  .//postal.control '/usr/pgsql-9.5/share/extension'
/usr/bin/install -c -m 644  .//postal--1.0.sql '/usr/pgsql-9.5/share/extension'

Connected to the db and then building the extension failed:

[WilliamB@....]$ psql
geocoder=# CREATE EXTENSION postal;
ERROR: could not load library "/usr/pgsql-9.5/lib/postal.so": libpostal.so.0: cannot open shared object file: No such file or directory

The file does exist there and is readable. Not sure how to diagnose things further. This will be a huge help in the K-12 education sector where the quality of address data is fairly bad to preprocess things a bit before using the PostGIS Tiger geocoder.

pramsey commented 8 years ago

You're almost there.

To fix the problem, you need to tell Linux that there are useful things in /usr/local/lib it might want. Probably the fastest solution is, as root, to do:

echo /usr/local/lib > /etc/ld.so.conf.d/local.conf
/sbin/ldconfig

Check the contents of /etc/ld.so.conf.d and make sure I'm getting things right from memory in terms of file names, etc, but that should work.

wbuchanan commented 8 years ago

@pramsey awesome. We did some comparisons between PostGIS Tiger Geocoder and the service provided by ESRI in ArcGIS and had about 300 or so differences out of ~125k addresses. Given that the address data we have is so messy, I imagine this will help to get a lot more addresses geocoded. Thanks again.

geor-g commented 7 years ago

Thanks @pramsey ! Much appreciated!