caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: DooMeeR <d@doomeer.com>
To: Jon Harrop <jon@ffconsultancy.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: ocamlbuild documentation (was Re: [Caml-list] Re: [ANN] OCaml Batteries Included, alpha 3)
Date: Mon, 09 Feb 2009 22:24:36 +0100	[thread overview]
Message-ID: <49909F14.6010601@doomeer.com> (raw)
In-Reply-To: <200902091828.30057.jon@ffconsultancy.com>

I'll skip over the documentation questions because people are beginning 
to say that I troll too much :p

> Instead, I found that ocamlbuild replaces my current build option of choice:
> 
>   ocamlopt foo.ml -I +lablGL lablgl.cmxa lablglut.cmxa foo.ml -o foo
> 
> with lots of incidental complexity:
> 
> $ cat myocamlbuild.ml
> open Ocamlbuild_plugin;;
> open Command;;
> 
> dispatch begin function
> | After_rules ->
>     ocaml_lib ~extern:true ~dir:"+lablGL" "lablgl";
>     ocaml_lib ~extern:true ~dir:"+lablGL" "lablglut";
> | _ -> ()
> end;;
> 
> $ cat _tags
> <main.{byte,native}>: use_lablgl, use_lablglut
> <**/*.ml>: use_lablgl
> 
> $ ocamlbuild foo.native

This is, indeed, and in my opinion, one of the BIGGEST problem with 
Ocamlbuild right now. In fact you didn't chose the easiest solution, 
which is:

ocamlbuild -cflags -I,+lablGL -lflags -I,+lablGL -lib lablgl -lib 
lablglut foo.native

However, this is of course very hackish, not documented (took me a while 
to figure that this was the simplest way of using a library), and still 
not satisfying at all. The extension of Ocamlbuild I am working on 
should allow you to replace this by:

ocamlbuild -pkg lablGL.glut foo.native

(the package lablGL.glut depends on the package lablGL, which will thus 
be included automatically)

I will work on an extension to allow tags such as use_pkg(lablGL.glut) 
to put this in a _tag file if you get tired of using the command line 
option.

This will require findlib though. If you do not have findlib, another 
solution I may implement someday would be:

ocamlbuild -libs +lablGL/lablgl,+lablGL/lablglut foo.native

Which is still better than the solution using ocamlopt directly IMO 
(because here, ocamlbuild can at least guess whether it should include 
the .cmxa or the .cma).

Now, I don't think it will happen someday that Ocamlbuild will be able 
to guess that lablGL should be included. It raises too many questions :(

-- 
Romain Bardou


  reply	other threads:[~2009-02-09 21:24 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-06 16:11 [ANN] OCaml Batteries Included, alpha 3 David Rajchenbach-Teller
2009-02-07 14:21 ` [Caml-list] " Mikkel Fahnøe Jørgensen
2009-02-07 14:43   ` Sylvain Le Gall
2009-02-07 14:58     ` [Caml-list] " Jon Harrop
2009-02-07 15:13       ` Sylvain Le Gall
2009-02-07 16:13         ` [Caml-list] " Matthieu Dubuget
2009-02-07 19:30           ` David Rajchenbach-Teller
2009-02-07 21:13             ` Matthieu Dubuget
2009-02-09  9:36           ` Romain Bardou
2009-02-09 15:56             ` David Teller
2009-02-07 15:46       ` Paolo Donadeo
2009-02-09  9:32       ` Romain Bardou
2009-02-09 10:30         ` ocamlbuild documentation (was Re: [Caml-list] Re: [ANN] OCaml Batteries Included, alpha 3) Daniel Bünzli
2009-02-09 11:51           ` Romain Bardou
2009-02-09 12:30             ` Daniel Bünzli
2009-02-09 12:52               ` Romain Bardou
2009-02-09 13:07                 ` Daniel Bünzli
2009-02-09 13:22                   ` Romain Bardou
2009-02-09 13:36                     ` Daniel Bünzli
2009-02-09 13:59                       ` Romain Bardou
2009-02-09 14:04                         ` Romain Bardou
2009-02-09 14:37                           ` Daniel Bünzli
2009-02-09 17:26                             ` Kuba Ober
2009-02-09 18:28                         ` Jon Harrop
2009-02-09 21:24                           ` DooMeeR [this message]
2009-02-10 14:06                             ` ocamlbuild documentation Jan Kybic
2009-02-10 14:27                               ` [Caml-list] " Matthieu Dubuget
     [not found]                                 ` <87k57ywc0k.fsf@fel.cvut.cz>
2009-02-10 15:50                                   ` Matthieu Dubuget
2009-02-10 15:58                                     ` Daniel Bünzli
2009-02-09 18:38                     ` ocamlbuild documentation (was Re: [Caml-list] Re: [ANN] OCaml Batteries Included, alpha 3) David Teller
2009-02-09 22:02         ` [Caml-list] Re: [ANN] OCaml Batteries Included, alpha 3 Peter Hawkins
2009-02-09 22:45           ` Mikkel Fahnøe Jørgensen
2009-02-09 22:55             ` Mikkel Fahnøe Jørgensen
2009-02-10  7:48             ` Stefano Zacchiroli
2009-02-10 13:22               ` Mikkel Fahnøe Jørgensen
2009-02-07 20:04     ` Daniel Bünzli
2009-02-08 17:22   ` [Caml-list] " Richard Jones
2009-02-09  8:57     ` David Allsopp

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=49909F14.6010601@doomeer.com \
    --to=d@doomeer.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=jon@ffconsultancy.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;
as well as URLs for NNTP newsgroup(s).