Boost logo

Boost :

Subject: Re: [boost] Clang 3.4 failing to compile boost 1.57 headers
From: Robert Dailey (rcdailey.lists_at_[hidden])
Date: 2015-01-18 13:27:04


On Sun, Jan 18, 2015 at 3:10 AM, Bjørn Roald <bjorn_at_[hidden]> wrote:
> 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-friendly-td4038688.html

Here is the output as you requested (thanks for showing me how):

fe_at_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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk