Aaron via llvm-dev
2018-May-11 03:33 UTC
[llvm-dev] About Error: Interpreter has not been linked in
Hello, When I try to create execution engine I do get "*Interpreter has not been linked in.*" error and EngineBuilder returns NULL. Here is the line I use to create execution engine: auto executionEngine llvm::EngineBuilder(std::move(m_module)).setErrorStr(&error).create(); Here are all headers I have included: #include "llvm/ADT/STLExtras.h" #include "llvm/ExecutionEngine/ExecutionEngine.h" #include "llvm/ExecutionEngine/GenericValue.h" #include "llvm/IR/Argument.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Constants.h" #include "llvm/IR/DerivedTypes.h" #include "llvm/IR/Function.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" #include "llvm/IR/Type.h" #include "llvm/IR/Verifier.h" #include "llvm/Support/Casting.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/TargetSelect.h" #include "llvm/Support/raw_ostream.h" And here is the simple IR code that I'm trying to JIT compile and execute in memory: ; ModuleID = 'Program' source_filename = "Program" define i32 @fib(i32) { entry: %i = alloca i32 store i32 %0, i32* %i ret i32* %i } Could someone please tell the reason and how I can resolve this? Thanks for helping! Best, Aaron -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180510/a3d32561/attachment.html>
Aaron via llvm-dev
2018-May-11 04:21 UTC
[llvm-dev] About Error: Interpreter has not been linked in
Ok. I figured out. Following methods needs to be called. That fixed the issue. llvm::InitializeNativeTarget(); LLVMInitializeNativeAsmPrinter(); LLVMInitializeNativeAsmParser(); LLVMLinkInMCJIT(); Aaron On Thu, May 10, 2018 at 8:33 PM, Aaron <acraft at gmail.com> wrote:> Hello, > > When I try to create execution engine I do get "*Interpreter has not been > linked in.*" error and EngineBuilder returns NULL. > > Here is the line I use to create execution engine: > > auto executionEngine = llvm::EngineBuilder(std::move( > m_module)).setErrorStr(&error).create(); > > Here are all headers I have included: > > #include "llvm/ADT/STLExtras.h" > #include "llvm/ExecutionEngine/ExecutionEngine.h" > #include "llvm/ExecutionEngine/GenericValue.h" > #include "llvm/IR/Argument.h" > #include "llvm/IR/BasicBlock.h" > #include "llvm/IR/Constants.h" > #include "llvm/IR/DerivedTypes.h" > #include "llvm/IR/Function.h" > #include "llvm/IR/IRBuilder.h" > #include "llvm/IR/Instructions.h" > #include "llvm/IR/LLVMContext.h" > #include "llvm/IR/Module.h" > #include "llvm/IR/Type.h" > #include "llvm/IR/Verifier.h" > #include "llvm/Support/Casting.h" > #include "llvm/Support/ManagedStatic.h" > #include "llvm/Support/TargetSelect.h" > #include "llvm/Support/raw_ostream.h" > > > And here is the simple IR code that I'm trying to JIT compile and execute > in memory: > > ; ModuleID = 'Program' > source_filename = "Program" > > define i32 @fib(i32) { > entry: > %i = alloca i32 > store i32 %0, i32* %i > ret i32* %i > } > > > Could someone please tell the reason and how I can resolve this? > > Thanks for helping! > > Best, > > Aaron > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180510/b8746737/attachment.html>
mayuyu.io via llvm-dev
2018-May-11 05:31 UTC
[llvm-dev] About Error: Interpreter has not been linked in
I believe the correct way is actually include the Interpreter’s header and the rest is handled automatically. Should be similar for MCJIT Zhang> On 11 May 2018, at 05:21, Aaron via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Ok. I figured out. Following methods needs to be called. That fixed the issue. > > llvm::InitializeNativeTarget(); > LLVMInitializeNativeAsmPrinter(); > LLVMInitializeNativeAsmParser(); > LLVMLinkInMCJIT(); > > Aaron > > >> On Thu, May 10, 2018 at 8:33 PM, Aaron <acraft at gmail.com> wrote: >> Hello, >> >> When I try to create execution engine I do get "Interpreter has not been linked in." error and EngineBuilder returns NULL. >> >> Here is the line I use to create execution engine: >> >> auto executionEngine = llvm::EngineBuilder(std::move(m_module)).setErrorStr(&error).create(); >> >> Here are all headers I have included: >> >> #include "llvm/ADT/STLExtras.h" >> #include "llvm/ExecutionEngine/ExecutionEngine.h" >> #include "llvm/ExecutionEngine/GenericValue.h" >> #include "llvm/IR/Argument.h" >> #include "llvm/IR/BasicBlock.h" >> #include "llvm/IR/Constants.h" >> #include "llvm/IR/DerivedTypes.h" >> #include "llvm/IR/Function.h" >> #include "llvm/IR/IRBuilder.h" >> #include "llvm/IR/Instructions.h" >> #include "llvm/IR/LLVMContext.h" >> #include "llvm/IR/Module.h" >> #include "llvm/IR/Type.h" >> #include "llvm/IR/Verifier.h" >> #include "llvm/Support/Casting.h" >> #include "llvm/Support/ManagedStatic.h" >> #include "llvm/Support/TargetSelect.h" >> #include "llvm/Support/raw_ostream.h" >> >> >> And here is the simple IR code that I'm trying to JIT compile and execute in memory: >> >> ; ModuleID = 'Program' >> source_filename = "Program" >> >> define i32 @fib(i32) { >> entry: >> %i = alloca i32 >> store i32 %0, i32* %i >> ret i32* %i >> } >> >> >> Could someone please tell the reason and how I can resolve this? >> >> Thanks for helping! >> >> Best, >> >> Aaron >> > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180511/a195161e/attachment.html>