What is the recommended way to use the native code profiler in a Dune project? There is an open issue but the proposed workaround is not clear. The problem is that rather than ocamlopt
a different compiler must be invoked.
I believe a potential easy way is to define a profile in a top-level dune
file that adds the -p
flag to the invocation of ocamlopt
which is equivalent with calling ocamloptp
.
(env
(profile
(ocamlopt_flags (:standard -p -w -27-32-52-33-34-37-39))
(flags (:standard -w -27-32-52-33-34-37-39)))
(dev
(flags (:standard -w -27-32-52-33-34-37-39)))
(release
(flags (:standard -w -27-32-52-33-34-37-39))))
There seems to be a problem with using -p
on macOS – reported here – which I also ran into.