Ticket #7653 (new defect)
Opened 3 years ago
Ensure that C++ libraries linked are ISO standard with commerical compilers
|Reported by:||drkirkby||Owned by:||GeorgSWeber|
Several C++ compilers from commercial vendors (Sun and HP being two examples I am aware of), created C++ libraries based on an older version of the C++ standard. This is incompatible with the current standard, so both HP and Sun ship two libraries - one for backward compatibility, the other which implements the last ISO standard, but at the expense of backward compatibility.
In contrast, g++ only uses on library.
Sun take their usual attitude of ensuring Solaris is backward compatible, so by default their C++ compiler uses a library which does not conform to the latest C++ standard. Alexander Dreyer has found that the magic switch to get Sun Studio to use the latest C++ library is
Further details can be found on the Sun web site at
Looking at the HP C++ compiler for HP-UX, I see that it too has two C++ libraries - one for backward compatibility, one for latest C++ conformance.
Like the Sun compiler, the HP compiler defaults to an older C++ library standard. The option to enable the latest standard is
In both cases, the same library must be used for all objects - you can't mix them.
Hence at some point, all code in Sage that uses C++ must have the appropriate option to C++ compiler to use the latest libraries, if it is to be built with Sun Studio or any other compiler which ships with two libraries.
I would invisage creating individual trac tickets for each package which uses C++. The sensible option it to add this flag to a CXXFLAGS and hope all packages respect CXXFLAGS. In practice, this will not happen, so many will require changes to ensure they do respect flags from a global CXX flags.