<div dir="ltr">Hello Tim,<div><br></div><div>Thank you so much for replying, I tried building llvm from a separate build directory inside llvm-project as described in the documentation,</div><div>now i see all the tools in the build directory at least, just couldn't figure out how do i build the specific tools lli and llc in the build directory.</div><div><br></div><div>I tried this out inside<b> llvm-project/build </b></div><div><b>cmake -G Ninja  tools/lli</b></div><div><b>cmake -G Ninja  tools/llc</b></div><div><br></div><div>but none of it worked, although the subdirectories do exist under the  llvm-project/build/tools/llc or lli </div><div><br></div><div>While building the whole llvm i had tried </div><div><br></div><div><b>cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lli;llc" ../llvm</b>  this command which resulted in the build directory getting loaded with many subdirectories including <b>tools </b>directory containing lli and llc. But still it didn't enable lli and llc even after mentioning it in the ENABLE_PROJECTS flag </div><div><br></div><div><br></div><div>Thankyou in advance! </div><div>Jagrat Patkar</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 30, 2020 at 3:33 PM Tim Northover <<a href="mailto:t.p.northover@gmail.com">t.p.northover@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Jagrat,<br>
<br>
On Sun, 29 Nov 2020 at 14:15, Jagrat Patkar via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
> I was just getting started with LLVM to create a small compiler of my own, while skimming through the docs came across the use of lli and llc in the development process, have successfully installed clang but somehow the lli and llc command are not working, I have a macOS  it is showing the error "command not found" , if I try to build lli and llc with CMake it throws this error<br>
><br>
> CMake Error at CMakeLists.txt:23 (add_llvm_tool):<br>
>   Unknown CMake command "add_llvm_tool".<br>
<br>
It sounds like you might be trying to point CMake at the llc or lli<br>
tool's own directory (/path/to/llvm-project/llvm/tools/llc). Instead<br>
CMake has to be told to start from /path/to/llvm-project/llvm, and<br>
then both llc and lli are targets you can ask it to build.<br>
<br>
There's some documentation on how to build LLVM (what options you<br>
might want and so on). <a href="https://llvm.org/docs/GettingStarted.html" rel="noreferrer" target="_blank">https://llvm.org/docs/GettingStarted.html</a>, and<br>
<a href="https://llvm.org/docs/CMake.html" rel="noreferrer" target="_blank">https://llvm.org/docs/CMake.html</a>.<br>
<br>
Cheers.<br>
<br>
Tim.<br>
</blockquote></div>