• No replies
1 Post

Pinned topic C++11 standard library support (Linux, BlueGene/Q).

‏2013-05-14T21:52:22Z | std

Dear all, I wonder if IBM ships C++11 standard library with xlc?

I am trying to compile a simple test program:


#include <iostream>

#include <tuple>

int main ()


  std::tuple<int,char> foo (10,'x');


  std::cout << "foo contains: ";

  std::cout << std::get<0>(foo) << ' ';

  std::cout << std::get<1>(foo) << '\n';

  return 0;


I try to compile it like this:


$ xlC tmp.cpp -qlanglvl=extended0x
"/usr/lib/gcc/ppc64-redhat- linux/4.4.7/../../../../ include/c++/4.4.7/c++0x_ warning.h", line 31.2: 1540-0859 (S) #error directive: This file requires compiler and library support for the upcoming
ISO C++ standard, C++0x. This support is currently experimental, and must be
enabled with the -std=c++0x or -std=gnu++0x compiler options..
it looks like the standard library (I assume it's gnu) is not aware of the c++11 features of xlC and prevents successful compilation. Do you know any way to fix this? Does IBM ships it's own version of standard library?


  • Michael_Wong
    29 Posts

    Re: C++11 standard library support (Linux, BlueGene/Q).


    Hi Anton, we do not ship a C++ Std Library on Linux/BG for the xlC compiler. By default, we have always used the GNU supplied C++ library.

    We have been working with the GNU C++ Std library changes and when you enable extended0x, it does enable all our C++0x features. However, GNU still protects their C++11 code with __GXX_EXPERIMENTAL_CXX0X__

    Turning this on will not work becuse we have been working on some of the compiler erorrs that will show up when you just turn this on. Some of these are our own compiler errors and some of these are GNU coding errors, even though it passes with GNU. Each one of these will need that we have to work through before tuples ad iostream can be fully supported.


    Right now, I suspect the biggest problem you will see will be from intantiation erros from iostream such as  

    __gnu_cxx::__stoa" is not declared

    We will continue to work on these and if you would like, please connect with me by email and be notified when this is working. Thanks again.