Re: Cannot recompile C language (330 Views)
Reply
Super Advisor
Wang,MinJie
Posts: 281
Registered: ‎02-14-2006
Message 1 of 11 (330 Views)

Cannot recompile C language

Hi all,
I have a program which could be compiled on PA platform successfully.
Now we need to upgrade the platform and run the program on Itanium platform.
So when I compile it on Itanium it reports the errors that it can't find the library file.
But the library files are actually there and I point the correct directory.
I found that in PA the library files are named like *.sl while in Itanium like *.so
So should I change the source code?
Any advice?
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,953
Registered: ‎03-06-2006
Message 2 of 11 (330 Views)

Re: Cannot recompile C language

While using .sl will still work on IPF, you should change your makefiles to the standard .so suffix.

You also should make sure your have recompiled your shared library for IPF. What does "file lib" show? (You can't use a PA lib.)
Please use plain text.
Valued Contributor
Srimalik
Posts: 436
Registered: ‎11-28-2006
Message 3 of 11 (330 Views)

Re: Cannot recompile C language

>Now we need to upgrade the platform and run >the program on Itanium platform.So when I compile it on Itanium it reports >the errors that it can't find the library file.
abandon all hope, ye who enter here..
Please use plain text.
Valued Contributor
Srimalik
Posts: 436
Registered: ‎11-28-2006
Message 4 of 11 (330 Views)

Re: Cannot recompile C language

>Now we need to upgrade the platform and run the program on Itanium platform.So when I compile it on Itanium it reports the errors that it can't find the library file.

If some performance impact is acceptable you can try running the program under aries.
There is no need to compile for native IA.
abandon all hope, ye who enter here..
Please use plain text.
Honored Contributor
Steven Schweda
Posts: 9,084
Registered: ‎02-23-2005
Message 5 of 11 (330 Views)

Re: Cannot recompile C language

> So should I change the source code?

We can't see "the source code". Perhaps a
psychic would be more helpful.

> Any advice?

Show some actual failing commands, and
provide enough context to reveal what's
happening? (Just a thought.)
Please use plain text.
Super Advisor
Wang,MinJie
Posts: 281
Registered: ‎02-14-2006
Message 6 of 11 (330 Views)

Re: Cannot recompile C language

Hi all

Here is the information in detail. Pls check it out for me.It's compiled based on DB2

************************************
cc -Ae -o MClmCScan cclm_main.o -L/opt/IBM/db2/V8.1/lib64 -lm -L/app/ade/lib/moia -lmoiaap i -ldboper -ldb2 -lC
ld: Can't find library or mismatched ABI for -ldb2 Fatal error.
*** Error exit code 1
************************************



Should I add some option to "cc" command?
Tks in advance
Please use plain text.
Frequent Advisor
Fabien GUTIERREZ
Posts: 65
Registered: ‎01-23-2006
Message 7 of 11 (330 Views)

Re: Cannot recompile C language

ok lets just include on the compile line the option to give the path to your libdb2.so library with a syntax as
-L/the/path/to/my/library
Please use plain text.
Super Advisor
Wang,MinJie
Posts: 281
Registered: ‎02-14-2006
Message 8 of 11 (330 Views)

Re: Cannot recompile C language

Hi Fabien
/opt/IBM/db2/V8.1/lib64 is actually where db2 library files reside.
What should I do?
Tks in advance
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,953
Registered: ‎03-06-2006
Message 9 of 11 (330 Views)

Re: Cannot recompile C language

>cc -Ae -L/opt/IBM/db2/V8.1/lib64 -lm -L/app/ade/lib/moia -lmoiaap i -ldboper -ldb2 -lC

Why do you have a -lC? If you meant -lc, remove it.

>ld: Can't find library or mismatched ABI for -ldb2
>Should I add some option to "cc" command?

Where should libdb2.* be found? You need a -L path as Fabien said.

>/opt/IBM/db2/V8.1/lib64 is actually where db2 library files reside.

What does this show:
file /opt/IBM/db2/V8.1/lib64/libdb2* cclm_main.o

Both files must be the same, either 32 or 64 bit.
Please use plain text.
Super Advisor
Wang,MinJie
Posts: 281
Registered: ‎02-14-2006
Message 10 of 11 (330 Views)

Re: Cannot recompile C language

Hi all
It seams like cclm_main.o is not a 64 bit file
So I recompiled it and ran "cc" again it worked !
Thank you guys,especially Dennis. You enlightened my mind
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,953
Registered: ‎03-06-2006
Message 11 of 11 (330 Views)

Re: Cannot recompile C language

Any reason you are only assigning 1 point to each answer? If you got an answer that solves your problem, you should use a number from 8 to 10.

You can reopen the thread to assign more points:
http://forums.itrc.hp.com/service/forums/helptips.do?#41
http://forums.itrc.hp.com/service/forums/helptips.do?#34
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation