English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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