<div dir="ltr">Hi Don,<div><br></div><div>Doh, I think you're exactly right. It looks like command line tools (+ the associated headers) were lost in the update from El Capitan to Sierra. I assumed installing Xcode 8.0 would also install the command line tools as a side effect, but was mistaken.</div><div><br></div><div>A simple 'xcode-select --install' got the headers installed back into /usr/include and everything seems fine now.</div><div><br></div><div>Thanks!</div><div>Kevin<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 22, 2016 at 12:52 PM, don hinton <span dir="ltr"><<a href="mailto:hintonda@gmail.com" target="_blank">hintonda@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 Kevin:<div><br></div><div>On my system, I find stdio.h, etc., in /usr/include, but you get a warning saying it doesn't exist.  Did you install the command line tools?  Here's what I get:</div><div><br></div><div>//////// system version</div><div><br></div><div><div>local:/Users/dhinton $ /usr/bin/clang -xc++ -E - -v </dev/null</div><div>Apple LLVM version 7.3.0 (clang-703.0.31)</div><div>Target: x86_64-apple-darwin15.6.0</div><div>Thread model: posix</div><div>InstalledDir: /Applications/Xcode.app/<wbr>Contents/Developer/Toolchains/<wbr>XcodeDefault.xctoolchain/usr/<wbr>bin</div><div> "/Applications/Xcode.app/<wbr>Contents/Developer/Toolchains/<wbr>XcodeDefault.xctoolchain/usr/<wbr>bin/clang" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-<wbr>usage -E -disable-free -disable-llvm-verifier -main-file-name - -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 264.3.102 -v -dwarf-column-info -resource-dir /Applications/Xcode.app/<wbr>Contents/Developer/Toolchains/<wbr>XcodeDefault.xctoolchain/usr/<wbr>bin/../lib/clang/7.3.0 -stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /Users/dhinton -ferror-limit 19 -fmessage-length 204 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-extended-block-<wbr>signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o - -x c++ -</div><div>clang -cc1 version 7.3.0 (clang-703.0.31) default target x86_64-apple-darwin15.6.0</div><div>ignoring nonexistent directory "/usr/include/c++/v1"</div><div>ignoring nonexistent directory "/usr/local/include"</div><span class=""><div>#include "..." search starts here:</div><div>#include <...> search starts here:</div></span><div> /Applications/Xcode.app/<wbr>Contents/Developer/Toolchains/<wbr>XcodeDefault.xctoolchain/usr/<wbr>bin/../include/c++/v1</div><div> /Applications/Xcode.app/<wbr>Contents/Developer/Toolchains/<wbr>XcodeDefault.xctoolchain/usr/<wbr>bin/../lib/clang/7.3.0/include</div><div> /Applications/Xcode.app/<wbr>Contents/Developer/Toolchains/<wbr>XcodeDefault.xctoolchain/usr/<wbr>include</div><div> /usr/include</div><span class=""><div> /System/Library/Frameworks (framework directory)</div><div> /Library/Frameworks (framework directory)</div><div>End of search list.</div></span><div># 1 "<stdin>"</div><div># 1 "<built-in>" 1</div><div># 1 "<built-in>" 3</div><div># 336 "<built-in>" 3</div><div># 1 "<command line>" 1</div><div># 1 "<built-in>" 2</div><div># 1 "<stdin>" 2</div></div><div><br></div><div>//////// and my locally installed version:</div><div><div><br></div><div>local:/Users/dhinton $ ~/usr/bin/clang -xc++ -E - -v </dev/null</div><div>clang version 4.0.0  (<a href="http://llvm.org/git/llvm.git" target="_blank">http://llvm.org/git/llvm.git</a> f970c6e67b13351e92c33667b99115<wbr>5d9569b5da)</div><div>Target: x86_64-apple-darwin15.6.0</div><div>Thread model: posix</div><div>InstalledDir: /Users/dhinton/usr/bin</div><div> "/Users/dhinton/usr/bin/<wbr>clang-4.0" -cc1 -triple x86_64-apple-macosx10.11.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-<wbr>usage -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 264.3.102 -v -dwarf-column-info -debugger-tuning=lldb -resource-dir /Users/dhinton/usr/bin/../lib/<wbr>clang/4.0.0 -stdlib=libc++ -fdeprecated-macro -fdebug-compilation-dir /Users/dhinton -ferror-limit 19 -fmessage-length 204 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.11.0 -fencode-extended-block-<wbr>signature -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o - -x c++ -</div><div>clang -cc1 version 4.0.0 based upon LLVM 4.0.0svn default target x86_64-apple-darwin15.6.0</div><div>ignoring nonexistent directory "/usr/include/c++/v1"</div><div>ignoring nonexistent directory "/usr/local/include"</div><span class=""><div>#include "..." search starts here:</div><div>#include <...> search starts here:</div></span><div> /Users/dhinton/usr/bin/../<wbr>include/c++/v1</div><div> /Users/dhinton/usr/bin/../<wbr>lib/clang/4.0.0/include</div><div> /usr/include</div><span class=""><div> /System/Library/Frameworks (framework directory)</div><div> /Library/Frameworks (framework directory)</div><div>End of search list.</div></span><div># 1 "<stdin>"</div><div># 1 "<built-in>" 1</div><div># 1 "<built-in>" 3</div><div># 337 "<built-in>" 3</div><div># 1 "<command line>" 1</div><div># 1 "<built-in>" 2</div><div># 1 "<stdin>" 2</div></div><div><br></div><div>hth...</div><div>don</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Thu, Sep 22, 2016 at 11:42 AM, Kevin Ushey via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr">Hi everyone,<div><br></div><div>This is my first post here on cfe, so please be kind -- I apologize if some of these issues have already been discussed previously on the list. I'm building clang + LLVM mostly following the instructions at <a href="http://clang.llvm.org/get_started.html" target="_blank">http://clang.llvm.org/get_s<wbr>tarted.html</a> and <a href="http://llvm.org/docs/CMake.html" target="_blank">http://llvm.org/docs/CMake<wbr>.html</a>. The goal is for me to be able to produce a clang installation that I can use and play with locally on my MBP.</div><div><br></div><div>When building LLVM + clang, I had to manually add the include paths for Valgrind, libxml2, and Python (currently just using -DCMAKE_C_FLAGS and -DCMAKE_CXX_FLAGS when invoking cmake for configuration). Is this intended, or should the cmake scripts be able to automatically discover these dependencies? (I believe the header include errors occurred when attempting to compile lldb).</div><div><br></div><div>After making these changes, an installation of clang is produced, but it does not seem to know about the standard library headers -- e.g. compilation fails when attempting to include <stdio.h>. (Note that this build was produced with 'libcxx' available in the 'llvm/projects' subdirectory). This did seem to work automagically when building with clang-3.9; has anything changed here? Is there some option I can set that says "please install + use the version of libc++ in the projects directory by default"? For reference:<br><br><div>$ clang-4.0 -E - -v < /dev/null</div><div>clang version 4.0.0 (<a href="http://llvm.org/git/clang.git" target="_blank">http://llvm.org/git/clang.git</a> 2f1019880e3fca33b8c7ac8f8bd272<wbr>e546d930ac) (<a href="http://llvm.org/git/llvm.git" target="_blank">http://llvm.org/git/llvm.git</a> 20bb0322fd381dd7e265eaa05b7fb1<wbr>c292278abe)</div><div>Target: x86_64-apple-darwin16.0.0</div><div>Thread model: posix</div><div>InstalledDir: /usr/local/bin</div><div> "/usr/local/llvm/bin/clang-4.<wbr>0" -cc1 -triple x86_64-apple-macosx10.12.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-us<wbr>age -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name - -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 274.1 -v -dwarf-column-info -debugger-tuning=lldb -resource-dir /usr/local/llvm/bin/../lib/cla<wbr>ng/4.0.0 -fdebug-compilation-dir /Users/kevin/scratch -ferror-limit 19 -fmessage-length 101 -stack-protector 1 -fblocks -fobjc-runtime=macosx-10.12.0 -fencode-extended-block-signat<wbr>ure -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o - -x c -</div><div>clang -cc1 version 4.0.0 based upon LLVM 4.0.0svn default target x86_64-apple-darwin16.0.0</div><div>ignoring nonexistent directory "/usr/include"</div><div>#include "..." search starts here:</div><div>#include <...> search starts here:</div><div> /usr/local/include</div><div> /usr/local/llvm/bin/../lib/cl<wbr>ang/4.0.0/include</div><div> /System/Library/Frameworks (framework directory)</div><div> /Library/Frameworks (framework directory)</div><div>End of search list.</div></div><div><br></div><div>For reference, I am configuring LLVM from a build directory within the LLVM project tree with:</div><div><br></div><div><div>cmake -G "Ninja" ..                                \</div><div>    -DCMAKE_C_COMPILER=/usr/bin/cl<wbr>ang              \</div><div>    -DCMAKE_C_FLAGS="${INCLUDE_FLA<wbr>GS}"             \</div><div>    -DCMAKE_CXX_COMPILER=/usr/bin/<wbr>clang++          \</div><div>    -DCMAKE_CXX_FLAGS="${INCLUDE_F<wbr>LAGS}"           \</div><div>    -DCMAKE_SHARED_LINKER_FLAGS="-<wbr>L/usr/local/lib" \</div><div>    -DCMAKE_BUILD_TYPE=Release                     \</div><div>    -DCMAKE_INSTALL_PREFIX="${LLVM<wbr>_INSTALL_DIR}"   \</div><div>    -DLLVM_ENABLE_CXX1Y=Yes                        \</div><div>    -DLLVM_ENABLE_LTO=Yes</div></div><div><br></div><div>with INCLUDE_FLAGS set with the include paths as noted before.</div><div><br></div><div>As an aside, it would be _incredibly_ helpful if a 'one-button' shell script for download, build and installation of LLVM + clang could be provided in the documentation; that is, something users could play with and tweak themselves. Or, perhaps, links to scripts used by existing projects that need to build LLVM + clang themselves?</div><div><br></div><div>Thanks,</div><div>Kevin</div></div>
<br></div></div>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div></div></div>