<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"><span>I have solved my own problem. For now, I have done it q&d way, just vi-ed the two offending files:</span></div><div style="background-color: transparent;"><ol><li><span style="background-color: transparent;">Options.td</span><br></li><li><span style="background-color: transparent; font-size: 16px;">CC1AsOptions.td</span><br></li></ol></div><div style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>Will properly fix the CMakeLists.txt later. </span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br></span></div><div style="font-family: arial, helvetica,
sans-serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>So, yes, clang 3.4 can indeed be built with LLVM + compiler-rt 3.4 already installed on the system. But the documentation (and likely the code) needs some more work.</span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br></span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 16px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;">--Zack</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"><br></div> <div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1"> <font size="2" face="Arial"> <b><span
style="font-weight:bold;">From:</span></b> Zack Perry <zack.perry@sbcglobal.net><br> <b><span style="font-weight: bold;">To:</span></b> "cfe-dev@cs.uiuc.edu" <cfe-dev@cs.uiuc.edu> <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, March 14, 2014 1:24 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Help with compiling clang 3.4 standalone with cmake and already installed LLVM+compiler-rt 3.4<br> </font> </div> <div class="y_msg_container"><br>
<div id="yiv1484131023"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: 'Courier New', courier, monaco, monospace, sans-serif; font-size: 12pt;"><div><span style="font-family: 'Times New Roman'; font-size: 12pt; background-color: transparent;">I have been attempting to build clang 3.4 standalone as hinted in comments embedded in its top-level CMakeLists.txt with cmake on a Ubuntu 12.04 LTS 64bit host without success. The build host already has LLVM 3.4 + compiler-rt 3.4 installed with our self-built DEB. Both were built using clang 3.3 that we built last year. Everything is linked with libc++, no libstdc++ dependency anywhere. libc++abi is used throughout.</span><br></div><div style="font-family: 'Times New Roman'; font-size: medium;"><br></div><div style="font-family: 'Times New Roman';"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0,
0);">zperry@node1:~/work/llvm/clang3.4/_tars/clang-3.4/build$ make -j 2</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">Scanning dependencies of target ClangDriverOptions</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">Scanning dependencies of target clang-tblgen</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">[ 0%] Building Options.inc...</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">[ 0%]
/home/zperry/work//llvm/clang3.4/_tars/clang-3.4/include/clang/Driver/Options.td:15:9: error: Could not find include file 'llvm/Option/OptParser.td'</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">include "llvm/Option/OptParser.td"</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);"> ^</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">/home/zperry/work/llvm/clang3.4/_tars/clang-3.4/include/clang/Driver/Options.td:15:9: error: Unexpected input at top level</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span
style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">include "llvm/Option/OptParser.td"</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);"> ^</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">make[2]: *** [include/clang/Driver/Options.inc.tmp] Error 1</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">make[1]: *** [include/clang/Driver/CMakeFiles/ClangDriverOptions.dir/all] Error 2</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New',
courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">make[1]: *** Waiting for unfinished jobs....</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">[ 0%] Building CXX object utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangAttrEmitter.cpp.o</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">Building CXX object utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangASTNodesEmitter.cpp.o</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">[ 0%] Building CXX object
utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangCommentCommandInfoEmitter.cpp.o</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">[ 0%] Building CXX object utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp.o</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">[ 1%] Building CXX object utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangCommentHTMLTagsEmitter.cpp.o</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">[ 1%] Building CXX object
utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangDiagnosticsEmitter.cpp.o</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">[ 1%] Building CXX object utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangSACheckersEmitter.cpp.o</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">[ 1%] Building CXX object utils/TableGen/CMakeFiles/clang-tblgen.dir/NeonEmitter.cpp.o</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">[ 1%] Building CXX object utils/TableGen/CMakeFiles/clang-tblgen.dir/TableGen.cpp.o</span></div><div style="font-family: 'Times New Roman';
font-size: medium;"><span style="font-family: 'Courier New', courier, monaco, monospace, sans-serif; color: rgb(192, 0, 0);">Linking CXX executable /home/zperry/work/llvm/clang3.4/_tars/llvm-3.4/build/bin/clang-tblgen</span></div><div><span><br></span></div><div style="font-family: 'Times New Roman'; background-color: transparent;"><span style="font-family: arial, helvetica, sans-serif;">But, the "missing" include file is on the system:</span></div><div style="background-color: transparent; font-family: arial, helvetica, sans-serif;"><span><br></span></div><div style="font-family: 'Times New Roman'; font-size: medium; background-color: transparent;"><span style="color: rgb(192, 0, 0); font-family: 'Courier New', courier, monaco, monospace, sans-serif;">zperry@node1:~/work/llvm/clang3.4/_tars/clang-3.4/build$ ls -l /usr/include/llvm/Option/OptParser.td </span></div><div style="font-family: 'Times New Roman'; font-size: medium; background-color:
transparent;"><span style="color: rgb(192, 0, 0); font-family: 'Courier New', courier, monaco, monospace, sans-serif;">-rw-r--r-- 1 root root 4803 Aug 13 2013 /usr/include/llvm/Option/OptParser.td</span></div><div style="font-family: 'Times New Roman'; font-size: medium;"><br></div><div style="font-family: 'Times New Roman'; background-color: transparent;"><span style="font-family: arial, helvetica, sans-serif;">I played with both CXXFLAGS and the LLVM_MAIN_SRC_DIR to no avail and would appreciate any hints.</span></div><div style="font-family: arial, helvetica, sans-serif; background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-style: normal;"><span style="font-family: arial, helvetica, sans-serif;"><br></span></div><div style="font-family: arial, helvetica, sans-serif; background-color: transparent; color: rgb(0, 0, 0); font-size: 16px; font-style: normal;"><span style="font-family: arial, helvetica, sans-serif;">A related
question: is using cmake to build LLVM projects going to be supported in the future at all? So far, using cmake for building various project is not as extensively documented as GNU autotools based approach?</span></div><div style="font-family: 'Times New Roman'; background-color: transparent;"><span style="font-family: arial, helvetica, sans-serif;"><br></span></div><div style="font-family: 'Times New Roman'; background-color: transparent;"><span style="font-family: arial, helvetica, sans-serif;">-- Zack</span></div><div><span style="font-family: arial, helvetica, sans-serif;"><br></span></div></div></div></div><br><br></div> </div> </div> </div></body></html>