ibarwick / firebird_fdw

A PostgreSQL foreign data wrapper (FDW) for Firebird - latest version 1.4.0 (2024-05-11)
https://sql-info.de/postgresql/firebird-fdw/index.html
Other
36 stars 9 forks source link

Undefined symbol "isc_modify_dpb" #10

Closed FrankIT60 closed 5 years ago

FrankIT60 commented 5 years ago

Hello,

I have compiled and installed on FreeBSD 12 with PG 11.3. When try to activate the fdw extension obtain:

ERROR:  could not load library "/usr/local/lib/postgresql/firebird_fdw.so": dlopen (/usr/local/lib/postgresql/firebird_fdw.so) failed: /usr/local/lib/libfq-0.4.1.so: Undefined symbol "isc_modify_dpb" 

Any idea?

P.S. I use fbsql on the same machine without problem

Thanks Franco

ibarwick commented 5 years ago

How did you compile/install libfq and firebird_fdw?

I have never tested this on FreeBSD, I'll see if I can give it a try in the next couple of days.

FrankIT60 commented 5 years ago

Install firebird25_client from pkg. Create a quick and dirty link for ibase.h

ln -s /usr/local/include/ibase.h /usr/include/ibase.h

then install libfq from source.

After create this link

ln -s /usr/local/include/libfq.h /usr/include/libfq.h
ln -s /usr/local/include/libfq-expbuffer.h /usr/include/libfq-expbuffer.h
ln -s /usr/local/include/readline /usr/include/readline

ln -s /usr/local/lib/libreadline.so /usr/lib/libreadline.so
ln -s /usr/local/lib/libfbclient.so /usr/lib/libfbclient.so
ln -s /usr/local/lib/libfq.so /usr/lib/libfq.so

and install fdw with

gmake USE_PGXS=1 install

For test I have installed fbsql and use it without problem

ibarwick commented 5 years ago

It looks like fbclient wasn't being linked when building libfq in this environment.

I've added an option to specify the fbclient library path (--with-fbclient), so on FreeBSD you should be able to use this invocation to configure the libfq build:

./configure --with-ibase=/usr/local/include/ --with-fbclient=/usr/local/lib

Note you shouldn't need to manually add symlinks; when building firebird_fdw just set the following enviroment variables:

export PG_CPPFLAGS="-I /usr/local/include"
export PG_CPPFLAGS="-I /usr/local/include"

I have tested this on FreeBSD 11 with the firebird25_client from pkg.

FrankIT60 commented 5 years ago

Thanks!!!

now all is ok.

I use csh and set environment with:

setenv PG_CPPFLAGS "-I /usr/local/include"
setenv SHLIB_LINK "-L /usr/local/lib"

and install as root

ibarwick commented 5 years ago

Thanks for the feedback!