[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

.cmx inclusion in modules



	Hi all !

This information came to me, thanks to ocaml-magic developper's sagacity: 
ocaml modules should ship both .cmxa and .cmx. 

Not shipping .cmx files is not a big issue, but it prevents some compiler 
optimisations..

Here's the link:
http://alan.petitepomme.net/cwn/2006.09.19.html#4
"Chris King asked and Jacques Garrigue answered:
> I remember hearing somewhere that by exposing .cmx files, the compiler 
> is able to inline across module boundaries, and thus distributing .cmx 
> files is desirable.  Is this just a myth?  It seems redundant since 
> the .cmx files are included in the .cmxa anyway. 

This is a frequent confusion. The .cmxa does not contain all the 
information from the .cmx, in particular not the inlining 
information. This is natural if you think of it: when you compile a 
module, you have no way to know in which library are its dependencies, 
so you can only look for .cmx's, not for .cmxa's. The .cmxa's are only 
used at link time. 
You can still compile without the .cmx's, but you loose the 
optimizations."

Hope this can be usefull to some of you..

We could even think about mass bug submission about this don't you think ?

Romain
-- 
In the beginning, there was but one concept,
And that's the concept of I.
Then arose Apollyon, the Devil
- Satan! Satan! -
claiming that it's you and I.
And from that day on,
There was trouble in the world


Reply to: