sun toolset buggy and outdated?

I'm trying to test the new Oracle-solaris compiler but I'm running into Boost.Build issues. First off what looks like a bug, if I build with with b2 stdlib=native Then I *still* get stlport You can easily reproduce this on another platform with: cd libs/config/test ../../../b2 config_info toolset=sun stdlib=native -n -d2 which yields: sun.compile.c++ ..\..\..\bin.v2\libs\config\test\config_info.test\sun\debug\stdlib-sun-stlport\config_info.obj "CC" +d -library=stlport4 -g -erroff=%none -KPIC -DBOOST_ALL_NO_LIB=1 -I"..\..\.." -c -o "..\..\..\bin.v2\libs\config\test\config_info.test\sun\debug\stdlib-sun-stlport\config_info.obj" "config_info.cpp" Now for the outdated part: the oracle compiler (12.4) now supports three std lib options: 1) The default - I can't make this work in C++03 mode, but it's the only option that does work in C++11 mode (where it appears to be a recent GNU libstdc++ version). 2) STLPort - only works in C++03 mode. 3) Apache - only works in C++03 mode. So ideally we would probably have: stdlib=stlport, sets -library=stlport4 for both compile and link. stdlib=apache, sets -library=stdcxx4 for both compile and link stdlib=native, sets -std=c++11 for both compile and link. And yes I realise we're mixing up two different features here, but as they can't be mixed and matched anyway it at least gets things working. I guess the toolset should be renamed either "oracle" or "solaris" as well? If anyone has any ideas how to patch the toolset, I have a working virtual machine to test on (or you can do as I did and download a pre-build VirtualBox machine). Thanks in advance, John.

John Maddock wrote:
For a fact-check, including what the default is, you might find this interesting: http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4c69ec6f SolarisStudio: Use alternative standard library to build CMake. Thanks, Steve.

On 28/02/2015 12:39, Stephen Kelly wrote:
For the record, as of Solaris Studio 12.4 there are 4 options: * C++03 mode, default std lib - a broken Rogue Wave version, this is the default. * C++03 mode, STLport. Requires -library=stlport4 * C++03 mode, Apache std lib. Requires -library=stdcxx4 * C++11 mode, GNU libstdc++, used when -std=c++11 is passed to the compiler. John.

On 28/02/2015 13:04, Peter Dimov wrote:
Ah, I missed that one. And I see the -library, -std and -compat command line options are all mutually incompatible and do slightly different things... just to keep us on our toes I guess! I'll update the PR for the toolset accordingly. Thanks, John.

On 2/28/2015 12:34 PM, John Maddock wrote:
I have tried to get Solaris Studio 12.4 to compile/link in -std=c++11 mode but have never succeeded. There was a change to the top-level Boost Jamroot which had to be made, and which Steve Watanabe made in the 'develop' super-project, which was removing the lines there which hard-coded the stdlib for sun: # The standard library Sun compilers use by default has no chance # of working with Boost. Override it. <toolset>sun:<stdlib>sun-stlport Even after removing this if I compiled using -std=c++11 the compile went OK but as soon as it tried to link it was obviously not finding the standard library, even though I had libstdc++ installed under Linux. I still received linking errors of:
showing it could not find the standard library shared library as far as I can make out. Has anyone got this working with Sun ( now Oracle ) C++ on Linux ? Does this need anything else from Boost in order to tell the compiler which library to link with ? I have asked on the appropriate Oracle forum but I thought I would mention it here in case anyone has got this working.

Steven is correct - you need to pass -std=c++11 (or whatever) to the linker as well as the compiler. Note that this is much improved in Git develop where the sun toolset now has inbuilt features for the various std lib's see https://github.com/boostorg/build/commit/259f7f7a96eed7ffb9f8a10f555b7aaa6f7.... Unfortunately for C++ 11 mode you still need to add an explicit -std=c++11 via cxxflags :( HTH, John.
participants (5)
-
Edward Diener
-
John Maddock
-
Peter Dimov
-
Stephen Kelly
-
Steven Watanabe