caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolas Cannasse" <warplayer@free.fr>
To: <skaller@users.sourceforge.net>
Cc: "caml-list" <caml-list@inria.fr>
Subject: Re: [Caml-list] ocamldep
Date: Sat, 8 May 2004 13:11:34 +0200	[thread overview]
Message-ID: <008401c434ed$3a0f9610$19b0e152@warp> (raw)
In-Reply-To: <1084013746.2557.519.camel@pelican.wigram>

> 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


  reply	other threads:[~2004-05-08 11:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-08  3:37 skaller
2004-05-08  7:42 ` Jean-Baptiste Rouquier
2004-05-08  8:56 ` Richard Jones
2004-05-08  9:05 ` Nicolas Cannasse
2004-05-08 10:55   ` skaller
2004-05-08 11:11     ` Nicolas Cannasse [this message]
2004-05-08  9:56 ` Stefano Zacchiroli
  -- strict thread matches above, loose matches on Subject: below --
2001-02-26 16:09 Laure Danthony
2001-02-26 16:32 ` Jean-Christophe Filliatre
2001-03-02 13:18   ` Pierre Weis
2001-02-26 16:50 ` Martin Jambon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='008401c434ed$3a0f9610$19b0e152@warp' \
    --to=warplayer@free.fr \
    --cc=caml-list@inria.fr \
    --cc=skaller@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).