Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Controlling module loading order.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-01-15 (17:32)
From: Guillaume Yziquel <guillaume.yziquel@c...>
Subject: Re: [Caml-list] Controlling module loading order.
Guillaume Yziquel a écrit :
> Gerd Stolpmann a écrit :
>> Hi Guillaume,
>> if you want to control from findlib that a certain function is invoked,
>> the usual way to do it is to put a .cmo/.cmx file into the "archive"
>> variables. The problem is that the linker drops all unused modules
>> from .cma/.cmxa archives, and as a consequence the initialization code
>> of these modules is not executed. So you could make R.interpreter
>> a .cmo/.cmx - in this case the module is always initialized.
> Thank you so much!

Just a complementary remark: when using a .cmo instead of a .cma, one 
should ship a .o file in place of the .a file. For the sake of exhaustivity.

      Guillaume Yziquel