【问题标题】:Build native executable with profile information using Ocamlbuild使用 Ocamlbuild 使用配置文件信息构建本机可执行文件
【发布时间】:2013-01-24 15:20:01
【问题描述】:

如何使用 Ocamlbuild 使用启用的配置文件信息进行构建?看来-p 在那里不起作用。

现在,我为此使用ocamlopt。例如,

$ ocamlfind ocamlopt -c -p -thread -package core test.ml
$ ocamlfind ocamlopt -p -o test -thread -package core -linkpkg test.cmx

如何做到这一点

ocamlbuild -user-ocamlfind test.native

【问题讨论】:

    标签: ocaml ocamlbuild ocamlfind


    【解决方案1】:

    你可以显式传递参数,

    ocamlbuild -cflags -p
    

    或在您的 _tags 文件中,

    true : profile
    

    文件名也有一个规则,

    ocamlbuild test.p.native
    

    【讨论】:

    • ocamlbuild -cflags -p 在我的机器上不起作用。这正是我试图做的。似乎-cflags 仅适用于ocamlc。 test.p.native 和 true : profile 按预期工作。非常感谢!
    猜你喜欢
    • 1970-01-01
    • 2011-12-12
    • 1970-01-01
    • 1970-01-01
    • 2011-06-08
    • 2013-12-26
    • 1970-01-01
    • 1970-01-01
    • 2010-11-11
    相关资源
    最近更新 更多