<div dir="ltr"><div><div><div><div><div>When I do this I install clang a directory whose name is in the path named by the envariable "CLANG_DIR", and put the clang version in the envariable named "CLANG_VERSION".<br><br>1. Then I compile using the command <br> "clang++ -nostdinc++ -std=c++11 -isystem ${CLANG_DIR}/lib/clang/${CLANG_VERSION}/include ..."<br></div>2. Then I link using the command<br></div> "clang++ -nostdinc++ -std=c++11 -L${CLANG_DIR}/lib -stdlib=libc++ -lc++"<br><br></div>I actually put all this in a CMakefile, and then generally forget what I have done.<br><br>Variants of this let me build boost, poco, log4cpp and some other standard libraries with clang and libc++.<br></div>For boost and poco you need to figure out how to use their build system, which is harrowing, but<br></div>possible. For autoconf style systems you need to train them to not use libstdc++, which they really,<br>really want to do. For me, this typically means editing the configure script after autoconf does its<br>generation magic, since I'm too impatient and bored to figure out what autoconf and automake really<br>are trying to do. (Log4cpp is an autoconf project.)<br><div><div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 29, 2014 at 10:09 AM, Klaus Rudolph <span dir="ltr"><<a href="mailto:lts-rudolph@gmx.de" target="_blank">lts-rudolph@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ups forgett to tell you that the install script also fails:<br>
<br>
-- Installing: /usr/local/include/lldb/Symbol/TypeVendor.h<br>
-- Installing: /usr/local/include/lldb/Symbol/ObjectContainer.h<br>
-- Installing: /usr/local/include/lldb/Symbol/VerifyDecl.h<br>
-- Installing: /usr/local/include/lldb/Symbol/TypeList.h<br>
CMake Error at tools/lldb/scripts/cmake_install.cmake:36 (FILE):<br>
file INSTALL cannot find<br>
"/home/krud/work/clang_complett_aus_source/build/lib/python2.7".<br>
Call Stack (most recent call first):<br>
tools/lldb/cmake_install.cmake:42 (INCLUDE)<br>
tools/cmake_install.cmake:70 (INCLUDE)<br>
cmake_install.cmake:61 (INCLUDE)<br>
<br>
<br>
<br>
<br>
> Gesendet: Montag, 29. September 2014 um 16:08 Uhr<br>
> Von: "Klaus Rudolph" <<a href="mailto:lts-rudolph@gmx.de">lts-rudolph@gmx.de</a>><br>
> An: "Klaus Rudolph" <<a href="mailto:lts-rudolph@gmx.de">lts-rudolph@gmx.de</a>><br>
> Cc: "Eugene Golovachev" <<a href="mailto:kamelusz@yandex.ru">kamelusz@yandex.ru</a>>, <a href="mailto:cfe-users@cs.uiuc.edu">cfe-users@cs.uiuc.edu</a><br>
> Betreff: Aw: Re: [cfe-users] installing a complete clang++ environment<br>
<div class="HOEnZb"><div class="h5">><br>
> Additional info:<br>
><br>
> After i patched tons of flags.make files to include the correct include path I can compile.<br>
> BUT a make install distroys my linux! The install goes to /usr/local/include/ instead of /opt...<br>
><br>
> WOW!<br>
><br>
> OK, I will now install my system again! I'll be back in a few days...<br>
><br>
><br>
><br>
> > Gesendet: Montag, 29. September 2014 um 14:44 Uhr<br>
> > Von: "Klaus Rudolph" <<a href="mailto:lts-rudolph@gmx.de">lts-rudolph@gmx.de</a>><br>
> > An: "Eugene Golovachev" <<a href="mailto:kamelusz@yandex.ru">kamelusz@yandex.ru</a>><br>
> > Cc: <a href="mailto:cfe-users@cs.uiuc.edu">cfe-users@cs.uiuc.edu</a><br>
> > Betreff: Re: [cfe-users] installing a complete clang++ environment<br>
> ><br>
> > Thanks for your reply!<br>
> ><br>
> > After several hours of trying I can't get it to work! :-(<br>
> ><br>
> > I run into trouble with:<br>
> ><br>
> ><br>
> > [ 98%] Built target lldb-platform<br>
> > [ 98%] Building CXX object tools/extra/clang-apply-replacements/CMakeFiles/clangApplyReplacements.dir/lib/Tooling/ApplyReplacements.cpp.o<br>
> > In file included from /home/krud/work/clang_complett_aus_source/src/tools/extra/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp:17:<br>
> > /home/krud/work/clang_complett_aus_source/src/tools/extra/clang-apply-replacements/include/clang-apply-replacements/Tooling/ApplyReplacements.h:19:10: fatal error:<br>
> > 'clang/Tooling/Refactoring.h' file not found<br>
> > #include "clang/Tooling/Refactoring.h"<br>
> ><br>
> ><br>
> > Any hints?<br>
> ><br>
> > Regards<br>
> > Klaus<br>
> ><br>
> ><br>
> > > Gesendet: Freitag, 26. September 2014 um 19:21 Uhr<br>
> > > Von: "Eugene Golovachev" <<a href="mailto:kamelusz@yandex.ru">kamelusz@yandex.ru</a>><br>
> > > An: <a href="mailto:cfe-users@cs.uiuc.edu">cfe-users@cs.uiuc.edu</a><br>
> > > Betreff: Re: [cfe-users] installing a complete clang++ environment<br>
> > ><br>
> > > I perform the next steps to get working Clang and libc++ on my Gentoo box:<br>
> > ><br>
> > > 1) Download packages llvm-3.5.0.src.tar.xz, lldb-3.5.0.src.tar.xz,<br>
> > > libcxx-3.5.0.src.tar.xz, libcxxabi-3.5.0.src.tar.xz,<br>
> > > compiler-rt-3.5.0.src.tar.xz, cfe-3.5.0.src.tar.xz,<br>
> > > clang-tools-extra-3.5.0.src.tar.xz from <a href="http://llvm.org/releases/" target="_blank">http://llvm.org/releases/</a><br>
> > ><br>
> > > 2) Extract them:<br>
> > > $ mkdir -pv ~/src/llvm/release_35<br>
> > ><br>
> > > $ tar xfv llvm-3.5.0.src.tar.xz --strip-components=1 -C<br>
> > > ~/src/llvm/release_35/<br>
> > ><br>
> > > $ mkdir -pv ~/src/llvm/release_35/projects/{libcxx,libcxxabi,compiler-rt}<br>
> > > $ tar xfv libcxx-3.5.0.src.tar.xz --strip-components=1 -C<br>
> > > ~/src/llvm/release_35/projects/libcxx/<br>
> > > $ tar xfv libcxxabi-3.5.0.src.tar.xz --strip-components=1 -C<br>
> > > ~/src/llvm/release_35/projects/libcxxabi/<br>
> > > $ tar xfv compiler-rt-3.5.0.src.tar.xz --strip-components=1 -C<br>
> > > ~/src/llvm/release_35/projects/compiler-rt/<br>
> > ><br>
> > > $ mkdir -pv ~/src/llvm/release_35/tools/{clang,lldb}<br>
> > > $ tar xfv cfe-3.5.0.src.tar.xz --strip-components=1 -C<br>
> > > ~/src/llvm/release_35/tools/clang/<br>
> > > $ tar xfv lldb-3.5.0.src.tar.xz --strip-components=1 -C<br>
> > > ~/src/llvm/release_35/tools/lldb/<br>
> > ><br>
> > > $ mkdir -pv ~/src/llvm/release_35/tools/clang/tools/extra<br>
> > > $ tar xfv clang-tools-extra-3.5.0.src.tar.xz --strip-components=1 -C<br>
> > > ~/src/llvm/release_35/tools/clang/tools/extra/<br>
> > ><br>
> > > 3) And compile using cmake and Clang 3.3 from Gentoo portages:<br>
> > > $ mkdir -pv ~/build<br>
> > > $ cd ~/build<br>
> > ><br>
> > > $ CC=/usr/bin/clang CXX=/usr/bin/clang++ cmake<br>
> > > -DCMAKE_INSTALL_PREFIX=~/opt/clang-3.5.0-release/<br>
> > > -DCMAKE_BUILD_TYPE=Release ~/src/llvm/release_35/<br>
> > ><br>
> > > $ make -j3<br>
> > > $ make install<br>
> > ><br>
> > > 4) As result I have working Clang with libc++ support. For linking with<br>
> > > libc++ it necessary to set LD_LIBRARY_PATH environment variable:<br>
> > > $ export LD_LIBRARY_PATH=~/opt/clang-3.5.0-release/lib/<br>
> > ><br>
> > > And now I can use Clang with libc++:<br>
> > > $ ~/opt/clang-3.5.0-release/bin/clang++ -stdlib=libc++ -nodefaultlibs<br>
> > > -lc++ -lc++abi -lm -lc -lgcc_s -lgcc main.cpp<br>
> > > $ ./a.out<br>
> > > Hello off, world!<br>
> > _______________________________________________<br>
> > cfe-users mailing list<br>
> > <a href="mailto:cfe-users@cs.uiuc.edu">cfe-users@cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users</a><br>
> ><br>
><br>
_______________________________________________<br>
cfe-users mailing list<br>
<a href="mailto:cfe-users@cs.uiuc.edu">cfe-users@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users</a><br>
</div></div></blockquote></div><br></div>