3

How to build with enabled profile information using Ocamlbuild? It seems -p doesn't work there.

Now, I use ocamlopt for this. For example,

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

How to do the same with

ocamlbuild -user-ocamlfind test.native
Stas
  • 11,571
  • 9
  • 40
  • 58

1 Answers1

6

You can pass the argument explicitly,

ocamlbuild -cflags -p

or in your _tags file,

true : profile

There is also a rule for the file-name,

ocamlbuild test.p.native
nlucaroni
  • 47,556
  • 6
  • 64
  • 86
  • `ocamlbuild -cflags -p` doesn't work on my machine. This is exactly what I tried to do. It seems `-cflags` is for `ocamlc` only. `test.p.native` and `true : profile` work as expected. Thanks a lot! – Stas Feb 09 '13 at 06:10