credativ / informix_fdw

Foreign Data Wrapper for Informix Databases
Other
28 stars 5 forks source link

ifx_fdw.so: undefined symbol: SQLSTATE #3

Closed rossj-cargotel closed 9 years ago

rossj-cargotel commented 9 years ago

I'm testing informix_fdw but I'm getting the following error when I try CREATE EXTENSION.

psql (9.4.1) Type "help" for help.

postgres=# create extension informix_fdw; ERROR: could not load library "/usr/pgsql-9.4/lib/ifx_fdw.so": /usr/pgsql-9.4/lib/ifx_fdw.so: undefined symbol: SQLSTATE

I did a non-root install of the CSDK and no errors were reported.

It also appears that ifx_fdw builds and installs correctly on CentOS 5.11.

[rossj@thoas informix_fdw-master]$ sudo INFORMIXDIR=/home/rossj/informix PATH=/usr/pgsql-9.4:$PATH USE_PGXS=1 make install gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -fpic -I/home/rossj/informix/incl/esql -I. -I./ -I/usr/pgsql-9.4/include/server -I/usr/pgsql-9.4/include/internal -I/usr/include/et -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o ifx_connection.o ifx_connection.c gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -fpic -I/home/rossj/informix/incl/esql -I. -I./ -I/usr/pgsql-9.4/include/server -I/usr/pgsql-9.4/include/internal -I/usr/include/et -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o ifx_conncache.o ifx_conncache.c gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -fpic -I/home/rossj/informix/incl/esql -I. -I./ -I/usr/pgsql-9.4/include/server -I/usr/pgsql-9.4/include/internal -I/usr/include/et -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o ifx_utils.o ifx_utils.c ifx_utils.c:25: warning: ‘ifxPgIntervalQualifierString’ declared ‘static’ but never defined gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -fpic -I/home/rossj/informix/incl/esql -I. -I./ -I/usr/pgsql-9.4/include/server -I/usr/pgsql-9.4/include/internal -I/usr/include/et -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o ifx_conv.o ifx_conv.c gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -fpic -I/home/rossj/informix/incl/esql -I. -I./ -I/usr/pgsql-9.4/include/server -I/usr/pgsql-9.4/include/internal -I/usr/include/et -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o ifx_fdw.o ifx_fdw.c gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -I/usr/include/et -fpic -shared -o ifx_fdw.so ifx_connection.o ifx_conncache.o ifx_utils.o ifx_conv.o ifx_fdw.o -L/usr/pgsql-9.4/lib -L/usr/lib64 -L/home/rossj/informix/lib/ -L/home/rossj/informix/lib/esql /bin/mkdir -p '/usr/pgsql-9.4/lib' /bin/mkdir -p '/usr/pgsql-9.4/share/extension' /bin/mkdir -p '/usr/pgsql-9.4/share/extension' /usr/bin/install -c -m 755 ifx_fdw.so '/usr/pgsql-9.4/lib/ifx_fdw.so' /usr/bin/install -c -m 644 informix_fdw.control '/usr/pgsql-9.4/share/extension/' /usr/bin/install -c -m 644 informix_fdw--1.0.sql '/usr/pgsql-9.4/share/extension/'

I'll be the first to admit I might be doing something wrong on the informix side, but any clues on how to get the extension installed would be greatly appreciated!

Jeff Ross

df7cb commented 9 years ago

Hi Jeff, thanks for the report. I just wanted to let you know that Bernd is currently on vacation so it will probably take a while until you get an answer here. Christoph

rossj-cargotel commented 9 years ago

Thanks--I'll forward to hearing from him when he returns!

Jeff

Jeff Ross rossj@cargotel.com SENDPM

On 5/20/15 8:12 AM, Christoph Berg wrote:

Hi Jeff, thanks for the report. I just wanted to let you know that Bernd is currently on vacation so it will probably take a while until you get an answer here. Christoph

