From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA07327; Sat, 8 May 2004 13:13:33 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA07191 for ; Sat, 8 May 2004 13:13:32 +0200 (MET DST) Received: from postfix4-1.free.fr (postfix4-1.free.fr [213.228.0.62]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i48BDVSH010140 for ; Sat, 8 May 2004 13:13:31 +0200 Received: from warp (chateaudeau-4-82-225-176-25.fbx.proxad.net [82.225.176.25]) by postfix4-1.free.fr (Postfix) with SMTP id C0E15106E11; Sat, 8 May 2004 13:13:30 +0200 (CEST) Message-ID: <008401c434ed$3a0f9610$19b0e152@warp> From: "Nicolas Cannasse" To: Cc: "caml-list" References: <1083987419.2557.344.camel@pelican.wigram> <003401c434db$9bbd8eb0$19b0e152@warp> <1084013746.2557.519.camel@pelican.wigram> Subject: Re: [Caml-list] ocamldep Date: Sat, 8 May 2004 13:11:34 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-Miltered: at concorde with ID 409CC0DB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; cannasse:01 warplayer:01 caml-list:01 ocamldep:01 2004:99 cannasse:01 ocamldep:01 ocamake:01 mli:01 mli:01 cmx:01 topological:01 dependencies:01 ocamake:01 topological:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > On Sat, 2004-05-08 at 19:05, Nicolas Cannasse wrote: > > > Any chance of a -S option on ocamldep > > > which generates a list topologically sorted > > > files? > > > > > > Or a script (ocaml, perl, whatever) that takes > > > ocamldep output and does so? > > > > > > I'm having trouble building a .cmxa library. > > > I can't sort ocamldep output in my head.. :) > > > > OCamake will do it for you ! > > Please clarify. I need this: > > make_order dirname >out > > where 'out' is a plain list of module names > > A > B > C > D > > which allows me to compile > > A.mli > B.mli > C.mli > D.mli > A.ml > B.ml > C.ml > D.ml > > and then put the *.cmx into an *.cmxa in that order. > > I'm not interested at the moment in using make > to actually build anything, I just want > an easy way to recompute a topological sort > of the module dependencies. There is such algorithm in OCamake, which is a basic topological sort with additionnal tricks when cross dependencies are found (since ocamldep does not report the difference between dependencies for using types and dependencies for using functions, the later only need a linkage dependency). >>From the OCamake sources : " In order to link, we need to order the CMO files. We currently have a ML/MLI dependency graph (in fact, tree) generated by ocamldep. To build the CMO list, we are reducing the dep-tree into one graph merging corresponding ML & MLI nodes. ML-ML edges are keeped, ML-MLI edges become ML-ML edges only if they do not create a cycle in the reduced graph." The other - best - way would be to have a tool that does that directly from the depencies expressed in the CMO / CMX, so we don't care anymore about types-only imports. Ocamldep is only working at a syntax level and is good in order to compile, but does not provide enough informations for linking : such an algorithm would be very useful directly in the linker ! Regards, Nicolas Cannasse ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners