# Ocamlobjinfo Interfaces vs. Implementations

**URL:** <https://discuss.ocaml.org/t/ocamlobjinfo-interfaces-vs-implementations/5156>\
**Category:** Learning\
**Tags:** build\
**Created:** [February 13, 2020, 4:46pm UTC](https://discuss.ocaml.org/t/ocamlobjinfo-interfaces-vs-implementations/5156 "2020-02-13T16:46:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![olafhering](https://avatars.discourse-cdn.com/v4/letter/o/a4c791/32.png) [@olafhering](https://discuss.ocaml.org/u/olafhering)\
**Post date:** [February 13, 2020, 4:46pm UTC](https://discuss.ocaml.org/t/ocamlobjinfo-interfaces-vs-implementations/5156/1 "2020-02-13T16:46:37Z")

</div>

I’m in the process of updating the rpm Provides/Requires generator for OCaml files to handle also `*.cmx*` files.

I wonder why cma/cmi/cmo have just Interfaces, while cmx/cmxa/cmxs have both Interfaces and Implementations according to the `ocamlobjinfo some.cmxa` output. What does `Implementation` mean in this context?

---

<div class="post-metadata">

**Author:** ![yawaramin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/yawaramin/32/3384_2.png) [@yawaramin](https://discuss.ocaml.org/u/yawaramin)\
**Post date:** [February 13, 2020, 7:12pm UTC](https://discuss.ocaml.org/t/ocamlobjinfo-interfaces-vs-implementations/5156/2 "2020-02-13T19:12:39Z")

</div>

Hello, have you seen this: [https://www.redhat.com/archives/fedora-packaging/2007-May/msg00105.html](https://www.redhat.com/archives/fedora-packaging/2007-May/msg00105.html)

---

<div class="post-metadata">

**Author:** ![olafhering](https://avatars.discourse-cdn.com/v4/letter/o/a4c791/32.png) [@olafhering](https://discuss.ocaml.org/u/olafhering)\
**Post date:** [February 13, 2020, 8:04pm UTC](https://discuss.ocaml.org/t/ocamlobjinfo-interfaces-vs-implementations/5156/3 "2020-02-13T20:04:21Z")

</div>

I have not seen this (very old) discussion. Neither do I see how this thread would answer my question.

---

<div class="post-metadata">

**Author:** ![vlaviron](https://avatars.discourse-cdn.com/v4/letter/v/ec9cab/32.png) [@vlaviron](https://discuss.ocaml.org/u/vlaviron)\
**Post date:** [February 14, 2020, 10:00am UTC](https://discuss.ocaml.org/t/ocamlobjinfo-interfaces-vs-implementations/5156/4 "2020-02-14T10:00:15Z")

</div>

The bytecode compiler doesn’t do cross-module optimisations, so all it needs to know about other modules is their type (so `.cmi` files).  
The native compiler (both the default one and the flambda-enabled version) actually reads and exports information about implementations, and so the produced `.cmx` file records which other `.cmx` files it looked into during compilation. This allows checking at link time that every module is linked with the versions it was compiled against.
