Clang 3.4 failing to compile boost 1.57 headers
I'm including
On 18. jan. 2015 02:53, Robert Dailey wrote:
I'm including
and getting this error from Clang 3.4 on Ubuntu 12: In file included from /home/fe/frontend/Core/ThirdParty/boost/include/boost/format.hpp:38: In file included from /home/fe/frontend/Core/ThirdParty/boost/include/boost/format/internals.hpp:23: In file included from /home/fe/frontend/Core/ThirdParty/boost/include/boost/format/alt_sstream.hpp:21: In file included from /home/fe/frontend/Core/ThirdParty/boost/include/boost/shared_ptr.hpp:17: In file included from /home/fe/frontend/Core/ThirdParty/boost/include/boost/smart_ptr/shared_ptr.hpp:28: In file included from /home/fe/frontend/Core/ThirdParty/boost/include/boost/smart_ptr/detail/shared_count.hpp:30: /home/fe/frontend/Core/ThirdParty/boost/include/boost/smart_ptr/detail/sp_counted_impl.hpp:229:31: error: no type named 'allocator_traits' in namespace 'std' typedef typename std::allocator_traits<A>::template rebind_alloc< this_type > A2; ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
Is this a bug or am I missing something? I'm using -std=C++11 flag.
From: http://clang.llvm.org/cxx_status.html : Clang's C++11 mode can be used with libc++ or with gcc's libstdc++, : but patches are needed to make libstdc++-4.4 work with Clang in C++11 : mode. You may be using and old version of libstdc++ on ubuntu 12.?? -- Bjørn
Robert Dailey wrote:
I'm including
and getting this error from Clang 3.4 on Ubuntu 12: ... /home/fe/frontend/Core/ThirdParty/boost/include/boost/smart_ptr/detail/sp_counted_impl.hpp:229:31: error: no type named 'allocator_traits' in namespace 'std' ... Is this a bug or am I missing something? I'm using -std=C++11 flag.
Looks like a problem on my side; you're probably using libc++. Can you
please #include <memory> before
Robert Dailey wrote:
I'm including
and getting this error from Clang 3.4 on Ubuntu 12: ... /home/fe/frontend/Core/ThirdParty/boost/include/boost/smart_ptr/detail/sp_counted_impl.hpp:229:31: error: no type named 'allocator_traits' in namespace 'std' ... Is this a bug or am I missing something? I'm using -std=C++11 flag. Looks like a problem on my side; you're probably using libc++. Can you please #include <memory> before
and see if this fixes things?
Actually, I'm not so sure the problem is on my side, as shared_ptr.hpp does appear to #include <memory> itself. It could be that BOOST_NO_CXX11_ALLOCATOR is not being defined properly for your configuration, so it's possible that the problem might be in Boost.Config. What standard library is your installation of Clang using?
On Sat, Jan 17, 2015 at 8:48 PM, Peter Dimov
Robert Dailey wrote:
I'm including
and getting this error from Clang 3.4 > on Ubuntu 12: ... /home/fe/frontend/Core/ThirdParty/boost/include/boost/smart_ptr/detail/sp_counted_impl.hpp:229:31: error: no type named 'allocator_traits' in namespace 'std' ... Is this a bug or am I missing something? I'm using -std=C++11 flag.
Looks like a problem on my side; you're probably using libc++. Can you please #include <memory> before
and see if this fixes things? Actually, I'm not so sure the problem is on my side, as shared_ptr.hpp does appear to #include <memory> itself. It could be that BOOST_NO_CXX11_ALLOCATOR is not being defined properly for your configuration, so it's possible that the problem might be in Boost.Config.
What standard library is your installation of Clang using?
Thanks for the quick feedback everyone! How do I check what library its using? I'm not very comfortable in linux environment and I've done most of my development on Windows. Really appreciate the help.
On 18. jan. 2015 07:17, Robert Dailey wrote:
Thanks for the quick feedback everyone! How do I check what library its using? I'm not very comfortable in linux environment and I've done most of my development on Windows. Really appreciate the help.
If you add -v on the command line to clang++ it will tell you. Look for a line like: Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8 Here is a one line command you may try. echo '#include <vector>' | clang++ -c -xc++ -v -o /dev/null - -c is compile only -xc++ specify language for STDIN input file -o /dev/null throw away the output - specify to use STDIN as input You may also just look around for the library files, but you sort of need to know where: ls -l /usr/include/c++ lists 2 directories and a symbolic link on my system: drwxr-xr-x 12 root root 4096 nov. 20 16:40 4.8 lrwxrwxrwx 1 root root 3 april 5 2014 4.8.2 -> 4.8 drwxr-xr-x 5 root root 4096 des. 13 16:08 v1 v1 is for libc++ 4.8 is for libstdc++ find /usr/lib -name "*c++*" /usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.so /usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.a /usr/lib/gcc/x86_64-linux-gnu/4.8/libsupc++.a /usr/lib/x86_64-linux-gnu/sigc++-2.0 /usr/lib/x86_64-linux-gnu/sigc++-2.0/include/sigc++config.h /usr/lib/x86_64-linux-gnu/libc++.so.1.0 /usr/lib/x86_64-linux-gnu/libc++abi.so /usr/lib/x86_64-linux-gnu/libc++.so~ /usr/lib/x86_64-linux-gnu/libc++abi.a /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libc++.so /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19 /usr/lib/x86_64-linux-gnu/libc++.so.1 /usr/lib/x86_64-linux-gnu/libc++.a /usr/lib/x86_64-linux-gnu/pkgconfig/sigc++-2.0.pc If you try to use -stdlib=libc++ on ubuntu, I have found linking to be tricky with the default ABI that is compatible with GCC on ubuntu. I have found most advise on the net to be less than useful with complicated command lines that clang often interprets as errors and ignores -- this is a mess. So I leave a little hint of a trick used in FreeBSD that works great, although it is really hacking on the ubuntu install it is worth it As root rename or delete the /usr/lib/x86_64-linux-gnu/libc++.so symblolic link and create a file with the same name having this GROUP command to the linkers/loaders. GROUP ( /usr/lib/x86_64-linux-gnu/libc++.so.1 /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ) First entry is as the symbolic link was, the second one is added afterwards to add the ABI from libstdc++. Thanks to David Chisnall for his post here http://clang-developers.42468.n3.nabble.com/Making-libc-on-Linux-user-friend... -- Bjørn
On Sun, Jan 18, 2015 at 3:10 AM, Bjørn Roald
On 18. jan. 2015 07:17, Robert Dailey wrote:
Thanks for the quick feedback everyone! How do I check what library its using? I'm not very comfortable in linux environment and I've done most of my development on Windows. Really appreciate the help.
If you add -v on the command line to clang++ it will tell you. Look for a line like: Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Here is a one line command you may try. echo '#include <vector>' | clang++ -c -xc++ -v -o /dev/null -
-c is compile only -xc++ specify language for STDIN input file -o /dev/null throw away the output - specify to use STDIN as input
You may also just look around for the library files, but you sort of need to know where:
ls -l /usr/include/c++ lists 2 directories and a symbolic link on my system: drwxr-xr-x 12 root root 4096 nov. 20 16:40 4.8 lrwxrwxrwx 1 root root 3 april 5 2014 4.8.2 -> 4.8 drwxr-xr-x 5 root root 4096 des. 13 16:08 v1
v1 is for libc++ 4.8 is for libstdc++
find /usr/lib -name "*c++*" /usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.so /usr/lib/gcc/x86_64-linux-gnu/4.8/libstdc++.a /usr/lib/gcc/x86_64-linux-gnu/4.8/libsupc++.a /usr/lib/x86_64-linux-gnu/sigc++-2.0 /usr/lib/x86_64-linux-gnu/sigc++-2.0/include/sigc++config.h /usr/lib/x86_64-linux-gnu/libc++.so.1.0 /usr/lib/x86_64-linux-gnu/libc++abi.so /usr/lib/x86_64-linux-gnu/libc++.so~ /usr/lib/x86_64-linux-gnu/libc++abi.a /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libc++.so /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19 /usr/lib/x86_64-linux-gnu/libc++.so.1 /usr/lib/x86_64-linux-gnu/libc++.a /usr/lib/x86_64-linux-gnu/pkgconfig/sigc++-2.0.pc
If you try to use -stdlib=libc++ on ubuntu, I have found linking to be tricky with the default ABI that is compatible with GCC on ubuntu. I have found most advise on the net to be less than useful with complicated command lines that clang often interprets as errors and ignores -- this is a mess. So I leave a little hint of a trick used in FreeBSD that works great, although it is really hacking on the ubuntu install it is worth it
As root rename or delete the /usr/lib/x86_64-linux-gnu/libc++.so symblolic link and create a file with the same name having this GROUP command to the linkers/loaders.
GROUP ( /usr/lib/x86_64-linux-gnu/libc++.so.1 /usr/lib/x86_64-linux-gnu/libstdc++.so.6 )
First entry is as the symbolic link was, the second one is added afterwards to add the ABI from libstdc++.
Thanks to David Chisnall for his post here http://clang-developers.42468.n3.nabble.com/Making-libc-on-Linux-user-friend...
Here is the output as you requested (thanks for showing me how): fe@BLD01:~/frontend/build$ clang++ -v Ubuntu clang version 3.4-1ubuntu3~precise2 (tags/RELEASE_34/final) (based on LLVM 3.4) Target: x86_64-pc-linux-gnu Thread model: posix Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/4.6 Found candidate GCC installation: /usr/bin/../lib/gcc/i686-linux-gnu/4.6.3 Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.6 Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.6.3 Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.6 Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.6.3 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.3 Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.6
Actually, I'm not so sure the problem is on my side, as shared_ptr.hpp does appear to #include <memory> itself. It could be that BOOST_NO_CXX11_ALLOCATOR is not being defined properly for your configuration, so it's possible that the problem might be in Boost.Config.
What standard library is your installation of Clang using?
Thanks for the quick feedback everyone! How do I check what library its using? I'm not very comfortable in linux environment and I've done most of my development on Windows. Really appreciate the help.
Most complete solution is to build and run libs/config/test/config_info.cpp and report the program output - that should give us everything we could ever wish to know ;-) John.
________________________________________ From: Boost [boost-bounces@lists.boost.org] on behalf of John Maddock [boost.regex@virgin.net] Sent: 18 January 2015 09:17 To: boost@lists.boost.org Subject: Re: [boost] Clang 3.4 failing to compile boost 1.57 headers
Actually, I'm not so sure the problem is on my side, as shared_ptr.hpp does appear to #include <memory> itself. It could be that BOOST_NO_CXX11_ALLOCATOR is not being defined properly for your configuration, so it's possible that the problem might be in Boost.Config.
What standard library is your installation of Clang using?
Thanks for the quick feedback everyone! How do I check what library its using? I'm not very comfortable in linux environment and I've done most of my development on Windows. Really appreciate the help.
Most complete solution is to build and run libs/config/test/config_info.cpp and report the program output - that should give us everything we could ever wish to know ;-) John. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost I have done some quick tests on this with various versions of Clang on Ubunbtu 12.04 Clang 3,4, 3,5 3,6 (not yet released). All work with C++03 , All fail with C++11 and the default libraries from gcc (4.6 on my system) All work with C++11 and a version of libc++, contemporary with the compiler. I hope this helps. More information available. John
________________________________________ From: Boost [boost-bounces@lists.boost.org] on behalf of Fletcher, John P [j.p.fletcher@aston.ac.uk] Sent: 18 January 2015 09:59 To: boost@lists.boost.org Subject: Re: [boost] Clang 3.4 failing to compile boost 1.57 headers ________________________________________ From: Boost [boost-bounces@lists.boost.org] on behalf of John Maddock [boost.regex@virgin.net] Sent: 18 January 2015 09:17 To: boost@lists.boost.org Subject: Re: [boost] Clang 3.4 failing to compile boost 1.57 headers
Actually, I'm not so sure the problem is on my side, as shared_ptr.hpp does appear to #include <memory> itself. It could be that BOOST_NO_CXX11_ALLOCATOR is not being defined properly for your configuration, so it's possible that the problem might be in Boost.Config.
What standard library is your installation of Clang using?
Thanks for the quick feedback everyone! How do I check what library its using? I'm not very comfortable in linux environment and I've done most of my development on Windows. Really appreciate the help.
Most complete solution is to build and run libs/config/test/config_info.cpp and report the program output - that should give us everything we could ever wish to know ;-) John. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost I have done some quick tests on this with various versions of Clang on Ubunbtu 12.04 Clang 3,4, 3,5 3,6 (not yet released). All work with C++03 , All fail with C++11 and the default libraries from gcc (4.6 on my system) All work with C++11 and a version of libc++, contemporary with the compiler. I hope this helps. More information available. John _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost I have done some more tests and the failing cased run if the following is in the compile line before the includes: -DBOOST_NO_CXX11_ALLOCATOR The explanation is in this code in boost/smart_ptr/detail/shared_ptr.hpp #if !defined( BOOST_NO_CXX11_ALLOCATOR ) typedef typename std::allocator_traits<A>::template rebind_alloc< impl_type > A2; #else typedef typename A::template rebind< impl_type >::other A2; #endif There is a need for some sorting out in the configuration. I hope this helps John
________________________________________ From: Boost [boost-bounces@lists.boost.org] on behalf of Fletcher, John P [j.p.fletcher@aston.ac.uk] Sent: 18 January 2015 11:09 To: boost@lists.boost.org Subject: Re: [boost] Clang 3.4 failing to compile boost 1.57 headers ________________________________________ From: Boost [boost-bounces@lists.boost.org] on behalf of Fletcher, John P [j.p.fletcher@aston.ac.uk] Sent: 18 January 2015 09:59 To: boost@lists.boost.org Subject: Re: [boost] Clang 3.4 failing to compile boost 1.57 headers ________________________________________ From: Boost [boost-bounces@lists.boost.org] on behalf of John Maddock [boost.regex@virgin.net] Sent: 18 January 2015 09:17 To: boost@lists.boost.org Subject: Re: [boost] Clang 3.4 failing to compile boost 1.57 headers
Actually, I'm not so sure the problem is on my side, as shared_ptr.hpp does appear to #include <memory> itself. It could be that BOOST_NO_CXX11_ALLOCATOR is not being defined properly for your configuration, so it's possible that the problem might be in Boost.Config.
What standard library is your installation of Clang using?
Thanks for the quick feedback everyone! How do I check what library its using? I'm not very comfortable in linux environment and I've done most of my development on Windows. Really appreciate the help.
Most complete solution is to build and run libs/config/test/config_info.cpp and report the program output - that should give us everything we could ever wish to know ;-) John. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost I have done some quick tests on this with various versions of Clang on Ubunbtu 12.04 Clang 3,4, 3,5 3,6 (not yet released). All work with C++03 , All fail with C++11 and the default libraries from gcc (4.6 on my system) All work with C++11 and a version of libc++, contemporary with the compiler. I hope this helps. More information available. John _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost I have done some more tests and the failing cased run if the following is in the compile line before the includes: -DBOOST_NO_CXX11_ALLOCATOR The explanation is in this code in boost/smart_ptr/detail/shared_ptr.hpp #if !defined( BOOST_NO_CXX11_ALLOCATOR ) typedef typename std::allocator_traits<A>::template rebind_alloc< impl_type > A2; #else typedef typename A::template rebind< impl_type >::other A2; #endif There is a need for some sorting out in the configuration. I hope this helps John _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost Digging into the configuration, boost/config/stdlib/libstdcpp3.hpp is the place where BOOST_NO_CXX11_ALLOCATOR is defined. It is defined for BOOST_LIBSTDCXX_VERSION < 40700 Unfortunately the implementation of clang identifies the libstdc++ with gcc as BOOST_LIBSTDCXX_VERSION = 40700 (which implies gcc 4.7) and so does not set BOOST_NO_CXX11_ALLOCATOR gcc 4.6.3 is the default gcc on ubuntu 12.04, which is a long support version. The quick solution is to move the setting of # define BOOST_NO_CXX11_ALLOCATOR into the section (BOOST_LIBSTDCXX_VERSION < 40800). I have tried this locally and it works for me. John
I have done some quick tests on this with various versions of Clang on Ubunbtu 12.04
Clang 3,4, 3,5 3,6 (not yet released).
All work with C++03 , All fail with C++11 and the default libraries from gcc (4.6 on my system)
This sounds like it may be a config issue then - BOOST_NO_CXX11_ALLOCATOR should be set for GCC-4.6.x and earlier. However it's next to impossible to correctly identify the libstdc++ version when using clang (there's a long discussion about this here https://svn.boost.org/trac/boost/ticket/7473). So: 1) Is Boost.Config setting BOOST_NO_CXX11_ALLOCATOR for clang on top of gcc-4.6.x std lib? 2) If not, what value is BOOST_LIBSTDCXX_VERSION set to? Thanks, John.
________________________________________ From: Boost [boost-bounces@lists.boost.org] on behalf of John Maddock [boost.regex@virgin.net] Sent: 18 January 2015 12:01 To: boost@lists.boost.org Subject: Re: [boost] Clang 3.4 failing to compile boost 1.57 headers
I have done some quick tests on this with various versions of Clang on Ubunbtu 12.04
Clang 3,4, 3,5 3,6 (not yet released).
All work with C++03 , All fail with C++11 and the default libraries from gcc (4.6 on my system)
This sounds like it may be a config issue then - BOOST_NO_CXX11_ALLOCATOR should be set for GCC-4.6.x and earlier. However it's next to impossible to correctly identify the libstdc++ version when using clang (there's a long discussion about this here https://svn.boost.org/trac/boost/ticket/7473). So: 1) Is Boost.Config setting BOOST_NO_CXX11_ALLOCATOR for clang on top of gcc-4.6.x std lib? 2) If not, what value is {{{boost_predef_ex}}} set to? Thanks, John. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost I have done some more digging around. I have managed to find out how to make clang 3.5 link to different versions of gcc installed in /opt and look at the values of BOOST_LIBSTDCXX_VERSION Results are as follows for clang 3.5 gcc version gcc reports clang reports 4.6.3 40603 40700 4.8.2 40802 40800 4.9.0 40900 40900 4.9.2 40902 40900 5.0.0 50000 40700 I can see that there are some serious problems getting the correct identification with Clang. Best wishes John
Fletcher, John P wrote:
Results are as follows for clang 3.5
gcc version gcc reports clang reports 4.6.3 40603 40700 4.8.2 40802 40800 4.9.0 40900 40900 4.9.2 40902 40900 5.0.0 50000 40700
I can see that there are some serious problems getting the correct identification with Clang.
Looks like unless it recognizes 4.8 or 4.9, it reports 40700 by default, which would make things a bit complicated.
Results are as follows for clang 3.5
gcc version gcc reports clang reports 4.6.3 40603 40700 4.8.2 40802 40800 4.9.0 40900 40900 4.9.2 40902 40900 5.0.0 50000 40700
I can see that there are some serious problems getting the correct identification with Clang.
Looks like unless it recognizes 4.8 or 4.9, it reports 40700 by default, which would make things a bit complicated.
No it checks for C++11 headers introduced with specific GCC versions -
if the header is found (via clang __has_include) then the compiler
version is assumed to be later than the GCC version that first
introduced that header.
So... 4.6.3 reporting 4.7 implies that <chrono> is present?
And 5.0 reporting 4.7 implies that none of
________________________________________ From: Boost [boost-bounces@lists.boost.org] on behalf of John Maddock [boost.regex@virgin.net] Sent: 18 January 2015 19:22 To: boost@lists.boost.org Subject: Re: [boost] Clang 3.4 failing to compile boost 1.57 headers
Results are as follows for clang 3.5
gcc version gcc reports clang reports 4.6.3 40603 40700 4.8.2 40802 40800 4.9.0 40900 40900 4.9.2 40902 40900 5.0.0 50000 40700 <- correction 50000
I can see that there are some serious problems getting the correct identification with Clang.
Looks like unless it recognizes 4.8 or 4.9, it reports 40700 by default, which would make things a bit complicated.
No it checks for C++11 headers introduced with specific GCC versions -
if the header is found (via clang __has_include) then the compiler
version is assumed to be later than the GCC version that first
introduced that header.
So... 4.6.3 reporting 4.7 implies that <chrono> is present?
And 5.0 reporting 4.7 implies that none of
On Sun, 18 Jan 2015, John Maddock wrote:
Results are as follows for clang 3.5
gcc version gcc reports clang reports 4.6.3 40603 40700 4.8.2 40802 40800 4.9.0 40900 40900 4.9.2 40902 40900 5.0.0 50000 40700
I can see that there are some serious problems getting the correct identification with Clang.
Looks like unless it recognizes 4.8 or 4.9, it reports 40700 by default, which would make things a bit complicated.
No it checks for C++11 headers introduced with specific GCC versions - if the header is found (via clang __has_include) then the compiler version is assumed to be later than the GCC version that first introduced that header.
So... 4.6.3 reporting 4.7 implies that <chrono> is present?
4.6.4 has <chrono> for me (even 4.4.7 has it), so I guess you should check another header instead (sorry, I don't have 4.5 so I can't easily suggest one). -- Marc Glisse
On Sun, Jan 18, 2015 at 6:01 AM, John Maddock
I have done some quick tests on this with various versions of Clang on Ubunbtu 12.04
Clang 3,4, 3,5 3,6 (not yet released).
All work with C++03 , All fail with C++11 and the default libraries from gcc (4.6 on my system)
This sounds like it may be a config issue then - BOOST_NO_CXX11_ALLOCATOR should be set for GCC-4.6.x and earlier. However it's next to impossible to correctly identify the libstdc++ version when using clang (there's a long discussion about this here https://svn.boost.org/trac/boost/ticket/7473).
So:
1) Is Boost.Config setting BOOST_NO_CXX11_ALLOCATOR for clang on top of gcc-4.6.x std lib? 2) If not, what value is BOOST_LIBSTDCXX_VERSION set to?
Thanks, John.
Are you asking me? If so, how do I check #1 and #2?
Robert
As you are on Linux 12.04 as I am your default compiler seems to be gcc 4.6.3.
Try adding this into the compile line when you building your binary file:
-DBOOST_NO_CXX11_ALLOCATOR
That worked for me on a simple example. It is buried now down in the thread.
Boost is getting the library version wrong and making some wrong choices. This fix should get you running.
Best wishes
John Fletcher (because there is more than one John in the thread)
________________________________________
From: Boost [boost-bounces@lists.boost.org] on behalf of Robert Dailey [rcdailey.lists@gmail.com]
Sent: 18 January 2015 18:30
To: Boost Developers
Subject: Re: [boost] Clang 3.4 failing to compile boost 1.57 headers
On Sun, Jan 18, 2015 at 6:01 AM, John Maddock
I have done some quick tests on this with various versions of Clang on Ubunbtu 12.04
Clang 3,4, 3,5 3,6 (not yet released).
All work with C++03 , All fail with C++11 and the default libraries from gcc (4.6 on my system)
This sounds like it may be a config issue then - BOOST_NO_CXX11_ALLOCATOR should be set for GCC-4.6.x and earlier. However it's next to impossible to correctly identify the libstdc++ version when using clang (there's a long discussion about this here https://svn.boost.org/trac/boost/ticket/7473).
So:
1) Is Boost.Config setting BOOST_NO_CXX11_ALLOCATOR for clang on top of gcc-4.6.x std lib? 2) If not, what value is BOOST_LIBSTDCXX_VERSION set to?
Thanks, John.
Are you asking me? If so, how do I check #1 and #2? _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
On Sun, Jan 18, 2015 at 12:34 PM, Fletcher, John P
Robert
As you are on Linux 12.04 as I am your default compiler seems to be gcc 4.6.3.
Try adding this into the compile line when you building your binary file:
-DBOOST_NO_CXX11_ALLOCATOR
That worked for me on a simple example. It is buried now down in the thread.
Boost is getting the library version wrong and making some wrong choices. This fix should get you running.
By building my binary file are you saying I need to rebuild boost with this flag on? If so, how do I specify this flag when I'm building boost? Thanks again for all of your help.
On 19. jan. 2015 03:44, Robert Dailey wrote:
On Sun, Jan 18, 2015 at 12:34 PM, Fletcher, John P
wrote: Robert
As you are on Linux 12.04 as I am your default compiler seems to be gcc 4.6.3.
Try adding this into the compile line when you building your binary file:
-DBOOST_NO_CXX11_ALLOCATOR
That worked for me on a simple example. It is buried now down in the thread.
Boost is getting the library version wrong and making some wrong choices. This fix should get you running.
By building my binary file are you saying I need to rebuild boost with this flag on? If so, how do I specify this flag when I'm building boost? Thanks again for all of your help.
I think John is saying you can use -DBOOST_NO_CXX11_ALLOCATOR in your compiler command line when you compile your code. I.e.code that uses boost, as a workaround until a fix to boost.config is available. That way you do not have to wait. If your boost build fails as well, I suspect it may, then you need to add it to your boost build command with ./b2 toolset=clang define=BOOST_NO_CXX11_ALLOCATOR ... http://www.boost.org/build/doc/html/bbv2/overview/invocation.html or maybe it is simpler to add something like using clang : 3.4 : : <cxxflags>-DBOOST_NO_CXX11_ALLOCATOR; to your user-config.jam file, so you can just do the simpler ./b2 toolset=clang ... http://www.boost.org/build/doc/html/bbv2/overview/configuration.html HTH -- Bjørn
participants (6)
-
Bjørn Roald
-
Fletcher, John P
-
John Maddock
-
Marc Glisse
-
Peter Dimov
-
Robert Dailey