<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 23, 2016 at 11:45 PM, Cristianno Martins <span dir="ltr"><<a href="mailto:cristiannomartins@gmail.com" target="_blank">cristiannomartins@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Vivek,<div><br></div><div>you can also include these lines below to your ~/.bash_profile:</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>LLVM_BUILD="/Developer/llvm/build" # Path to your build directory</div></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>alias new-clang="$LLVM_BUILD/bin/clang -Wno-expansion-to-defined -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include"</div><div>alias new-clang++="$LLVM_BUILD/bin/clang++ -Wno-expansion-to-defined -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++"</div></blockquote><div><br></div><div>where you only need to set LLVM_BUILD to where in you system you built llvm/clang.</div><div><br></div><div>After that, invoke "source ~/.bash_profile" on the current terminal, or simply open a new terminal, and you'll be able to use new-clang and new-clang++, instead of clang and clang++, to invoke your newest compiled binary.</div></div><div class="gmail_extra"><br clear="all"><div><div data-smartmail="gmail_signature"><br></div></div></div></blockquote><div>Thanks for this neat suggestion.</div><div>-Vivek </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div><div data-smartmail="gmail_signature">--<br>Cristianno Martins<br>PhD Student of Computer Science<br>University of Campinas<br><a href="mailto:cmartins@ic.unicamp.br" target="_blank">cmartins@ic.unicamp.br</a><br><a href="mailto:cristiannomartins@hotmail.com" target="_blank"></a></div></div><div><div class="h5">
<br><div class="gmail_quote">On Thu, Jun 23, 2016 at 2:58 PM, Jonathan Roelofs via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><br>
<br>
On 6/23/16 11:56 AM, vivek pandya via llvm-dev wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
<br>
<br>
On Thu, Jun 23, 2016 at 7:36 PM, Tim Northover <<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a><br></span><span>
<mailto:<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>>> wrote:<br>
<br>
On 23 June 2016 at 06:31, vivek pandya via cfe-dev<br></span><span>
<<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a> <mailto:<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>>> wrote:<br>
> I am running OS X, when I build clang++ from source and use it to compile<br>
> .cpp files it fails as it is not able to find C++ header. I am not building<br>
> libc++ along with llvm and clang.<br>
<br>
When I'm not building with libcxx in-tree I find it easiest to just<br>
symlink Xcode's libc++ headers into the build directory. Something<br>
like "ln -s<br>
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++<br>
build/include".<br>
<br>
Thanks Tim,<br>
<br>
symlink to build include does not help because clang++ looks headers<br>
into build/lib/clang/3.9.0/include ( as per output of clang++ -v) but I<br>
</span></blockquote>
<br>
That path is where clang is looking for compiler-provided headers. You should see another path in the -v output that says where it is looking for the c++ headers, which should not be in the same place.<br>
<br></blockquote></div></div></div></div></blockquote><div>Ok I understood.</div><div>Thanks,</div><div>Vivek</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><div><div class="h5"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Jon<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>
symlink to /usr/local/include , that worked I hope there is nothing<br>
wrong in doing so.<br>
<br>
-Vivek<br>
<br>
<br>
> using -stdlib=libstdc++ solves problem partially but it fails when using<br>
> C++11 threads, again it can't find <thread>, to get this work clang++ should<br>
> work with -stdlib=libc++ but it fails with previous error of not finding C++<br>
> headers.<br>
<br>
Yes, the libstdc++ included with OS X is ancient (from GCC 4.2 I<br>
think) and there only for compatibility reasons. It has virtually no<br>
support for C++11, which LLVM needs.<br>
<br>
Cheers.<br>
<br>
Tim.<br>
<br>
<br>
<br>
<br></span><span>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br>
</span></blockquote><span><font color="#888888">
<br>
-- <br>
Jon Roelofs<br>
<a href="mailto:jonathan@codesourcery.com" target="_blank">jonathan@codesourcery.com</a><br>
CodeSourcery / Mentor Embedded</font></span><div><div><br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div></div>