caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ocamlbuild and subdirectories
@ 2007-05-25 11:20 Joel Reymont
  2007-05-25 11:34 ` [Caml-list] " Nicolas Pouillard
  0 siblings, 1 reply; 12+ messages in thread
From: Joel Reymont @ 2007-05-25 11:20 UTC (permalink / raw)
  To: OCaml List

Currently I have all the source code under src/ and invoke ocamlbuild  
like this:

ocamlbuild src/topdog.cma

Is there a way to skip the src and just use the following?

ocamlbuild topdog.cma

I do have myocamlbuild.ml and _tags.

	Thanks, Joel

--
http://wagerlabs.com/






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

* Re: [Caml-list] ocamlbuild and subdirectories
  2007-05-25 11:20 ocamlbuild and subdirectories Joel Reymont
@ 2007-05-25 11:34 ` Nicolas Pouillard
  2007-05-25 11:43   ` Joel Reymont
  2007-05-25 11:46   ` Joel Reymont
  0 siblings, 2 replies; 12+ messages in thread
From: Nicolas Pouillard @ 2007-05-25 11:34 UTC (permalink / raw)
  To: Joel Reymont; +Cc: OCaml List

On 5/25/07, Joel Reymont <joelr1@gmail.com> wrote:
> Currently I have all the source code under src/ and invoke ocamlbuild
> like this:
>
> ocamlbuild src/topdog.cma
>
> Is there a way to skip the src and just use the following?
>
> ocamlbuild topdog.cma
>
> I do have myocamlbuild.ml and _tags.

If you want a shorter command, you can pack targets in a .itarget file.

$ cat all.itarget
src/topdog.cma
src/topdog.cmxa
...

$ ocamlbuild all.otarget

Hope this helps

-- 
Nicolas Pouillard


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

* Re: [Caml-list] ocamlbuild and subdirectories
  2007-05-25 11:34 ` [Caml-list] " Nicolas Pouillard
@ 2007-05-25 11:43   ` Joel Reymont
  2007-05-25 12:27     ` Nicolas Pouillard
  2007-05-25 11:46   ` Joel Reymont
  1 sibling, 1 reply; 12+ messages in thread
From: Joel Reymont @ 2007-05-25 11:43 UTC (permalink / raw)
  To: Nicolas Pouillard; +Cc: OCaml List


On May 25, 2007, at 12:34 PM, Nicolas Pouillard wrote:

> $ cat all.itarget
> src/topdog.cma
> src/topdog.cmxa

I tried the above. Any suggestions on what the issue is?

	Thanks, Joel

--

ocamlbuild all.otarget
+ ocamlfind ocamlopt -package 'oUnit, dyp, extlib' -a -linkpkg src/ 
easy_ast.cmx src/easy_symtab.cmx src/easy_type_check.cmx src/ 
parser_util.cmx src/easy_parser.cmx src/easy_lexer.cmx src/ 
ninja_ast.cmx src/ninja_morpher.cmx src/pretty.cmx src/ 
ninja_printer.cmx src/topdog.cmx -o src/topdog.cmxa
/usr/local/lib/ocaml/unix.cmxa is not a compilation unit description.
Command exited with code 2.
Compilation unsuccessful after building 52 targets (37 cached) in  
00:00:02.

ls /usr/local/lib/ocaml/unix*
/usr/local/lib/ocaml/unix.a             /usr/local/lib/ocaml/unix.o
/usr/local/lib/ocaml/unix.cma           /usr/local/lib/ocaml/ 
unixLabels.cmi
/usr/local/lib/ocaml/unix.cmi           /usr/local/lib/ocaml/ 
unixLabels.cmx
/usr/local/lib/ocaml/unix.cmx           /usr/local/lib/ocaml/ 
unixLabels.mli
/usr/local/lib/ocaml/unix.cmxa          /usr/local/lib/ocaml/ 
unixLabels.o
/usr/local/lib/ocaml/unix.mli

/usr/local/lib/ocaml/unix:
META

--
http://wagerlabs.com/






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

* Re: [Caml-list] ocamlbuild and subdirectories
  2007-05-25 11:34 ` [Caml-list] " Nicolas Pouillard
  2007-05-25 11:43   ` Joel Reymont
@ 2007-05-25 11:46   ` Joel Reymont
  2007-05-25 12:31     ` Nicolas Pouillard
  1 sibling, 1 reply; 12+ messages in thread
From: Joel Reymont @ 2007-05-25 11:46 UTC (permalink / raw)
  To: Nicolas Pouillard; +Cc: OCaml List

There seems to be a small issue with using an itarget file. To wit:

ocamlbuild all.otarget
...

find . -name test.byte
./_build/src/test.byte

There's no test.byte in the directory I'm building from.

ocamlbuild src/test.byte
Finished, 37 targets (37 cached) in 00:00:00.

ls -la test.byte
lrwxr-xr-x   1 joelr  wheel  20 May 25 12:44 test.byte -> _build/src/ 
test.byte

A link was created, unlike when using itarget.

	Thanks, Joel

--
http://wagerlabs.com/






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

* Re: [Caml-list] ocamlbuild and subdirectories
  2007-05-25 11:43   ` Joel Reymont
@ 2007-05-25 12:27     ` Nicolas Pouillard
  0 siblings, 0 replies; 12+ messages in thread
From: Nicolas Pouillard @ 2007-05-25 12:27 UTC (permalink / raw)
  To: Joel Reymont; +Cc: OCaml List

On 5/25/07, Joel Reymont <joelr1@gmail.com> wrote:
>
> On May 25, 2007, at 12:34 PM, Nicolas Pouillard wrote:
>
> > $ cat all.itarget
> > src/topdog.cma
> > src/topdog.cmxa
>
> I tried the above. Any suggestions on what the issue is?
>

In native you cannot make a library containing libraries, and unix.cma
seems to be added by ocamlfind so you should remove the -linkpkg flag
or reduce -packages.

-- 
Nicolas Pouillard


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

* Re: [Caml-list] ocamlbuild and subdirectories
  2007-05-25 11:46   ` Joel Reymont
@ 2007-05-25 12:31     ` Nicolas Pouillard
  2007-05-25 12:35       ` Joel Reymont
  2007-05-25 14:34       ` Daniel Bünzli
  0 siblings, 2 replies; 12+ messages in thread
From: Nicolas Pouillard @ 2007-05-25 12:31 UTC (permalink / raw)
  To: Joel Reymont; +Cc: OCaml List

On 5/25/07, Joel Reymont <joelr1@gmail.com> wrote:
> There seems to be a small issue with using an itarget file. To wit:
>
> ocamlbuild all.otarget
> ...
>
> find . -name test.byte
> ./_build/src/test.byte
>
> There's no test.byte in the directory I'm building from.
>
> ocamlbuild src/test.byte
> Finished, 37 targets (37 cached) in 00:00:00.
>
> ls -la test.byte
> lrwxr-xr-x   1 joelr  wheel  20 May 25 12:44 test.byte -> _build/src/
> test.byte
>
> A link was created, unlike when using itarget.
>

Yes our system to move things out of the build is really partial
(since we still don't what a good way will be). I often use a shell
script to install things, or start it directly from the build.

-- 
Nicolas Pouillard


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

* Re: [Caml-list] ocamlbuild and subdirectories
  2007-05-25 12:31     ` Nicolas Pouillard
@ 2007-05-25 12:35       ` Joel Reymont
  2007-05-25 12:47         ` Nicolas Pouillard
  2007-05-25 14:34       ` Daniel Bünzli
  1 sibling, 1 reply; 12+ messages in thread
From: Joel Reymont @ 2007-05-25 12:35 UTC (permalink / raw)
  To: Nicolas Pouillard; +Cc: OCaml List


On May 25, 2007, at 1:31 PM, Nicolas Pouillard wrote:

> Yes our system to move things out of the build is really partial
> (since we still don't what a good way will be). I often use a shell
> script to install things, or start it directly from the build.

The issue is that if I put src/test.byte in all.itarget then no link  
test.byte -> _build/src/test.byte is created for me. If I run  
ocamlbuild src/test.byte then the link is created. A bug perhaps?

	Thanks, Joel

--
http://wagerlabs.com/






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

* Re: [Caml-list] ocamlbuild and subdirectories
  2007-05-25 12:35       ` Joel Reymont
@ 2007-05-25 12:47         ` Nicolas Pouillard
  2007-05-25 12:49           ` Joel Reymont
  0 siblings, 1 reply; 12+ messages in thread
From: Nicolas Pouillard @ 2007-05-25 12:47 UTC (permalink / raw)
  To: Joel Reymont; +Cc: OCaml List

On 5/25/07, Joel Reymont <joelr1@gmail.com> wrote:
>
> On May 25, 2007, at 1:31 PM, Nicolas Pouillard wrote:
>
> > Yes our system to move things out of the build is really partial
> > (since we still don't what a good way will be). I often use a shell
> > script to install things, or start it directly from the build.
>
> The issue is that if I put src/test.byte in all.itarget then no link
> test.byte -> _build/src/test.byte is created for me. If I run
> ocamlbuild src/test.byte then the link is created. A bug perhaps?
>

Name this like you want but links are created only for targets given
in command line.

-- 
Nicolas Pouillard


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

* Re: [Caml-list] ocamlbuild and subdirectories
  2007-05-25 12:47         ` Nicolas Pouillard
@ 2007-05-25 12:49           ` Joel Reymont
  0 siblings, 0 replies; 12+ messages in thread
From: Joel Reymont @ 2007-05-25 12:49 UTC (permalink / raw)
  To: Nicolas Pouillard; +Cc: OCaml List


On May 25, 2007, at 1:47 PM, Nicolas Pouillard wrote:

> Name this like you want but links are created only for targets given
> in command line.

Duly noted! I totally love ocamlbuild, btw, I think it's awesome!

--
http://wagerlabs.com/






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

* Re: [Caml-list] ocamlbuild and subdirectories
  2007-05-25 12:31     ` Nicolas Pouillard
  2007-05-25 12:35       ` Joel Reymont
@ 2007-05-25 14:34       ` Daniel Bünzli
  2007-05-25 16:59         ` Nicolas Pouillard
  1 sibling, 1 reply; 12+ messages in thread
From: Daniel Bünzli @ 2007-05-25 14:34 UTC (permalink / raw)
  To: OCaml List


Le 25 mai 07 à 14:31, Nicolas Pouillard a écrit :

> Yes our system to move things out of the build is really partial
> (since we still don't what a good way will be). I often use a shell
> script to install things, or start it directly from the build.

Regarding executables I think the symbolic link should not be put in  
the directory in which ocamlbuild is invoked. Either put it in the  
directory in which the target ml file is or do not create links at  
all. In a case I have a directory layout conceptually similar to this :

> > ls */*
> src/a.ml                test/test.ml
> src/a.mli               testalt/test.ml

So each time I build one of the test executable with

> > ocamlbuild -I src test/test.native

or

> > ocamlbuild -I src testalt/test.native

it changes the symbolic link test.native in the root directory.  
However I would like to have both executables at hand hence I'd  
prefer the symbolic links to be respectively created in test and  
testalt. It is annoying because I never remember which test I last  
built when I invoke test.native and often end up with the wrong one.

But putting links in subdirectories means more work for ocamlbuild - 
clean. Maybe the best alternative is to not create symbolic links at  
all and force the user to hunt in _build or to use

> > ocamlbuild -quiet -I src test/test.native --
> > ocamlbuild -quiet -I src testalt/test.native --

to launch its executables. This avoids any symbolic link confusion.


Le 25 mai 07 à 14:49, Joel Reymont a écrit :

> I totally love ocamlbuild, btw, I think it's awesome!

I concur, there is something magic about it. But there are minor  
points that annoy me at the moment  (e.g. by default the _log file  
should be written in the _build/ directory, and apparently the emacs  
mode was not updated to look for .annot files in the _build directory).

Best,

Daniel


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

* Re: [Caml-list] ocamlbuild and subdirectories
  2007-05-25 14:34       ` Daniel Bünzli
@ 2007-05-25 16:59         ` Nicolas Pouillard
  2007-05-26 12:36           ` Daniel Bünzli
  0 siblings, 1 reply; 12+ messages in thread
From: Nicolas Pouillard @ 2007-05-25 16:59 UTC (permalink / raw)
  To: Daniel Bünzli; +Cc: OCaml List

On 5/25/07, Daniel Bünzli <daniel.buenzli@epfl.ch> wrote:
>
> Le 25 mai 07 à 14:31, Nicolas Pouillard a écrit :
>
> > Yes our system to move things out of the build is really partial
> > (since we still don't what a good way will be). I often use a shell
> > script to install things, or start it directly from the build.
>
> Regarding executables I think the symbolic link should not be put in
> the directory in which ocamlbuild is invoked. Either put it in the
> directory in which the target ml file is or do not create links at
> all. In a case I have a directory layout conceptually similar to this :
>
> > > ls */*
> > src/a.ml                test/test.ml
> > src/a.mli               testalt/test.ml
>
> So each time I build one of the test executable with
>
> > > ocamlbuild -I src test/test.native
>
> or
>
> > > ocamlbuild -I src testalt/test.native
>
> it changes the symbolic link test.native in the root directory.
> However I would like to have both executables at hand hence I'd
> prefer the symbolic links to be respectively created in test and
> testalt. It is annoying because I never remember which test I last
> built when I invoke test.native and often end up with the wrong one.
>
> But putting links in subdirectories means more work for ocamlbuild -
> clean. Maybe the best alternative is to not create symbolic links at
> all and force the user to hunt in _build or to use

The link feature was made to don't loose the user and help him to
understand the _build directory system. However when one become more
experienced I advise to hunt directly in the _build directory.

You can even forbid ocamlbuild to make these links with the flag
-no-links or the option Options.make_links.

> > > ocamlbuild -quiet -I src test/test.native --
> > > ocamlbuild -quiet -I src testalt/test.native --
>
> to launch its executables. This avoids any symbolic link confusion.

In a prototyping/scripting mode running directly them is really nice.

> Le 25 mai 07 à 14:49, Joel Reymont a écrit :
>
> > I totally love ocamlbuild, btw, I think it's awesome!
>
> I concur, there is something magic about it. But there are minor
> points that annoy me at the moment  (e.g. by default the _log file
> should be written in the _build/ directory, and apparently the emacs
> mode was not updated to look for .annot files in the _build directory).

If you want the _log to be in _build, just say it (-log _build/_log).
For the emacs mode since both authors don't use emacs we don't have
ported yet. Damien Doligez will do it but you can also send patches ;)

Regards,

-- 
Nicolas Pouillard

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

* Re: [Caml-list] ocamlbuild and subdirectories
  2007-05-25 16:59         ` Nicolas Pouillard
@ 2007-05-26 12:36           ` Daniel Bünzli
  0 siblings, 0 replies; 12+ messages in thread
From: Daniel Bünzli @ 2007-05-26 12:36 UTC (permalink / raw)
  To: OCaml List


Le 25 mai 07 à 18:59, Nicolas Pouillard a écrit :

> If you want the _log to be in _build, just say it (-log _build/_log).

Yes, but it is the default behaviour that is important. In that case  
since I won't consult it most of the time, the _log file is noise,  
and noise should be hidden by default.

Best,

Daniel


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

end of thread, other threads:[~2007-05-26 12:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-25 11:20 ocamlbuild and subdirectories Joel Reymont
2007-05-25 11:34 ` [Caml-list] " Nicolas Pouillard
2007-05-25 11:43   ` Joel Reymont
2007-05-25 12:27     ` Nicolas Pouillard
2007-05-25 11:46   ` Joel Reymont
2007-05-25 12:31     ` Nicolas Pouillard
2007-05-25 12:35       ` Joel Reymont
2007-05-25 12:47         ` Nicolas Pouillard
2007-05-25 12:49           ` Joel Reymont
2007-05-25 14:34       ` Daniel Bünzli
2007-05-25 16:59         ` Nicolas Pouillard
2007-05-26 12:36           ` Daniel Bünzli

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