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
Best way to choose an implementation of a lib ?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-12-01 (21:33)
From: Christophe Raffalli <christophe.raffalli@u...>
Subject: Re: [Caml-list] How to compile different implementations of the same lib
skaller a écrit :
> On Thu, 2005-12-01 at 18:03 +0100, Christophe Raffalli wrote:
>>May be I still do not get the problem
> Simple. Ocaml cheats. When you *compile* against a cmx
> or cmi/cmx pair, Ocaml 'cheats' and lifts non-interface
> information out of the cmx. This allows it to, for
> example, inline functions by cheating and grabbing their
> implementations from the cmx.

Yes, I knew that but ..

if I have

toto.cmi in /usr/lib/ocaml

toto.cmx and toto.o in /usr/lib/ocaml/totov1/ compiled from totov1.ml

toto.cmx and toto.o in /usr/lib/ocaml/totov2/ compiled from totov1.ml

tata.ml that does "open Toto"

then use either

ocamlopt -I +totov1 toto.cmx tata.ml

ocamlopt -I +totov2 toto.cmx tata.ml

shouldn't this work ?

Indeed, I tried using "the ln -s" trick for compilation as suggested ...
and it seems to work ?

It is a bit painfull both for compilation and usage ...

BTW: I can not miss inlinig for bindlib, since there will be many calls
to small functions (even 1 line ones) in code using bindlib (I guess,
but did not try).