Attempt to install and test the libc++ failing rather catastrophically

Hi – I tried to follow the instructions here (http://libcxx.llvm.org/) to install libc++, but the tests fail, and trying to compile with libc++ fails (on a project that works without).
I should add that I’m rather a n00b, sorry.
Some of the output I’m getting from the tests is here: https://gist.github.com/1039586
That’s from the tail end of the output, sorry – I left it running in screen.
I can run it again and redirect it to a file, if that could help.
Could it be that I need to include more files into the compilation of libc++?
I use /usr/local/lib and /usr/local/include for quite a bit of stuff (like Boost).
Anyway, any help & all advice will be very gratefully received.
Thanks,
Doug.

You can significantly improve the test score by adding "-U__STRICT_ANSI__" to the command line for the tests. This can be done with the following command prior to executing testit:

$ export OPTIONS="-std=c++0x -stdlib=libc++ -U__STRICT_ANSI__"

I've added this information to the libc++ website (sorry it wasn't there before).

You will still get failures due to unimplemented C++0x features, but not nearly as many as without
-U__STRICT_ANSI__. This is a temporary workaround due to a conflict between clang and the OS X headers.

With this fix, and clang version 2.9, I'm getting:

Cheers for that – does that mean that I shouldn’t really be expecting to compile working programs with libc++ at the moment?
Or should I pass that to my build of the library, too?
& thanks for the reply.
Doug.

Cheers for that -- does that mean that I shouldn't really be expecting to compile working programs with libc++ at the moment?

libc++ is approximately 98-99% complete. If you're having problems with it, I would appreciate the feedback so that we can address problems. The header <atomic> is known to be completely broken at the moment. There is compiler work that needs to be done to bring it online.

Or should I pass that to my build of the library, too?
& thanks for the reply.

If you're seeing errors on Mac 10.6 like:

/usr/include/c++/v1/cmath:1243:9: error: no member named 'llrint' in the global namespace
using ::llrint;
      ~~^

Then there are two known ways to fix it:

1. Drop -std=c++0x
2. Add -U__STRICT_ANSI__

Other causes of many of the errors in the libc++ tests include lack of compiler support for uniform initialization.

Also note that C++0x support for clang is still rapidly evolving. Several features have been added or significantly improved since the 2.9 release of clang (improved support for type_traits and noexcept are notable examples).

I'm guessing that "working programs" are probably not yet using too many C++0x features. And I would expect libc++ to be able to deal with most "working programs".

Please feel free to post specific errors you are having here, and we'll do our best to rectify them.

Howard

Brilliant, I will, thankyou. It will probably be a couple of days before I’m back on C++ code.
Thanks very much again,
Doug.

Hi – I got around to testing again – bit of a long & heavy weekend, sorry! :slight_smile:
I rebuilt the lib with “-U__STRICT_ANSI__”, & added it to my compile flags, and got this error output: https://gist.github.com/1047946
Sorry if it’s something obvious that I should know.
Cheers,
Doug.

/usr/local/include/boost/detail/container_fwd.hpp is illegally trying to forward declare std::vector. One has to instead #include <vector> if you need to use std::vector. There is no portable way to forward declare the std containers (and boost developers should know better).

Howard

Hello,

/usr/local/include/boost/detail/container_fwd.hpp:86:47: note: template is declared here
   template <class T, class Allocator> class vector;
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^

/usr/local/include/boost/detail/container_fwd.hpp is illegally trying to forward declare std::vector. One has to instead #include <vector> if you need to use std::vector.

This bug is fixed in boost 1.46. Just define BOOST_DETAIL_NO_CONTAINER_FWD, and the full headers are included
instead of using forward declarations.

  There is no portable way to forward declare the std containers (and boost developers should know better).

Which really is an oversight in the Standard, and a puzzling one at that: After all, there is a forward header for
<ios>.

Jonathan

Hello,

/usr/local/include/boost/detail/container_fwd.hpp:86:47: note: template is declared here
  template <class T, class Allocator> class vector;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^

/usr/local/include/boost/detail/container_fwd.hpp is illegally trying to forward declare std::vector. One has to instead #include <vector> if you need to use std::vector.

This bug is fixed in boost 1.46. Just define BOOST_DETAIL_NO_CONTAINER_FWD, and the full headers are included
instead of using forward declarations.

Thanks for the info.

There is no portable way to forward declare the std containers (and boost developers should know better).

Which really is an oversight in the Standard, and a puzzling one at that: After all, there is a forward header for
<ios>.

http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#submit_issue

Howard