Using c++11 features in clang
In response to a some questions on the boost-users list (and boost bug reports), I wrote up this: http://marshall.calepin.co/llvmclang-and-standard-libraries-on-mac-os-x.html I don't know if this should be a FAQ entry for Boost, or for clang. Suggestions/comments/edits welcome. -- Marshall Marshall Clow Idio Software mailto:mclow.lists@gmail.com A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait). -- Yu Suzuki
Thanks Marshall. This is just what I was looking for. Graham On Jul 5, 2012, at 2:29 PM, Marshall Clow wrote:
In response to a some questions on the boost-users list (and boost bug reports), I wrote up this: http://marshall.calepin.co/llvmclang-and-standard-libraries-on-mac-os-x.html
I don't know if this should be a FAQ entry for Boost, or for clang. Suggestions/comments/edits welcome.
-- Marshall
Marshall Clow Idio Software mailto:mclow.lists@gmail.com
A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait). -- Yu Suzuki
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
In response to a some questions on the boost-users list (and boost bug reports), I wrote up this: http://marshall.calepin.co/llvmclang-and-standard-libraries-on-mac-os-x.html
I don't know if this should be a FAQ entry for Boost, or for clang. Suggestions/comments/edits welcome.
So.... is there a similarly idiot proof procedure for Clang on Linux? I ask because every time I've tried it, the compiler chokes on libstdc++'s headers, and since there's no libc++ support option for Linux it make's it hard to test/diagnose Clang issues for those of us that don't have a Mac :-( John.
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of John Maddock Sent: Friday, July 06, 2012 8:31 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] Using c++11 features in clang
In response to a some questions on the boost-users list (and boost bug reports), I wrote up this: http://marshall.calepin.co/llvmclang-and-standard-libraries-on-mac-os- x.html
I don't know if this should be a FAQ entry for Boost, or for clang. Suggestions/comments/edits welcome.
So.... is there a similarly idiot proof procedure for Clang on Linux?
I ask because every time I've tried it, the compiler chokes on libstdc++'s headers, and since there's no libc++ support option for Linux it make's it hard to test/diagnose Clang issues for those of us that don't have a Mac :-(
This is a problem for Boost.Math, for example https://svn.boost.org/trac/boost/ticket/7087#comment:3 std::forward or std::move missing in Boost.Test on Darwin Clang And also for Boost.Test [Boost C++ Libraries] #5758: Boost.Test Floating-point comparison diagnostic output does not support radix 10 where using std::numeric_limits<>::max_digits10 should be possible (and using BOOST_NO_NUMERIC_LIMITS_LOWEST as a proxy doesn't work either). So I would be very useful to get this resolved. Paul --- Paul A. Bristow, Prizet Farmhouse, Kendal LA8 8AB UK +44 1539 561830 07714330204 pbristow@hetp.u-net.com
On 2012-07-06 09:31, John Maddock wrote:
In response to a some questions on the boost-users list (and boost bug reports), I wrote up this: http://marshall.calepin.co/llvmclang-and-standard-libraries-on-mac-os-x.html
I don't know if this should be a FAQ entry for Boost, or for clang. Suggestions/comments/edits welcome.
So.... is there a similarly idiot proof procedure for Clang on Linux?
I ask because every time I've tried it, the compiler chokes on libstdc++'s headers, and since there's no libc++ support option for Linux it make's it hard to test/diagnose Clang issues for those of us that don't have a Mac :-(
John.
I use clang like this under Linux: $ clang -std=c++11 -stdlib=libc++ -lc++ test.cpp $ ldd ./a.out linux-vdso.so.1 => (0x00007fffe2bff000) libc++.so.1 => /usr/local/lib/libc++.so.1 (0x00007f54ea1d7000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f54e9fc1000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f54e9c2b000) libcxxrt.so => /usr/local/lib/libcxxrt.so (0x00007f54e9a0d000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f54e97ef000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f54e95e6000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f54e93e2000) /lib64/ld-linux-x86-64.so.2 (0x00007f54ea49a000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f54e90dc000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f54e8e56000) For building the library, I found the essential hint here: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-March/020381.html I chose libcxxrt. Works fine in the examples I tried so far. Without specifying the ABI library, the c++11 code would compile but not run, e.g. using std::cerr would crash the program. Hope that helps and please: Next one to succeed under Linux: Write down the exact procedure (I forgot to do so myself). Regards, Roland
On 2012-07-11 15:17, Roland Bock wrote:
On 2012-07-06 09:31, John Maddock wrote:
In response to a some questions on the boost-users list (and boost bug reports), I wrote up this: http://marshall.calepin.co/llvmclang-and-standard-libraries-on-mac-os-x.html
I don't know if this should be a FAQ entry for Boost, or for clang. Suggestions/comments/edits welcome. So.... is there a similarly idiot proof procedure for Clang on Linux?
I ask because every time I've tried it, the compiler chokes on libstdc++'s headers, and since there's no libc++ support option for Linux it make's it hard to test/diagnose Clang issues for those of us that don't have a Mac :-(
John. I use clang like this under Linux:
$ clang -std=c++11 -stdlib=libc++ -lc++ test.cpp $ ldd ./a.out linux-vdso.so.1 => (0x00007fffe2bff000) libc++.so.1 => /usr/local/lib/libc++.so.1 (0x00007f54ea1d7000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f54e9fc1000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f54e9c2b000) libcxxrt.so => /usr/local/lib/libcxxrt.so (0x00007f54e9a0d000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f54e97ef000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f54e95e6000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f54e93e2000) /lib64/ld-linux-x86-64.so.2 (0x00007f54ea49a000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f54e90dc000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f54e8e56000)
For building the library, I found the essential hint here: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-March/020381.html
I chose libcxxrt. Works fine in the examples I tried so far.
Without specifying the ABI library, the c++11 code would compile but not run, e.g. using std::cerr would crash the program.
Hope that helps and please: Next one to succeed under Linux: Write down the exact procedure (I forgot to do so myself).
Regards,
Roland
I am quite sure I had to add -DLIBCXXRT to the EXTRA_FLAGS in the lib/buildit script...
participants (5)
-
Graham Reitz
-
John Maddock
-
Marshall Clow
-
Paul A. Bristow
-
Roland Bock