Date: Fri, 6 Jun 2003 09:18:39 -0700 (PDT)
From: "Ian Veach"
To: sunmanagers@sunmanagers.org

Subject: SUMMARY: apps and libraries built with Forte AND gcc (mixed)


Thanks to: Casper Dik, Roy S. Rapoport, Lars Hecking, Dennis, David M., David Foster, Octave Orgeron


=========================
a) Can I mix code [C or C++] and libraries compiled with different compilers (e.g. Forte cc and GCC)?


Yes and no. :) Everyone said yes you could with C (although "linking gcc compiled object files may require linking with the gcc runtime (e.g., may require linking using gcc)"). Also note that there are definite exceptions to this rule - a longstanding one is perl (all modules and perl, excepting obvious system binaries pre-compiled with Forte), which by many accounts MUST be compiled with the same compiler.


It was confirmed that C++ is a firm no, however:


"C++ is a whole different matter; no, it is not possible (not even between versions of GNU C++, Forte tends to support compatibility for some time) No C++ ABI has been defined. You may get away mixing modules compiled with different C++ compiler as long as the different compilers are self-contained; symbol clashes may cause linking failures, though"


Also:


"It shouldn't make any difference unless high-end performance is an issue. We run a mix of stuff compiled here with gcc (2.9.5, 3.X) and with forte (6.2)."


=========================
b) Can I mix 64 bit and 32 bit code and libraries?


No. The man pages for ld indicate this, actually. Apparently the linker "determines the "bitness" of an executable from the first object it encounters and bombs on the first mismatch." LIBPATH is set to EITHER /usr/lib or /usr/lib/64 accordingly.


=========================
c) Does anyone have evidence (performance, etc.) of why using cc (Forte version 5 or 6) to compile something would be better than gcc


Answers wholly in the yes category. "I think there's plenty of evidence, especially when it comes to FP code."


"gcc is not optimized for 64-bit code"


=========================
d) Does anyone have good pointers to a document on these concepts and how they apply to Solaris? I haven't found much google.


no answers


=========================
Other info:


"Forte ...definitely does *compile* faster"


"The latest Forte compilers support more GNUisms and also C++ comments (and more of C99 constructs)."


"Building "non-standard code" with Forte can be a problem sometimes with non-portable code (or non-Solaris Forte code :) ). These compiler options can be useful:


-w   Suppress compiler warning messages


-Xa Compile assuming ANSI C conformance, allow K & R extensions (default mode)


-Xc Compile assuming strict ANSI C conformance


-Xs  Compile assuming (pre-ANSI) K & R C style code


-Xt  Compile assuming K & R conformance, allow ANSI C


Hopefully you've learned how to compile software, you have some insights on how software works, and maybe some tips on what to do when things go wrong.


There is no magic to any of this stuff, just a lot of hard work.


Thanks to other web sites for information that was used in preparing these web pages.


alan pae



This Web Site Copyright © 1997 - 2008
by Alan Pae - All Rights Reserved