Opened 11 years ago

Closed 8 months ago

#7653 closed defect (invalid)

Ensure that C++ libraries linked are ISO standard with commerical compilers

Reported by: drkirkby Owned by: GeorgSWeber
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: build Keywords:
Cc: dimpase Merged in:
Authors: Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

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

-library=stlport4

Further details can be found on the Sun web site at

http://developers.sun.com/solaris/articles/cmp_stlport_libCstd.html

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.

http://docs.hp.com/en/14487/faq.htm

Like the Sun compiler, the HP compiler defaults to an older C++ library standard. The option to enable the latest standard is

-AA

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.

Change History (3)

comment:1 Changed 9 months ago by mkoeppe

  • Cc dimpase added
  • Milestone set to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

outdated, should be closed

comment:2 Changed 9 months ago by dimpase

  • Reviewers set to Dima Pasechnik
  • Status changed from needs_review to positive_review

comment:3 Changed 8 months ago by chapoton

  • Resolution set to invalid
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.