Operating System - HP-UX
1753675 Members
5347 Online
108799 Solutions
New Discussion юеВ

64/32 bits problem compiling with Oracle libraries

 
SOLVED
Go to solution
Lorenzo del R├нo
Occasional Advisor

64/32 bits problem compiling with Oracle libraries

Hello all:

I have the following setup:
$ uname -a
HP-UX HPSPPS3W B.11.00 U 9000/861 2004611039 unlimited-user license

Oracle 9.2.0

When I try to compile a very simple program using the proC compiler I got the error:
$ aCC -L$ORACLE_HOME/lib -lclntsh cprograma2.c
/usr/ccs/bin/ld: /icb/oracle9/app/oracle/product/9.2.0/lib/libclntsh.sl: Mismatched ABI. 64-bit PA shared library found in 32-bit l.

If I do the same but 32 bits libraries from Oracle it works fine:
$ aCC -L$ORACLE_HOME/lib32 -lclntsh cprograma2.c
$ a.out

Connected to ORACLE as user: IC

Cosa leida : 0x400012e8
Have a nice day!

But if I try to force 64 bit compilation its compile/link OK but I get the following error:
$ aCC +DD64 -L$ORACLE_HOME/lib -lclntsh cprograma2.c
$ a.out
Bus error(coredump)

I would like the program working in 64 bits, or at least understand why is compiling but not working properly.

Could anyone help, please?

Thank you very much.
7 REPLIES 7
Mel Burslan
Honored Contributor

Re: 64/32 bits problem compiling with Oracle libraries

first of all, are you sure that your OS is installed as 64 bits. To check, issue command:

getconf KERNEL_BITS

then, if this verifies to be 64 bits, are you sure you have the oracle 64 bit binaries installed on your server.
________________________________
UNIX because I majored in cryptology...
Lorenzo del R├нo
Occasional Advisor

Re: 64/32 bits problem compiling with Oracle libraries

getconf KERNEL_BITS
64

Regarding the Oracle executables as far as I knos Oracle 9.2.0 is only distributed in 64 bit version.
64 bits Libraries are in lib and 32 bit libraries are in lib32

Thank you for your prompt response.

Lorenzo.
Mel Burslan
Honored Contributor

Re: 64/32 bits problem compiling with Oracle libraries

I am not an expert on compiling C programs and less experienced in oracle but it seems like your library (I am not sure which version) is corrupted or someone inadvertantly copied a 32 bit library over 64 bit library or the other way around.

I am not sure what the solution would be in short of reinstalling oracle.
________________________________
UNIX because I majored in cryptology...
Lorenzo del R├нo
Occasional Advisor

Re: 64/32 bits problem compiling with Oracle libraries

I have checked the Oracle libraries in 32 and 64 bits and at least they differ.

Do you know how or where may I check the aCC libraries that may be in use? How do I know if a library is 36/64 bits?

Also I have read something about 32/64 bits versions of the aCC compiler. Could this have something to do with the problem? I guess that may be 32 bits version of the compiler are distributed with older operating systems and that on 11.0/64 bits the compiler version should be 64 bits but I am not sure.
Do you know any way to know the bits of the compiler version?
The compiler is:
what /opt/aCC/bin/aCC
/opt/aCC/bin/aCC:
$Revision: 92453-07 linker linker crt0.o B.11.16.01 030316 $
HP aC++ B3910B A.03.55
HP aC++ B3910B X.03.37.01 Language Support Library
$

Thank you.
Navin Bhat_2
Trusted Contributor

Re: 64/32 bits problem compiling with Oracle libraries

What are your
LD_LIBRARY_PATH and SHLIB_PATH set to?
Navin Bhat_2
Trusted Contributor
Solution

Re: 64/32 bits problem compiling with Oracle libraries

Here is something that I got from oracle. May help you.
PROBLEM
=======

When you try to relink cppdemo1 sample proc program
under $ORACLE_HOME/precomp/demo/proc
make -f demo_proc.mk cppdemo1

you get the following error

exit error code 1
libclntsh.sl mismatched ABI 64 bit pa risc
shared library found in 32 bit link


SOLUTION
=========

step 1
-------
under $ORACLE_HOME/precomp/demo/proc
edit demo_proc.mk

step 2
-------
Under " include env_precomp.mk " statement
insert the following line:
CC=aCC +DA2.0w

step 3
-------
change the cppbuild and cppbuild_static targets
from:
...
cppbuild:
$(PROC) $(PROCPPFLAGS) iname=$(EXE)
CC -c $(INCLUDE) $(EXE).c
CC -o $(EXE) $(OBJS) -L$(LIBHOME) $(CPPLDLIBS)
cppbuild_static:
$(PROC) $(PROCPPFLAGS) iname=$(EXE)
CC -c $(INCLUDE) $(EXE).c
CC -o $(EXE) $(OBJS) -L$(LIBHOME) $(STATICCPPLDLIBS)

to

cppbuild:
$(PROC) $(PROCPPFLAGS) iname=$(EXE)
$(CC) -c $(INCLUDE) $(EXE).c
$(CC) -o $(EXE) $(OBJS) -L$(LIBHOME) $(CPPLDLIBS)
cppbuild_static:
$(PROC) $(PROCPPFLAGS) iname=$(EXE)
$(CC) -c $(INCLUDE) $(EXE).c
$(CC) -o $(EXE) $(OBJS) -L$(LIBHOME) $(STATICCPPLDLIBS)

That is
from
.... CC ....
to
....$(CC) ....
Lorenzo del R├нo
Occasional Advisor

Re: 64/32 bits problem compiling with Oracle libraries

They are:
$ echo $LD_LIBRARY_PATH
/icb/oracle9/app/oracle/product/9.2.0/lib:/lib:/usr/lib:/icb/oracle9/app/oracle/product/9.2.0
$ echo $SHLIB_PATH
ORACLE_HOME/lib32:/icb/oracle9/app/oracle/product/9.2.0/rdbms/lib32

However I have managed to use the demo makefile that cames with Oracle instad of trying to do the compilation directly through command line and it works, so I consider closed the case.

I appreciate sincerely your help and interest.