Install LLVM OCaml bindings (and UTop)

I put on a Stackoverflow answer here

  1. Build LLVM with configuration: --with-ocaml-libdir =ocamlc -where``

  2. To compile LLVM codes: ocamlc -cc g++ llvm.cma test.ml -o test

  3. To make UTop work:

    • create a myutop_main.ml file with: let () = UTop_main.main ()

    • create a custom llvmutop: ocamlfind ocamlmktop -o llvmutop -thread -linkpkg -package utop llvm.cma myutop_main.ml -cc g++

  4. If you just want OCaml's build-in toplevel:

    • ocamlmktop -o llvmtop llvm.cma -cc g++

Comments

Comments powered by Disqus