— Reply to this email directly or view it on GitHub https://github.com/credativ/informix_fdw/issues/3#issuecomment-103901375.

The contents of this e-mail and any attachments are intended solely for the use of the named addressee(s) and may contain confidential and/or privileged information. Any unauthorized use, copying, disclosure, or distribution of the contents of this e-mail is strictly prohibited by the sender and may be unlawful. If you are not the intended recipient, please notify the sender immediately and delete this e-mail.

psoo commented 9 years ago

Hi Jeff,

I just got back from my vacation and starting to have a look at it.

An symbol error during CREATE EXTENSION usually means that the dynamic linker is not able to find the shared libraries ifx_fdw.so is linked to. Could you please show the output of the command

ldd /usr/pgsql-9.4/lib/ifx_fdw.so

rossj-cargotel commented 9 years ago

Excellent! I hope you had a great vacation!

And this is perfect timing. I've got an EC2 instance with Ubuntu 14.04 that I'm trying a clean install on.

I've installed the CSDK from this file clientsdk.4.10.FC5DE.LINUX.tar as root into /opt/IBM/informix.

After adding /opt/IBM/informix/bin to my path, informix_fdw builds with the following output:

root@ec2:~/informix_fdw-master# INFORMIXDIR=/opt/IBM/informix USE_PGXS=1 make install Preprocessing Informix ESQL/C sources

Only preprocessing, compilation will be performed later

esql -c ifx_connection.ec gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie -DLINUX_OOM_SCORE_ADJ=0 -fno-omit-frame-pointer -fpic -I/opt/IBM/informix/incl/esql -I. -I./ -I/usr/include/postgresql/9.4/server -I/usr/include/postgresql/internal -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2
-I/usr/include/tcl8.6 -c -o ifx_connection.o ifx_connection.c gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie -DLINUX_OOM_SCORE_ADJ=0 -fno-omit-frame-pointer -fpic -I/opt/IBM/informix/incl/esql -I. -I./ -I/usr/include/postgresql/9.4/server -I/usr/include/postgresql/internal -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2
-I/usr/include/tcl8.6 -c -o ifx_conncache.o ifx_conncache.c gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie -DLINUX_OOM_SCORE_ADJ=0 -fno-omit-frame-pointer -fpic -I/opt/IBM/informix/incl/esql -I. -I./ -I/usr/include/postgresql/9.4/server -I/usr/include/postgresql/internal -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2
-I/usr/include/tcl8.6 -c -o ifx_utils.o ifx_utils.c ifx_utils.c:25:14: warning: ‘ifxPgIntervalQualifierString’ declared ‘static’ but never defined [-Wunused-function] static char *ifxPgIntervalQualifierString(IfxTemporalRange range); ^ gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie -DLINUX_OOM_SCORE_ADJ=0 -fno-omit-frame-pointer -fpic -I/opt/IBM/informix/incl/esql -I. -I./ -I/usr/include/postgresql/9.4/server -I/usr/include/postgresql/internal -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2
-I/usr/include/tcl8.6 -c -o ifx_conv.o ifx_conv.c gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie -DLINUX_OOM_SCORE_ADJ=0 -fno-omit-frame-pointer -fpic -I/opt/IBM/informix/incl/esql -I. -I./ -I/usr/include/postgresql/9.4/server -I/usr/include/postgresql/internal -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2
-I/usr/include/tcl8.6 -c -o ifx_fdw.o ifx_fdw.c gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/mit-krb5 -fPIC -pie -DLINUX_OOM_SCORE_ADJ=0 -fno-omit-frame-pointer -fpic -shared -o ifx_fdw.so ifx_connection.o ifx_conncache.o ifx_utils.o ifx_conv.o ifx_fdw.o -L/usr/lib/x86_64-linux-gnu -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -L/usr/lib/mit-krb5 -L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,--as-needed -Wl,--no-as-needed -lifsql -lifasf -lifgen -lifos -lifgls -lpthread -lm -ldl -lcrypt /opt/IBM/informix/lib/esql/checkapi.o -lifglx -Wl,--as-needed -L/opt/IBM/informix/lib/ -L/opt/IBM/informix/lib/esql /bin/mkdir -p '/usr/lib/postgresql/9.4/lib' /bin/mkdir -p '/usr/share/postgresql/9.4/extension' /bin/mkdir -p '/usr/share/postgresql/9.4/extension' /usr/bin/install -c -m 755 ifx_fdw.so '/usr/lib/postgresql/9.4/lib/ifx_fdw.so' /usr/bin/install -c -m 644 informix_fdw.control '/usr/share/postgresql/9.4/extension/' /usr/bin/install -c -m 644 informix_fdw--1.0.sql '/usr/share/postgresql/9.4/extension/'

