[llvm-dev] Unable to get started with LLI and LLC

Jagrat Patkar via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 1 18:09:04 PST 2020


Hello Tim,

Thank you so much for replying, I tried building llvm from a separate build
directory inside llvm-project as described in the documentation,
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.

I tried this out inside* llvm-project/build *
*cmake -G Ninja  tools/lli*
*cmake -G Ninja  tools/llc*

but none of it worked, although the subdirectories do exist under the
llvm-project/build/tools/llc or lli

While building the whole llvm i had tried

*cmake -G Ninja -DLLVM_ENABLE_PROJECTS="clang;lli;llc" ../llvm*  this
command which resulted in the build directory getting loaded with many
subdirectories including *tools *directory containing lli and llc. But
still it didn't enable lli and llc even after mentioning it in the
ENABLE_PROJECTS flag


Thankyou in advance!
Jagrat Patkar

On Mon, Nov 30, 2020 at 3:33 PM Tim Northover <t.p.northover at gmail.com>
wrote:

> Hi Jagrat,
>
> On Sun, 29 Nov 2020 at 14:15, Jagrat Patkar via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > 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
> >
> > CMake Error at CMakeLists.txt:23 (add_llvm_tool):
> >   Unknown CMake command "add_llvm_tool".
>
> It sounds like you might be trying to point CMake at the llc or lli
> tool's own directory (/path/to/llvm-project/llvm/tools/llc). Instead
> CMake has to be told to start from /path/to/llvm-project/llvm, and
> then both llc and lli are targets you can ask it to build.
>
> There's some documentation on how to build LLVM (what options you
> might want and so on). https://llvm.org/docs/GettingStarted.html, and
> https://llvm.org/docs/CMake.html.
>
> Cheers.
>
> Tim.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20201202/e3915a64/attachment.html>


More information about the llvm-dev mailing list