Reputation: 1071
I am trying to compile the following llvm ir code:
define i32 @main() #0 {
ret i32 42
}
The above code is stored in a file called main.ll
Then, I run "llc main.ll" in a command prompt, but I get the error message "'llc' is not recognized as an internal or external command, operable program or batch file."
I have checked that the bin folder from my llvm installation folder is included in the PATH environment variable. The issue though is that there is no file called "llc". I am not that kind of expert to know any other ways to register commands to be used by the command prompt, so in my eyes, I do not have the right files.
I downloaded the installer from both http://releases.llvm.org/ and http://releases.llvm.org/download.html#5.0.0 (pre-built binaries) (which seemed to be the same), but neither included the llc file.
So, my question is, where do I get the right files, or what else am I doing wrong?
(I am using Windows just in case anyone was wondering)
edit
The issue here is that the llc.bat file just doesnt exist.
It could be that this issue has the same reason: https://github.com/android-ndk/ndk/issues/432
However, they dont state alternatives or where to get the llc.bat file elsewhere.
So, new question: Where do I get the llc.bat file or what else do I use to make the llvm compiler compile llvm ir code?
Upvotes: 5
Views: 4788
Reputation: 940
The llc tool isn't provided in the Windows installation. Why? I'm not sure, it compiles and runs just fine in Windows, but simply isn't distributed. I spent the time and effort cloning and building the project myself, and that's the official answer for what you should do to obtain the exe.
But if you trust me and are willing to run executables from strangers on the internet, then you can just download the 10.0.0 version that I compiled here, and put it in your bin folder: https://github.com/LadyCailin/MethodScriptExtra/tree/master/installers/llvm/10.0.0/llc
I'll also probably be maintaining other versions in the future, but the releases will be sporadic, but feel free to check https://github.com/LadyCailin/MethodScriptExtra/tree/master/installers for other possible versions. 12.0.1 is up now, including some additional tools that were missing.
Upvotes: 4