Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005282OCamlOCamlbuild (the tool)public2011-06-04 14:282015-12-02 16:05
Assigned Toxclerc 
StatusassignedResolutionno change required 
PlatformOSOS Version
Product Version3.12.0 
Target VersionlaterFixed in Version 
Summary0005282: .cmo files are generated even for native compilation
DescriptionWhen compiling native targets, ocamlbuild also compiles .cmo files.

Example on an empty folder:

  % touch
  % ocamlbuild -classic-display a.native
  /opt/ocaml/bin/ocamldep.opt -modules >
  /opt/ocaml/bin/ocamlc.opt -c -o a.cmo # calls ocamlc.opt
  /opt/ocaml/bin/ocamlopt.opt -c -o a.cmx
  /opt/ocaml/bin/ocamlopt.opt a.cmx -o a.native

With many more complex files, this can lead to a substantial slow-down.
TagsNo tags attached.
Attached Files

- Relationships
duplicate of 0004613closedgasche Tries to build cmo files for native target(s) 

-  Notes
ertai (developer)
2011-06-05 15:12

We acknowledge this is a limitation. However this is not a bug, it is a design choice with a simple and recommendable workaround. Indeed you observe this behavior only because you have no .mli for this file. There is technical reasons to not accept .cmi to be generated by both ocamlc and ocamlopt. So we impose them to be always generated by ocamlc. If you have a .mli then you see no drawbacks of this method.

In short we recommend you the good practice of having .mli files.
goswin (reporter)
2012-04-22 01:34

"There is technical reasons to not accept .cmi to be generated by both ocamlc and ocamlopt."

So for the sake of documenting this what are those reasons?
glondu (reporter)
2013-06-17 17:28

What about having a command (or command-line option to an existing one) generating only the .cmi (and not .cmo) for a .ml file?
gasche (developer)
2013-07-28 22:37

One problem with having both ocamlc and ocamlopt produce .cmi files is discussed in PR#4991: it creates a race condition during parallel builds.

- Issue History
Date Modified Username Field Change
2011-06-04 14:28 Camarade_Tux New Issue
2011-06-05 15:12 ertai Note Added: 0005982
2011-06-05 15:12 ertai Status new => acknowledged
2011-06-05 15:12 ertai Resolution open => no change required
2011-06-06 09:08 xclerc Relationship added duplicate of 0004613
2011-06-06 09:09 xclerc Status acknowledged => assigned
2011-06-06 09:09 xclerc Assigned To => xclerc
2012-02-02 15:17 protz Category OCamlbuild => OCamlbuild (the tool)
2012-04-22 01:34 goswin Note Added: 0007384
2012-07-06 16:22 doligez Target Version => 4.01.0+dev
2012-07-06 16:23 doligez Severity major => minor
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-20 16:22 doligez Target Version 4.00.1+dev => 4.01.0+dev
2013-06-17 15:55 gasche Target Version 4.01.0+dev => 4.02.0+dev
2013-06-17 17:28 glondu Note Added: 0009540
2013-07-12 18:15 doligez Target Version 4.02.0+dev => 4.01.1+dev
2013-07-28 22:37 gasche Note Added: 0009945
2014-05-25 20:20 doligez Target Version 4.01.1+dev => 4.02.0+dev
2014-08-20 18:58 doligez Target Version 4.02.0+dev => 4.03.0+dev / +beta1
2015-12-02 16:05 gasche Target Version 4.03.0+dev / +beta1 => later

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker