Debian OCaml Packaging Policy for OCaml 3.09.2 | ||
---|---|---|
Prev | Chapter 1. Generalities about OCaml packages in Debian | Next |
The OCaml compiler can produce two kinds of executables: bytecode and native. The native executables (compiled with ocamlopt) are generally faster since they are compiled specifically for an achitecture. The bytecode executables (compiled with ocamlc) have the advantage of being portable, which means that a bytecode program can be run on any achitecture without needing to be rebuilt. It should be noted that native OCaml compilers are not provided for every achitecture. Only the following are suported: alpha, amd64, arm, i386, ia64, kfreebsd-i386, powerpc, sparc.
Packages providing both native and bytecode versions of a program prog usually name them respectively prog.opt and prog.byte and provide a symbolic link prog to the best available version (generally prog.opt).
The ocaml-native-compilers package contains the OCaml compiler built in native mode (ocamlc.opt, which outputs bytecode, and ocamlopt.opt, which output native code). Compiling with those versions of the compilers is generally faster. Unfortunately the ocaml-native-compilers package is not available on every architecture. Packages should therefore never depend directly on this package. In order to build big programs and benefit from this natively built compiler, packages should depend on ocaml-best-compilers which itself depends on ocaml-native-compilers where available and on ocaml elsewhere. Since it is a virtual package, it cannot (yet) be a versioned dependency. The version dependency should thus be carried by the ocaml dependency.