pramsey / pgsql-ogr-fdw

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

cannot open shared object file #138

Closed onemojofilter closed 7 years ago

onemojofilter commented 7 years ago

Oracle Linux Server release 6.7 gdal-config --version: 2.2.2 psql --version: 9.4.11

contents of test.sql:

CREATE SERVER excel_server
  FOREIGN DATA WRAPPER ogr_fdw
  OPTIONS (
        datasource '/var/lib/pgsql/excel/TESTER.xlsx',
        format 'XLSX' );

$ psql -dtest_db -Upostgres -ftest.sql psql:test.sql:5: ERROR: could not load library "/usr/pgsql-9.4/lib/ogr_fdw.so": libgdal.so.1: cannot open shared object file: No such file or directory

$ ls -al /usr/pgsql-9.4/lib/ogr_fdw.so -rwxr-xr-x. 1 root root 221511 Oct 11 13:07 /usr/pgsql-9.4/lib/ogr_fdw.so

pramsey commented 7 years ago

It's finding your ogr_fdw.so, what it cannot find is your libgdal.so.1. Maybe it's installed in /usr/local/lib and you haven't added that to your /etc/ld.so.conf file?

onemojofilter commented 7 years ago

I was careful to add it. Perhaps I've done it incorrectly?

$ more /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/local/lib
onemojofilter commented 7 years ago

I will re-compile gdal (there was another copy in place prior to this) and make sure it's a clean install and revert back.

pramsey commented 7 years ago

Final step is to run ldconfig as root.

onemojofilter commented 7 years ago

Yes, agreed. I did do that, but it didn't seem to make a difference. I suspect it was linking the wrong copy of gdal. I will recompile gdal and recompile OGR and see what I get.

onemojofilter commented 7 years ago

In the end, that's all it was. Once I did a clean build of GDAL (including freexl and expat) and then recompiled OGR FDW it worked perfectly.

Thank you for your help!