On Saturday 24 March 2007 11:05, Jerry Feldman wrote:
On Sat, 24 Mar 2007 10:22:31 +0100
"Verdi March" <cincaipatron@gmx.net> wrote:
Hi,
Is it safe to link an application against libraries compiled with a different compiler? For example, to compile Linpack using gcc, and then to link with static libraries (libacml_mp.a and libmpich.a) compiled with PGI.
My presumption is that it is safe to do so, since objects/libraries in Linux (SLES9) must follow a certain format (ELF?). But with my shallow knowledge in compilers, it's better to ask to this list.
In general, yes you can. Many times companies send libraries compiled with a different compiler. There are caveats, of course. The main thing is that the libraries you link against have the same APIs that are included in the associated header files. You've also got to be careful about is system calls and api changes between libraries.
Naturally, the APIs must be consistent, but that's pretty much a given. Actually, it is the ABI (Application Binary Interface), which defines how functions / subroutines are called, parameters are passed and results returned, that governs compiler compatibility. A bit of cursory searching on the Internet suggests that these compilers are in fact compatible and used together by some users. Randall Schulz --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-programming+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-programming+help@opensuse.org