2

Im creating a custom programming language using python, PLY as lexer and parser, and LLVMlite as low level intermediate language to do code generation. I have installed PLY and LLC using Python pip

I use LLC to create a object file output.o, and GCC to create the final executable file as follows.

$ llc -filetype=obj output.ll
$ gcc output.o -o output

When im executing llc -filetype=obj output.ll i get

llc : The term 'llc' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included,  
verify that the path is correct and try again.
At line:1 char:1
+ llc -filetype=obj output.ll
    + CategoryInfo          : ObjectNotFound: (llc:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

I have spent hours on this but cant figure out. What is wrong?

user207421
  • 305,947
  • 44
  • 307
  • 483
lefir
  • 21
  • 1
  • Sounds like `llc` isnt in your PATH. – Colonel Thirty Two Mar 11 '21 at 16:04
  • 1
    The `llc` python package you installed with pip has nothing to do with llvm. It's a completely different product which happens to have the same name. You need to follow the LLVM installation instructions. – rici Mar 11 '21 at 16:25

1 Answers1

0

The PyPi package llc has nothing to do with LLVM's llc tool. You can't install the latter via pip because it's not a Python package. You need to install the LLVM tools to get it.

sepp2k
  • 363,768
  • 54
  • 674
  • 675