Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004389OCamlOCaml generalpublic2007-09-13 13:452007-11-06 16:53
Reporterpascal_cuoq 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionwon't fix 
PlatformOSOS Version
Product Version3.10.0 
Target VersionFixed in Version 
Summary0004389: ocamldep generates cmx -> cmx dependencies
Descriptionocamldep generates dependencies as if native separate compilation did not exist.
That is, with the files :
a.ml:
let x = 1 ;;
a.mli:
val x : int
b.ml:
print_int A.x

The command "ocamldep a.ml a.mli b.ml" generates the dependency:
b.cmx: a.cmx

The dependencies for b.cmo reflect the expected behaviour of
actual separate compilation:
b.cmo: a.cmi

If "ocamlopt" can always handle the link of a.cmx and b.cmx even if a.cmx was built
after b.cmx, this report is a feature request for a "-separate-native-compilation"
option to "ocamldep", that would generate "b.cmx : a.cmi" only in this case.

If "ocamlopt" can not always handle the link of a.cmx and b.cmx if a.cmx was built after
b.cmx (with a.cmi unchanged), this report is a feature request for making this possible,
and then adding the "-separate-native-compilation" option to ocamldep.

Rationale :

Native compilation is faster than bytecode for the case "make big_project regression_tests",
but separate native compilation would be even faster, because a lot of time
is spent in "make big_project" even for small changes.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0004241)
xleroy (administrator)
2007-11-06 16:53

> If "ocamlopt" can always handle the link of a.cmx and b.cmx even
> if a.cmx was built after b.cmx,

Unfortunately, no. This would break cross-module optimizations -- that's the main reason why, with ocamlopt, the implementation of a module A depends on the implementations (not just the interfaces) of A's imported modules.

What you suggest would also require an ocamlopt flag to turn off cross-module optimizations, and perhaps additional link-time checks to validate mixtures of .cmx files compiled with and without cross-module optimizations. I'm not keen to implement this, as I don't see many scenarios where it would be useful.

- Issue History
Date Modified Username Field Change
2007-09-13 13:45 pascal_cuoq New Issue
2007-11-06 16:53 xleroy Note Added: 0004241
2007-11-06 16:53 xleroy Status new => closed
2007-11-06 16:53 xleroy Resolution open => won't fix


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker