Operating System - Linux
1748151 Members
3423 Online
108758 Solutions
New Discussion юеВ

Re: Cannot recompile C language

 
Wang,MinJie
Super Advisor

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?
10 REPLIES 10
Dennis Handly
Acclaimed Contributor

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.)
Srimalik
Valued Contributor

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..
Srimalik
Valued Contributor

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..
Steven Schweda
Honored Contributor

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.)
Wang,MinJie
Super Advisor

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
Fabien GUTIERREZ
Frequent Advisor

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
Wang,MinJie
Super Advisor

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
Dennis Handly
Acclaimed Contributor

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.
Wang,MinJie
Super Advisor

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