2

我使用 python 创建自定义编程语言,PLY 作为词法分析器和解析器,LLVMlite 作为低级中间语言来进行代码生成。我已经使用 Python pip 安装了 PLY 和 LLC

我使用 LLC 创建目标文件 output.o,并使用 GCC 创建最终的可执行文件,如下所示。

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

当我执行时llc -filetype=obj output.ll我得到

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

我已经花了几个小时在这上,但无法弄清楚。怎么了?

4

1 回答 1

0

PyPi包 llcllc与 LLVM 的工具无关。您不能通过安装后者,pip因为它不是 Python 包。您需要安装 LLVM 工具才能获得它。

于 2021-03-11T16:39:57.573 回答