Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: David Teller <David.Teller@univ-orleans.fr>
To: Nicolas Pouillard <nicolas.pouillard@gmail.com>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: OCamlBuild question
Date: Tue, 30 Sep 2008 17:12:17 +0200	[thread overview]
Message-ID: <1222787537.13637.14.camel@Blefuscu> (raw)
In-Reply-To: <1222770687-sup-2064@ausone.local>

Merci, avec ces explications, je suis enfin arrivé à faire fonctionner
[build]. Maintenant, reste un problème que je n'arrive pas à
comprendre : mon fichier disparaît. Pour être plus précis, j'écris le
contenu de mon .mli dans un fichier que j'ai créé pour l'occasion, à
l'intérieur de _build -- mais pour des raisons qui m'échappent,
ocamlbuild trouve moyen de l'effacer avant la fin de la compilation.

J'ai vérifié, une fois que j'ai écrit mon fichier, il existe bien. J'ai
aussi vérifié, si je place mon fichier dans /tmp au lieu de _build, ça
marche.   J'ai aussi vérifié, si je remplace l'extension de mon .mli
par .mlpack.mli, ça ne change rien. J'ai essayé de l'ouvrir avec
[open_out] et avec [with_output_file], avec la même absence de
résultats.

Ah, et pour compliquer les choses, ça ne marche pas quand j'appelle
ocamlbuild une seule fois. Mais il arrive que, si j'invoque ocamlbuild
deux fois de suite, ça se mette à marcher.

C'est assez frustrant. Des idées ?

Merci,
 David


On Tue, 2008-09-30 at 12:40 +0200, Nicolas Pouillard wrote: 
> If you need (depend) on files that you statically know then the ~deps argument
> is fine (~deps:["%.mli.depends"; "%.mli"]). If you need files that you only
> know dynamically then the 'build' argument function is for that purpose.
>
> > As for part 1, it requires the ability to find which source .ml / .mli
> > correspond to a given module. I can only assume OCamlBuild offers some
> > kind of API for this purpose, because I'd rather avoid folding through
> > the whole tree, resolving [include] directives myself to find a .ml or
> > a .mli which may be the right file.
> 
> Yes the function is called expand_module it takes 3 arguments, the include
> directories, the module name, the extensions.
> 
>    Example: let include_dirs = Pathname.include_dirs_of (Pathname.dirname mlpack)
>             in build (expand_module include_dirs module_name ["mli"; "mli.depends"])
> 
> Have a look to the ocamlbuild/ocaml_tools.ml file for a similar function
> (import_mlypack).
> 
-- 
David Teller-Rajchenbach
 Security of Distributed Systems
  http://www.univ-orleans.fr/lifo/Members/David.Teller
 Angry researcher: French Universities need reforms, but the LRU act brings liquidations. 


  parent reply	other threads:[~2008-09-30 16:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-30  7:27 David Teller
2008-09-30 10:40 ` Nicolas Pouillard
2008-09-30 14:49   ` David Teller
2008-09-30 15:12   ` David Teller [this message]
2009-02-11 22:26 Ocamlbuild question Matthieu Dubuget

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=1222787537.13637.14.camel@Blefuscu \
    --to=david.teller@univ-orleans.fr \
    --cc=caml-list@inria.fr \
    --cc=nicolas.pouillard@gmail.com \
    /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