llvm OCaml绑定 [英] llvm OCaml bindings

查看:94
本文介绍了llvm OCaml绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理llvm OCaml绑定.

I'm working on llvm OCaml bindings.

我通过opam(opam install llvm)安装了llvm软件包,当我在utop中使用llvm时,出现以下错误:

I installed llvm package through opam (opam install llvm), when I use llvm in utop, I get the following error:

#require "llvm";;
Error: The external function 'llvm_global_succ' is not available. 

opam llvm版本是3.2.

The opam llvm version is 3.2.

我还尝试从官方站点(./configure --with-ocaml-libdir='ocamlc -where')构建llvm3.3,构建成功(所有llvm命令行工具都在工作),但是在utop中出现了相同的错误.

I also tried building llvm3.3 from the official site (./configure --with-ocaml-libdir='ocamlc -where'), the build was successful (all the llvm command-line tools are working), but I got the same error in utop.

我在Mac OS 10.7.5上.

I'm on Mac OS 10.7.5.

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

然后启动llvmtop,您可以在open Llvm之后使用llvm绑定.

Then launch llvmtop, you can use llvm bindings after open Llvm.

我还没有找到等同于utop的东西.

I haven't found an equivalent for utop yet..

感谢utop文档此处

  1. 创建一个myutop_main.ml文件:

let () = UTop_main.main ()

创建具有llvm绑定的自定义utop:

create a custom utop with llvm bindings:

ocamlfind ocamlmktop -o llvmutop -thread -linkpkg -package utop -package llvm myutop_main.ml -cc g++

推荐答案

(要求我回答自己的问题...)

(as I'm asked to answer my own question...)

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

然后启动llvmtop,您可以在open Llvm之后使用llvm绑定.

Then launch llvmtop, you can use llvm bindings after open Llvm.

我还没有找到等同于utop的东西.

I haven't found an equivalent for utop yet..

感谢utop文档此处

  1. 创建一个myutop_main.ml文件:

let () = UTop_main.main ()

创建具有llvm绑定的自定义utop:

create a custom utop with llvm bindings:

ocamlfind ocamlmktop -o llvmutop -thread -linkpkg -package utop -package llvm myutop_main.ml -cc g++

这篇关于llvm OCaml绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