caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
To: "Jozef Kosoru" <zyzstar@uid0.sk>
Cc: "Jean-Christophe Filliatre" <filliatr@lri.fr>, caml-list@inria.fr
Subject: Re: [Caml-list] How to define submodules
Date: Fri, 21 Jul 2006 14:48:44 +0200	[thread overview]
Message-ID: <cd67f63a0607210548n7ba30c9cs98e3047d20695b13@mail.gmail.com> (raw)
In-Reply-To: <20060721124247.GT3653@osiris.uid0.sk>

On 7/21/06, Jozef Kosoru <zyzstar@uid0.sk> wrote:
> On Fri, Jul 21, 2006 at 14:01:26 +0200, Jean-Christophe Filliatre wrote:
> > Jozef Kosoru writes:
> > > OK, and then I want to compile it (within a root directory):
> > >
> > >     $ ocamlc -c Kernel/Parser/pdf.ml
> > >     $ ocamlc -I . Kernel/Parser/pdf.cmo main.ml -o app
> > >
> > >     File "main.ml", line 1, characters 0-22:
> > >     Unbound value Kernel.Parser.Pdf.init
> > >
> > > Is this supposed to work somehow?
> >
> > No.
> >
> > First, to compile  main.ml you need to pass  "-I Kernel/Parser" to the
> > compiler, because it needs to find the file pdf.cmi.
> >
> > Second,  in   main.ml  you  have   to  write  "Pdf.init"   instead  of
> > "Kernel.Parser.Pdf.init" because the directory structure is not turned
> > into a module structure in ocaml.
>
> Yes, that was my second example. That's not exactly what I want.
>
> > However, you can use the option -pack and -for-pack of the compiler to
> > pack several  files as submodules of  a new module; see  the manual at
> > http://caml.inria.fr/pub/docs/manual-ocaml/manual025.html
>
> Thank you!
> For the above example it's:
>
>   $ ocamlc -for-pack Kernel.Parser -c Kernel/Parser/pdf.ml
>   $ ocamlc -pack -o Parser.cmo -for-pack Kernel Kernel/Parser/pdf.cmo
>   $ ocamlc -pack -o Kernel.cmo Parser.cmo
>   $ ocamlc Kernel.cmo main.ml -o ap
>
> Now the last thing is how to convince my OMakefile to do it
> automatically.
>

You can try YaM (http://perso.ens-lyon.fr/damien.pous/shared/ocaml/YaM/)

It handles directories and subdirectories very well using -pack options.

-- 
Nicolas Pouillard


  reply	other threads:[~2006-07-21 12:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-21 11:53 Jozef Kosoru
2006-07-21 12:01 ` [Caml-list] " Jean-Christophe Filliatre
2006-07-21 12:42   ` Jozef Kosoru
2006-07-21 12:48     ` Nicolas Pouillard [this message]
2006-07-21 13:32     ` Chris King

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=cd67f63a0607210548n7ba30c9cs98e3047d20695b13@mail.gmail.com \
    --to=nicolas.pouillard@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=filliatr@lri.fr \
    --cc=zyzstar@uid0.sk \
    /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).