OCaml llvm“Unbound module ExecutionEngine”

时间:2016-05-05 21:07:28

标签: compiler-construction ocaml llvm executionengineexception

我在这里发了一个帖子(ocaml llvm kaleidoscope tutorial "Unbound module LlvmExecutionEngine")但是我的mac上似乎没有出现这个问题。

我正试图让它发挥作用: https://github.com/llvm-mirror/llvm/tree/master/examples/OCaml-Kaleidoscope/Chapter7

来自本教程 http://llvm.org/docs/tutorial/OCamlLangImpl7.html

(我99%肯定这两个人是同一个人)

在解决了几个问题之后,我已经达到了过去几个小时的绊脚石

dyn-160-39-160-188:Chapter7 me$ ocamlbuild -use-ocamlfind toy.byte -package llvm llvm_executionengine
Finished, 0 targets (0 cached) in 00:00:00.
+ ocamlfind ocamlc -c -package llvm -o toplevel.cmo toplevel.ml
File "toplevel.ml", line 37, characters 25-53:
Error: Unbound module ExecutionEngine
Command exited with code 2.
Compilation unsuccessful after building 13 targets (12 cached) in 00:00:00.

我很确定llvm_executionengine是正确的包,好像我尝试了别的东西,它说它不知道它是什么包。

以下是包含错误的代码行:

    (* JIT the function, returning a function pointer. *)
    let result = ExecutionEngine.run_function the_function [||] (*this line*)
      the_execution_engine in

    print_string "Evaluated to ";
    print_float (GenericValue.as_float Codegen.double_type result); 

任何帮助都是超级的!

1 个答案:

答案 0 :(得分:1)

ocamlfind的CLI不能那样工作。 -package llvm -package llvm.execution应该有用。

相关问题