OCaml runtimes Last updated Feb 11, 2025

Overview

What is a "runtime"?

You can see how the runtimes are linked by passing -verbose.

The standard distribution comes with the following libraries:

Native

  • libasmrun.a - the standard runtime library

  • libasmrund.a - debug runtime

  • libasmruni.a - instrumented runtime

  • libasmrun_pic.a - undocumented

  • libasmrun_shared.so - undocumented

Bytecode

  • libcamlrun.a - the standard runtime library

  • libcamlrund.a - debug runtime

  • libcamlruni.a - instrumented runtime

  • libcamlrun_pic.a - undocumented

  • libcamlrun_shared.so - undocumented

In addition to the runtime libraries listed above, the standard distribution includes similar variations of the VM (interpreter):

  • ocamlrun - the standard interpreter

  • ocamlrund - debug interpreter

  • ocamlruni - instrumented instrumented

I think this just means that the interpreter was linked with one of the libs listed above, but I’m not sure.

Debug runtime

  • -runtime-variant d works for all four compilers?

For bytecode executables, running with ocamlrund has the same effect?

Instrumented runtime

  • -runtime-variant i

Manual: