Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sagetrac-drkirkby mannequin opened this issue Dec 10, 2009 · 2 comments
Closed

Comments

@sagetrac-drkirkby
Copy link
Mannequin

sagetrac-drkirkby mannequin commented Dec 10, 2009

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.

CC: @dimpase

Component: build

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/7653

@mkoeppe
Copy link
Member

mkoeppe commented Apr 25, 2020

comment:1

outdated, should be closed

@dimpase
Copy link
Member

dimpase commented Apr 26, 2020

Reviewer: Dima Pasechnik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants