caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ocamlbuild and packs
@ 2010-11-18 15:10 Thomas Gazagnaire
  2010-11-19  8:59 ` Sylvain Le Gall
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Gazagnaire @ 2010-11-18 15:10 UTC (permalink / raw)
  To: caml-list

Hi all,

I've got a source tree with the following patterns :

A/a.ml (defines 'let x = 1')

B/a.ml (use A.x and defines 'let y = 2')
B/b.ml
B/b.mlpack (contains 'A B')

C/a.ml (use A.x)
C/b.ml (use B.A.y)
C/c.mlpack (contains 'A B')

Is there any way with ocamlbuild to build that tree (if possible using
only _tags files, but if not I would be happy to have at least a
solution :-) ?

Cheers,
Thomas



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

* Re: ocamlbuild and packs
  2010-11-18 15:10 ocamlbuild and packs Thomas Gazagnaire
@ 2010-11-19  8:59 ` Sylvain Le Gall
  0 siblings, 0 replies; 4+ messages in thread
From: Sylvain Le Gall @ 2010-11-19  8:59 UTC (permalink / raw)
  To: caml-list

On 18-11-2010, Thomas Gazagnaire <thomas.gazagnaire@inria.fr> wrote:
> Hi all,
>
> I've got a source tree with the following patterns :
>
> A/a.ml (defines 'let x = 1')
>
> B/a.ml (use A.x and defines 'let y = 2')
> B/b.ml
> B/b.mlpack (contains 'A B')
>
> C/a.ml (use A.x)
> C/b.ml (use B.A.y)
> C/c.mlpack (contains 'A B')
>
> Is there any way with ocamlbuild to build that tree (if possible using
> only _tags files, but if not I would be happy to have at least a
> solution :-) ?
>

You can try to start building A/a.mlpack and use the generated library
in other libraries.

Regards,
Sylvain Le Gall


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

* ocamlbuild and packs
@ 2010-11-18 15:29 Thomas Gazagnaire
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Gazagnaire @ 2010-11-18 15:29 UTC (permalink / raw)
  To: caml-list

Hi all,

I've got a source tree with the following patterns :

A/a.ml (defines 'let x = 1')

B/a.ml (use A.x and defines 'let y = 2')
B/b.ml
B/b.mlpack (contains 'A B')

C/a.ml (use A.x)
C/b.ml (use B.A.y)
C/c.mlpack (contains 'A B')

Is there any way with ocamlbuild to build that tree (if possible using
only _tags files, but if not I would be happy to have at least a
solution :-) ?

Cheers,
Thomas

PS: apologies if you receive this email twice ...


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

* ocamlbuild and packs
@ 2008-01-31 11:55 Romain Bardou
  0 siblings, 0 replies; 4+ messages in thread
From: Romain Bardou @ 2008-01-31 11:55 UTC (permalink / raw)
  To: caml-list

Hello,

I have this big project I work on, which could be summarized like this:

	module A
	module bla/A
	module bla/B
	module Main

The module B in the bla directory depends on the module A of the bla 
directory. The module Main depends on both modules A and on module B. 
For some reasons I cannot rename either of the modules.

So what I do is pack A and B in a Bla module, so I can write Bla.A and 
Bla.B, using the -pack command line option. It works with my Makefile.

Now I try to use ocamlbuild, because I really like its approach (I come 
from the Pascal world where no makefile is needed). So I made this file 
bla.mlpack containing the lines:

	A
	B

Now if I compile using:

	ocamlbuild Main.byte

I get the following error:

	Unbound module Bla.A

I can't compile using:

	ocamlbuild -I bla Main.byte

Because now the module A is defined twice.

So I tried to compile using two steps: first, compile bla.cmo, and then, 
compile Main.byte, but ocamlbuild doesn't seem to be good at that (and 
actually that's not a bad thing imo). Indeed, if I do:

	ocamlbuild bla.cmo

I get the following error:

	Solver failed:
	  Ocamlbuild cannot find or build bla.ml.

(but the file bla.mlpack does exist).
Actually at first I did that from a parent directory, so the command I 
used looked more like:

	ocamlbuild -I dir dir/bla.cmo

And the error was different:

	Solver failed:
	  Ocamlbuild knows of no rules that apply to a target named dir/bla.mly.

There is no such file as dir/bla.mly anywhere on my drive, although the 
project does contain some other mly files.

Now for the questions:
1) What is the best way to compile my project? By "best" I mean: with no 
plugin if possible, with a small _tags file, and as few command line 
options as possible, while still keeping the spirit of ocamlbuild (for 
instance, compiling everything in one single call to ocamlbuild if 
possible).
2) Why doesn't ocamlbuild compile my file bla.mlpack into bla.cmo? In 
the manual I can read that "%.mlpack" has target "%.cmo".
3) If ocamlbuild actually did compile bla.cmo, could it use it to 
compile main.byte or must I build a library bla.cma first?

Thanks. I would be glad to contribute to the wiki, but I have to 
understand ocamlbuild first ;)

-- 
Romain Bardou


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

end of thread, other threads:[~2010-11-19  9:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-18 15:10 ocamlbuild and packs Thomas Gazagnaire
2010-11-19  8:59 ` Sylvain Le Gall
  -- strict thread matches above, loose matches on Subject: below --
2010-11-18 15:29 Thomas Gazagnaire
2008-01-31 11:55 Romain Bardou

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