caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] ocamldep and module aliases
@ 2014-09-09 22:21 Ashish Agarwal
  2014-09-10  5:31 ` Jacques Garrigue
  2014-09-10  5:37 ` Jacques Garrigue
  0 siblings, 2 replies; 4+ messages in thread
From: Ashish Agarwal @ 2014-09-09 22:21 UTC (permalink / raw)
  To: Caml List

[-- Attachment #1: Type: text/plain, Size: 424 bytes --]

Is ocamldep 4.02 supposed to support the -no-alias-deps flag too? It
doesn't, so I'm not sure how to implement the example at the end of Section
7.17 [1] on a real library. Specifically, I use omake, which calls
ocamldep, and I don't see how to avoid it claiming circular dependencies
even though I've added -no-alias-deps to the compilation flags.

[1] http://caml.inria.fr/pub/docs/manual-ocaml/extn.html#s%3Amodule-alias

[-- Attachment #2: Type: text/html, Size: 586 bytes --]

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

* Re: [Caml-list] ocamldep and module aliases
  2014-09-09 22:21 [Caml-list] ocamldep and module aliases Ashish Agarwal
@ 2014-09-10  5:31 ` Jacques Garrigue
  2014-09-10  5:37 ` Jacques Garrigue
  1 sibling, 0 replies; 4+ messages in thread
From: Jacques Garrigue @ 2014-09-10  5:31 UTC (permalink / raw)
  To: Ashish Agarwal; +Cc: OCaml Mailing List

On 2014/09/10 07:21, Ashish Agarwal wrote:

> Is ocamldep 4.02 supposed to support the -no-alias-deps flag too? It doesn't, so I'm not sure how to implement the example at the end of Section 7.17 [1] on a real library. Specifically, I use omake, which calls ocamldep, and I don't see how to avoid it claiming circular dependencies even though I've added -no-alias-deps to the compilation flags.
> 
> [1] http://caml.inria.fr/pub/docs/manual-ocaml/extn.html#s%3Amodule-alias

Indeed, this is not supported by ocamldep, and I'm not sure that it would do
much sense to support it fully at this point, as what you need to do is
going to depend on how you use module aliases.
If you follow the recipe described in my ML workshop slides, what you can
do is leave your files unmodified (short names both inside and outside),
and use command line flags for copilation:
  ocamlopt -no-alias-deps -open Mylib -o mylibA.cmx a.ml

If you do that, just use ocamldep to compute the dependencies without
mylib.ml, and post-process the results to add a mylib prefix to all file names.

Once the common idioms become clearer, we will probably want to add
some kind of support to ocamldep (to avoid this post-processing).

Jacques Garrigue

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

* Re: [Caml-list] ocamldep and module aliases
  2014-09-09 22:21 [Caml-list] ocamldep and module aliases Ashish Agarwal
  2014-09-10  5:31 ` Jacques Garrigue
@ 2014-09-10  5:37 ` Jacques Garrigue
  2014-09-10 11:06   ` Ashish Agarwal
  1 sibling, 1 reply; 4+ messages in thread
From: Jacques Garrigue @ 2014-09-10  5:37 UTC (permalink / raw)
  To: Ashish Agarwal; +Cc: OCaml Mailing List

(added link)
On 2014/09/10 07:21, Ashish Agarwal wrote:

> Is ocamldep 4.02 supposed to support the -no-alias-deps flag too? It doesn't, so I'm not sure how to implement the example at the end of Section 7.17 [1] on a real library. Specifically, I use omake, which calls ocamldep, and I don't see how to avoid it claiming circular dependencies even though I've added -no-alias-deps to the compilation flags.
> 
> [1] http://caml.inria.fr/pub/docs/manual-ocaml/extn.html#s%3Amodule-alias

Indeed, this is not supported by ocamldep, and I'm not sure that it would do
much sense to support it fully at this point, as what you need to do is
going to depend on how you use module aliases.
If you follow the recipe described in my ML workshop slides [2], what you
can do is leave your files unmodified (short names both inside and
outside), and use command line flags for copilation:
 ocamlopt -no-alias-deps -open Mylib -o mylibA.cmx a.ml

If you do that, just use ocamldep to compute the dependencies without
mylib.ml, and post-process the results to add a mylib prefix to all file names.

Once the common idioms become clearer, we will probably want to add
some kind of support to ocamldep (to avoid this post-processing).

Jacques Garrigue

[2]   http://www.math.nagoya-u.ac.jp/~garrigue/papers/index.html#modalias


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

* Re: [Caml-list] ocamldep and module aliases
  2014-09-10  5:37 ` Jacques Garrigue
@ 2014-09-10 11:06   ` Ashish Agarwal
  0 siblings, 0 replies; 4+ messages in thread
From: Ashish Agarwal @ 2014-09-10 11:06 UTC (permalink / raw)
  To: Jacques Garrigue; +Cc: OCaml Mailing List

[-- Attachment #1: Type: text/plain, Size: 1682 bytes --]

Thanks for the suggested workaround. I have to figure out how to implement
it. Since I'm using OMake, I can't easily exclude mylib.ml. I have to
either modify OMake's OCaml module or change my build system completely.


On Wed, Sep 10, 2014 at 1:37 AM, Jacques Garrigue <
garrigue@math.nagoya-u.ac.jp> wrote:

> (added link)
> On 2014/09/10 07:21, Ashish Agarwal wrote:
>
> > Is ocamldep 4.02 supposed to support the -no-alias-deps flag too? It
> doesn't, so I'm not sure how to implement the example at the end of Section
> 7.17 [1] on a real library. Specifically, I use omake, which calls
> ocamldep, and I don't see how to avoid it claiming circular dependencies
> even though I've added -no-alias-deps to the compilation flags.
> >
> > [1]
> http://caml.inria.fr/pub/docs/manual-ocaml/extn.html#s%3Amodule-alias
>
> Indeed, this is not supported by ocamldep, and I'm not sure that it would
> do
> much sense to support it fully at this point, as what you need to do is
> going to depend on how you use module aliases.
> If you follow the recipe described in my ML workshop slides [2], what you
> can do is leave your files unmodified (short names both inside and
> outside), and use command line flags for copilation:
>  ocamlopt -no-alias-deps -open Mylib -o mylibA.cmx a.ml
>
> If you do that, just use ocamldep to compute the dependencies without
> mylib.ml, and post-process the results to add a mylib prefix to all file
> names.
>
> Once the common idioms become clearer, we will probably want to add
> some kind of support to ocamldep (to avoid this post-processing).
>
> Jacques Garrigue
>
> [2]   http://www.math.nagoya-u.ac.jp/~garrigue/papers/index.html#modalias
>
>

[-- Attachment #2: Type: text/html, Size: 2501 bytes --]

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

end of thread, other threads:[~2014-09-10 11:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-09 22:21 [Caml-list] ocamldep and module aliases Ashish Agarwal
2014-09-10  5:31 ` Jacques Garrigue
2014-09-10  5:37 ` Jacques Garrigue
2014-09-10 11:06   ` Ashish Agarwal

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