[ZBX-11964] Compilation with Oracle DB and --enable-static does not work Created: 2017 Mar 24  Updated: 2019 May 24  Resolved: 2019 May 24

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 3.2.4
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Michael P Assignee: Unassigned
Resolution: Won't fix Votes: 0
Labels: compilation, oracle, server, static
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hi
I am not xet 100% sure if its related to zabbix or if I am not using gcc correctly, but maybe someone can point me into the right direction if so.

I try:

./configure --prefix=/ --enable-static --enable-server --with-oracle-include=/usr/include/oracle/12.2/client64 --with-oracle-lib=/usr/lib/oracle/12.2/client64/lib/ --with-net-snmp --with-libcurl --with-openipmi --with-ssh2 --with-libxml2 --enable-ipv6 --enable-java --with-unixodbc --with-ldap --with-openssl --with-iconv

I Installed the following oracle products (derived from: http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html):
oracle-instantclient12.2-basic
oracle-instantclient12.2-devel
oracle-instantclient12.2-sqlplus

Files are in the provided path, and ./configure says "checking if static linking is possible... yes"

But it stops right after (config.log):

...
checking for the linux kernel version... unknown family (4.4.0-66-generic)
checking size of void *... 8
checking if static linking is possible... yes
checking for Oracle OCI headers in /usr/include/oracle/12.2/client64... yes
checking if Oracle OCI version is >= 10.0... yes
checking for Oracle OCI version >= 10.x to use -lnnz1x flag... -lnnz12
checking for Oracle OCI libraries in /usr/lib/oracle/12.2/client64/lib/... not found
checking for Oracle support... no
configure: error: Oracle OCI library not found

Config log reveals:

configure:7721: checking if static linking is possible
configure:7734: gcc -o conftest -g -O2  -rdynamic -L/usr/lib/oracle/12.2/client64/lib/ -static conftest.c -lm -ldl  -lresolv >&5
configure:7734: $? = 0
configure:7735: result: yes
configure:8362: checking for Oracle OCI headers in /usr/include/oracle/12.2/client64
configure:8389: gcc -c -g -O2  -I/usr/include/oracle/12.2/client64 conftest.c >&5
configure:8389: $? = 0
configure:8398: result: yes
configure:8430: checking if Oracle OCI version is >= 10.0
configure:8447: result: yes
configure:8465: checking for Oracle OCI version >= 10.x to use -lnnz1x flag
configure:8471: result: -lnnz12
configure:8481: checking for Oracle OCI libraries in /usr/lib/oracle/12.2/client64/lib/
configure:8501: gcc -o conftest -g -O2  -I/usr/include/oracle/12.2/client64 -rdynamic -L/usr/lib/oracle/12.2/client64/lib/ -static -L/usr/lib/oracle/12.2/client64/lib/ conftest.c -lm -ldl  -lresolv -lclntsh -lnnz12 >&5
/usr/bin/ld: cannot find -lclntsh
/usr/bin/ld: cannot find -lnnz12
collect2: error: ld returned 1 exit status
configure:8501: $? = 1
root@tmon11:~/zabbix-3.2.4# ld -L/usr/lib/oracle/12.2/client64/lib/ -lclntsh -lnnz12
ld: warning: cannot find entry symbol _start; not setting start address
root@tmon11:~/zabbix-3.2.4# ld -lclntsh -lnnz12
ld: cannot find -lnnz12
ld: cannot find -lclntsh
root@tmon11:~/zabbix-3.2.4# ldconfig -p | grep clntsh
        libclntshcore.so.12.1 (libc6,x86-64) => /usr/lib/oracle/12.2/client64/lib/libclntshcore.so.12.1
        libclntshcore.so (libc6,x86-64) => /usr/lib/oracle/12.2/client64/lib/libclntshcore.so
        libclntsh.so.12.1 (libc6,x86-64) => /usr/lib/oracle/12.2/client64/lib/libclntsh.so.12.1
        libclntsh.so (libc6,x86-64) => /usr/lib/oracle/12.2/client64/lib/libclntsh.so

I even copied the files to /usr/local/lib/, but nothing changed.
ld has no problem what so ever...

Compilation without --enable-static works, but I want to keep dependencies low on remote systems.

Can anybody help?


Generated at Fri Mar 29 10:01:00 EET 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.