Cross-module inlining fails
Valentin Gatien-Baron
vgatien-baron at janestreet.com
Mon Nov 19 18:23:17 GMT 2012
Not all cmx's should be installed, but I don't see why the packed cmx
should not be installed. Generally speaking, I think packed cmx's are
not special and every cmx that was given to ocamlopt to build the cmxa
should be installed.
cmxs are for dynamic loading, so that's not related.
On 11/19/12, Sylvain Le Gall <sylvain at le-gall.net> wrote:
> Hi,
>
>
> 2012/11/19 Markus Mottl <markus.mottl at gmail.com>
>
>> Hi,
>>
>> I've noticed that cross-module inlining does not work with the
>> Opam-installed Core library, because the .cmx file is not installed.
>> Note that it is not enough to install the .cmxa file, because it is
>> only used during linking. The compiler wouldn't know where to look
>> for optimization information.
>>
>> Looking at the setup.ml file generated by Oasis, it seems that Oasis
>> is the culprit, but I thought it would be important to know for other
>> Core users if they experience bad performance.
>>
>> Sylvain, is there anything one has to put in the _oasis file to
>> generate correct installation code? My guess is that all that's
>> needed is to fix setup.ml by installing the .cmx of packing targets
>> (e.g. core.cmx), not just .cmx files for constituents of unpacked
>> libraries, which seem to be handled correctly.
>>
>
> Well, .cmx file should be installed EXCEPT if you are using packed
> modules...
>
> The culprit is:
> (not lib.lib_pack) && (* Do not install .cmx packed submodules *)
> in src/oasis/OASISLibrary.ml
>
> AFAIK, Core use pack module, so this is the reason why it doesn't install
> .cmx.
>
> You can experiment installing .cmx by commenting this line. But I am really
> not sure this will help that much. I thought that .cmxs was a pack of .cmx
> so that inlining can work using what is inside this archive (contrary to
> .cmxa).
>
> Maybe the inlining using .cmxs doesn't work as excepted ?
>
>
>> Regards,
>> Markus
>>
>> --
>> Markus Mottl http://www.ocaml.info markus.mottl at gmail.com
>>
>
More information about the core
mailing list