Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005282OCamlOCamlbuild (the tool)public2011-06-04 14:282014-05-25 20:20
ReporterCamarade_Tux 
Assigned Toxclerc 
PrioritynormalSeverityminorReproducibilityalways
StatusassignedResolutionno change required 
PlatformOSOS Version
Product Version3.12.0 
Target Version4.02.0+devFixed 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 a.ml
  % ocamlbuild -classic-display a.native
  /opt/ocaml/bin/ocamldep.opt -modules a.ml > a.ml.depends
  /opt/ocaml/bin/ocamlc.opt -c -o a.cmo a.ml # calls ocamlc.opt
  /opt/ocaml/bin/ocamlopt.opt -c -o a.cmx a.ml
  /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 0004613resolvedgasche Tries to build cmo files for native target(s) 

-  Notes
(0005982)
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.
(0007384)
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?
(0009540)
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?
(0009945)
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


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker