caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] ocamldep
@ 2001-02-26 16:09 Laure Danthony
  2001-02-26 16:32 ` Jean-Christophe Filliatre
  2001-02-26 16:50 ` Martin Jambon
  0 siblings, 2 replies; 11+ messages in thread
From: Laure Danthony @ 2001-02-26 16:09 UTC (permalink / raw)
  To: caml-list; +Cc: Christophe Delage

bonjour

VF : pourquoi camldep n'arrive pas à trouver dans les dépendances
dans ce cas : 
	fichier un.ml : #use "deux.ml";;
	ocamldep un.ml renvoie alors :
Syntax error line1, char 0,1

EV : why do ocamldep not find the dependencies in that case :
	file one.ml : #use "two.ml";;
	ocamldep one.ml says :
Syntax error line1, char 0,1

Thanks in advance, Laure and Christophe

________________________________________

Laure DANTHONY, licence d'informatique

18, montée Saint Sébastien
69001 LYON

TEL  04 78 29 32 53
PORT 06 20 32 74 65

mail : Laure.Danthony@ens-lyon.fr
web : http://www.ens-lyon.fr/~ldanthon/

See You !
________________________________________

-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] ocamldep
  2001-02-26 16:09 [Caml-list] ocamldep Laure Danthony
@ 2001-02-26 16:32 ` Jean-Christophe Filliatre
  2001-03-02 13:18   ` Pierre Weis
  2001-02-26 16:50 ` Martin Jambon
  1 sibling, 1 reply; 11+ messages in thread
From: Jean-Christophe Filliatre @ 2001-02-26 16:32 UTC (permalink / raw)
  To: Laure Danthony; +Cc: caml-list, Christophe Delage


#use is a toplevel directive : it  is not valid in an Ocaml module but
only accepted in  the Ocaml toplevel. ocamldep is  designed to produce
the dependencies between some Ocaml  modules and parses them to do so.
Thus #use produces a syntax error.

-- 
Jean-Christophe FILLIATRE

Laure Danthony writes:
 > bonjour
 > 
 > VF : pourquoi camldep n'arrive pas à trouver dans les dépendances
 > dans ce cas : 
 > 	fichier un.ml : #use "deux.ml";;
 > 	ocamldep un.ml renvoie alors :
 > Syntax error line1, char 0,1
 > 
 > EV : why do ocamldep not find the dependencies in that case :
 > 	file one.ml : #use "two.ml";;
 > 	ocamldep one.ml says :
 > Syntax error line1, char 0,1

-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] ocamldep
  2001-02-26 16:09 [Caml-list] ocamldep Laure Danthony
  2001-02-26 16:32 ` Jean-Christophe Filliatre
@ 2001-02-26 16:50 ` Martin Jambon
  1 sibling, 0 replies; 11+ messages in thread
From: Martin Jambon @ 2001-02-26 16:50 UTC (permalink / raw)
  To: Laure Danthony; +Cc: caml-list, Christophe Delage

On Mon, 26 Feb 2001, Laure Danthony wrote:

> EV : why do ocamldep not find the dependencies in that case :
> 	file one.ml : #use "two.ml";;
> 	ocamldep one.ml says :
> Syntax error line1, char 0,1

If you want to split your code into several source files, modules, that
is:

-- file two.ml --
let f = ...
-----------------


-- file one.ml --
let _ =
  ...
  Two.f ...
  ...
-----------------

or :

-- file one.ml --
open Two

let _ =
  ...
  f ...
  ...
-----------------


two.ml must be compiled before one.ml, and that's what ocamldep has been
designed for.

For further details on modules, have a look at the reference manual:
http://caml.inria.fr/ocaml/htmlman/index.html


-- Martin

-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] ocamldep
  2001-02-26 16:32 ` Jean-Christophe Filliatre
@ 2001-03-02 13:18   ` Pierre Weis
  0 siblings, 0 replies; 11+ messages in thread
From: Pierre Weis @ 2001-03-02 13:18 UTC (permalink / raw)
  To: Jean-Christophe.Filliatre; +Cc: ldanthon, caml-list, cdelage

> #use is a toplevel directive : it  is not valid in an Ocaml module but
> only accepted in  the Ocaml toplevel. ocamldep is  designed to produce
> the dependencies between some Ocaml  modules and parses them to do so.
> Thus #use produces a syntax error.
> 
> -- 
> Jean-Christophe FILLIATRE
> 
> Laure Danthony writes:
>  > bonjour
>  > 
>  > VF : pourquoi camldep n'arrive pas à trouver dans les dépendances
>  > dans ce cas : 
>  > 	fichier un.ml : #use "deux.ml";;
>  > 	ocamldep un.ml renvoie alors :
>  > Syntax error line1, char 0,1
>  > 
>  > EV : why do ocamldep not find the dependencies in that case :
>  > 	file one.ml : #use "two.ml";;
>  > 	ocamldep one.ml says :
>  > Syntax error line1, char 0,1
> 
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr

This was a bug of ocamldep. I corrected it along with another bug
concerning qualified record labels. Cvs reports that this occurred
long time ago, early in the morning, during the last century:

  date: 2000/11/28 07:52:17;  author: weis;  state: Exp;  lines: +13 -4
  Correction du bug des labels d'enregistrement qualifies dont les noms
  de modules n'etaient pas pris en compte. Appel du parser sur l'entree
  use_file pour accepter aussi les fichiers de commandes.

So, you could try the new version from the camlcvs source tree, or wait
for the next V3.01 version of the language.

Best regards,

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/


-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] ocamldep
  2004-05-08 10:55   ` skaller
@ 2004-05-08 11:11     ` Nicolas Cannasse
  0 siblings, 0 replies; 11+ messages in thread
From: Nicolas Cannasse @ 2004-05-08 11:11 UTC (permalink / raw)
  To: skaller; +Cc: caml-list

> 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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] ocamldep
  2004-05-08  9:05 ` Nicolas Cannasse
@ 2004-05-08 10:55   ` skaller
  2004-05-08 11:11     ` Nicolas Cannasse
  0 siblings, 1 reply; 11+ messages in thread
From: skaller @ 2004-05-08 10:55 UTC (permalink / raw)
  To: Nicolas Cannasse; +Cc: caml-list

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.

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net



-------------------
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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] ocamldep
  2004-05-08  3:37 skaller
                   ` (2 preceding siblings ...)
  2004-05-08  9:05 ` Nicolas Cannasse
@ 2004-05-08  9:56 ` Stefano Zacchiroli
  3 siblings, 0 replies; 11+ messages in thread
From: Stefano Zacchiroli @ 2004-05-08  9:56 UTC (permalink / raw)
  To: caml-list

On Sat, May 08, 2004 at 01:37:00PM +1000, skaller wrote:
> Or a script (ocaml, perl, whatever) that takes ocamldep output and
> does so?

ocamldsort

  http://dimitri.mutu.net/files/

Cheers.

-- 
Stefano Zacchiroli -*- Computer Science PhD student @ Uny Bologna, Italy
zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/
If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. -!-

-------------------
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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] ocamldep
  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  9:56 ` Stefano Zacchiroli
  3 siblings, 1 reply; 11+ messages in thread
From: Nicolas Cannasse @ 2004-05-08  9:05 UTC (permalink / raw)
  To: skaller, caml-list

> 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 !

http://tech.motion-twin.com

(it can also generate a proper standalone Makefile).

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] ocamldep
  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  9:56 ` Stefano Zacchiroli
  3 siblings, 0 replies; 11+ messages in thread
From: Richard Jones @ 2004-05-08  8:56 UTC (permalink / raw)
  Cc: caml-list

On Sat, May 08, 2004 at 01:37:00PM +1000, skaller 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.. :)

Suggestion: post-process the output of ocamldep with sed (to remove
the ':') and tsort (to generate the topologically sorted list).

Rich.

-- 
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
C2LIB is a library of basic Perl/STL-like types for C. Vectors, hashes,
trees, string funcs, pool allocator: http://www.annexia.org/freeware/c2lib/

-------------------
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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Caml-list] ocamldep
  2004-05-08  3:37 skaller
@ 2004-05-08  7:42 ` Jean-Baptiste Rouquier
  2004-05-08  8:56 ` Richard Jones
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Jean-Baptiste Rouquier @ 2004-05-08  7:42 UTC (permalink / raw)
  To: caml-list

I didn't tried them, but you could have a look at
http://pauillac.inria.fr/~aschmitt/cwn/2003.08.26.html
http://www.eleves.ens.fr/home/ara/ocaml.html
http://www.davidb.org/camlmake/ (already mentionned by the first link)

An official -S option would be good, though a (caml) script shouldn't be 
too difficult to write.
Jean-Baptiste.

skaller 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.. :)
>  
>

-------------------
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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Caml-list] ocamldep
@ 2004-05-08  3:37 skaller
  2004-05-08  7:42 ` Jean-Baptiste Rouquier
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: skaller @ 2004-05-08  3:37 UTC (permalink / raw)
  To: caml-list

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.. :)

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net



-------------------
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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-05-08 11:13 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-26 16:09 [Caml-list] ocamldep Laure Danthony
2001-02-26 16:32 ` Jean-Christophe Filliatre
2001-03-02 13:18   ` Pierre Weis
2001-02-26 16:50 ` Martin Jambon
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
2004-05-08  9:56 ` Stefano Zacchiroli

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).