CREATE EXTENSION now fails with

postgres@ec2:~$ psql psql (9.4.2) Type "help" for help.

postgres=# create extension informix_fdw; ERROR: could not load library "/usr/lib/postgresql/9.4/lib/ifx_fdw.so": libifsql.so: cannot open shared object file: No such file or directory

The output of ldd is

root@ec2:~/informix_fdw-master# ldd /usr/lib/postgresql/9.4/lib/ifx_fdw.so linux-vdso.so.1 => (0x00007fff3b386000) libifsql.so => not found libifasf.so => not found libifgen.so => not found libifos.so => not found libifgls.so => not found libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f0b1110a000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0b10e04000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f0b10c00000) libcrypt.so.1 => /lib/x86_64-linux-gnu/libcrypt.so.1 (0x00007f0b109c6000) libifglx.so => not found libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0b10601000) /lib64/ld-linux-x86-64.so.2 (0x00007f0b1154a000)

All of the missing library files are in /opt/IBM/informix/lib/esql/.

root@ec2:~/informix_fdw-master# find / -name libifsql.so /opt/IBM/informix/lib/esql/libifsql.so root@ec2:~/informix_fdw-master# find / -name libifasf.so /opt/IBM/informix/lib/libifasf.so root@ec2:~/informix_fdw-master# find / -name libifgen.so /opt/IBM/informix/lib/esql/libifgen.so root@ec2:~/informix_fdw-master# find / -name libifos.so /opt/IBM/informix/lib/esql/libifos.so root@ec2:~/informix_fdw-master# find / -name libifglx.so /opt/IBM/informix/lib/esql/libifglx.so

So you are correct, something is amiss.

Thanks for your help!

Jeff rossj@cargotel.com SENDPM

On 6/9/15 5:03 AM, Bernd Helmle wrote:

Hi Jeff,

I just got back from my vacation and starting to have a look at it.

An symbol error during CREATE EXTENSION usually means that the dynamic linker is not able to find the shared libraries ifx_fdw.so is linked to. Could you please show the output of the command

ldd /usr/pgsql-9.4/lib/ifx_fdw.so

— Reply to this email directly or view it on GitHub https://github.com/credativ/informix_fdw/issues/3#issuecomment-110318926.

The contents of this e-mail and any attachments are intended solely for the use of the named addressee(s) and may contain confidential and/or privileged information. Any unauthorized use, copying, disclosure, or distribution of the contents of this e-mail is strictly prohibited by the sender and may be unlawful. If you are not the intended recipient, please notify the sender immediately and delete this e-mail.

rossj-cargotel commented 9 years ago

Followup: I ran /sbin/ldconfig /opt/IBM/informix/lib /opt/IBM/informix/lib/esql and rebuilt informix_fdw. That enabled the linker to find the missing library files and the extension now builds and installs so I'll be moving on to testing!

Closing this now.

Thanks again!

psoo commented 9 years ago

Jeff,

i've also fixed the compiler warning i've seen in your listings. Let me know if you find more issues.