OCaml llvm “Unbound module ExecutionEngine”

我们两清 提交于 2020-01-06 04:00:46

问题


I made a post here (ocaml llvm kaleidoscope tutorial "Unbound module LlvmExecutionEngine") but that issue does not seem present on my mac which I have switched to.

I'm trying to get this to work: https://github.com/llvm-mirror/llvm/tree/master/examples/OCaml-Kaleidoscope/Chapter7

from this tutorial http://llvm.org/docs/tutorial/OCamlLangImpl7.html

(I'm 99% sure these two are by the same people)

After getting around a few issues I have reached a stumbling block for the last few hours of

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.

I'm pretty sure llvm_executionengine is the right package as if I try something else it says it doesn't know what package it is.

Here is the line of code with the error:

    (* 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); 

Any help would be super!


回答1:


ocamlfind's CLI doesn't work like that. -package llvm -package llvm.execution should work.



来源:https://stackoverflow.com/questions/37060290/ocaml-llvm-unbound-module-executionengine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!