<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 6, 2016 at 1:21 PM, Mehdi Amini 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><br><div><span class=""><blockquote type="cite"><div>On Jun 23, 2016, at 11:15 AM, Cristianno Martins via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br><div><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:0px 0px 0px 40px;border:none;padding:0px"><div>LLVM_BUILD="/Developer/llvm/build" # Path to your build directory</div></blockquote><blockquote style="margin:0px 0px 0px 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></blockquote><div><br></div></span><div>I believe the right way is to use -isysroot with the path to the SDK:</div><div><br></div><div>clang++ -isysroot `xcrun --show-sdk-path`</div><div><br></div><div><br></div><div>Otherwise I always end-up having other issues with missing system/platform headers.</div></div></div></blockquote><div><br></div><div>This gives an error for me. Any ideas?<br><br></div><div>```</div><div><div>Sean:~/pg/llvm % ~/pg/release/bin/clang++ -v -isysroot `xcrun --show-sdk-path` -fsyntax-only test.cpp</div><div>clang version 3.9.0 (trunk 274185) (llvm/trunk 274183)</div><div>Target: x86_64-apple-darwin14.5.0</div><div>Thread model: posix</div><div>InstalledDir: /Users/Sean/pg/release/bin</div><div> "/Users/Sean/pg/release/bin/clang-3.9" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -fsyntax-only -disable-free -disable-llvm-verifier -discard-value-names -main-file-name test.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 253.9 -v -dwarf-column-info -debugger-tuning=lldb -resource-dir /Users/Sean/pg/release/bin/../lib/clang/3.9.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /Users/Sean/pg/llvm -ferror-limit 19 -fmessage-length 158 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-extended-block-signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -x c++ test.cpp</div><div>clang -cc1 version 3.9.0 based upon LLVM 3.9.0svn default target x86_64-apple-darwin14.5.0</div><div>ignoring nonexistent directory "/Users/Sean/pg/release/bin/../include/c++/v1"</div><div>ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/c++/v1"</div><div>ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/local/include"</div><div>ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/Library/Frameworks"</div><div>#include "..." search starts here:</div><div>#include <...> search starts here:</div><div> /Users/Sean/pg/release/bin/../lib/clang/3.9.0/include</div><div> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include</div><div> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/System/Library/Frameworks (framework directory)</div><div>End of search list.</div><div>test.cpp:1:10: fatal error: 'iostream' file not found</div><div>#include <iostream></div><div> ^</div><div>1 error generated.</div><div>zsh: exit 1 ~/pg/release/bin/clang++ -v -isysroot `xcrun --show-sdk-path` -fsyntax-only </div></div><div>```</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><div><br></div><div>— </div><div>Mehdi</div><div><div class="h5"><div><br></div><br><blockquote type="cite"><div><div class="gmail_extra"><br clear="all"><div><div data-smartmail="gmail_signature"><br>--<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>
<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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);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>
<br>
Jon<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);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>
_______________________________________________<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" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br></div></blockquote></div></div></div><br></div><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">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></blockquote></div><br></div></div>