From: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
To: jon <jon@ffconsultancy.com>
Cc: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Concurrent ocamlbuild
Date: Mon, 05 Nov 2007 11:49:26 +0100 [thread overview]
Message-ID: <1194259044-sup-1150@ausone.inria.fr> (raw)
In-Reply-To: <200711051011.43263.jon@ffconsultancy.com>
Excerpts from jon's message of Mon Nov 05 11:11:42 +0100 2007:
> On Sunday 04 November 2007 18:06, Erick wrote:
> > Did you see the -j N option?
> >
> > > ocamlbuild -h
> >
> > ...
> > -j <N> Allow N jobs at once (0 for unlimited)
> > ...
>
> I hadn't noticed that, thanks. However, it doesn't seem to work (at least for
> this project). My old Makefile takes 21s and ocamlbuild with -j anything
> still takes at least 45s. Moreover, the Makefile isn't as parallel as it
> could be...
Is it native compilation, byte-code compilation?
The byte-code one offer more opportunities for parallelism than the native
one if we respect dependencies to allow cross module inlining. Since the
compiler does not complain about not found ".cmx" you can do more parallelism
in your Makefile. However that's risky and can leads to worst performances
(less inlining).
Sometimes using libraries (.mllib) can give more parallelism than the
traditional ocamlbuild discovery of sources.
So you can try...
$ cat mylib.mllib
# Put here all modules needed by your main program
# You can gather them by looking at the link command produced by ocamlbuild
A B C D E
$ cat myocamlbuild.ml
open Ocamlbuild_plugin;;
open Ocamlbuild_pack;;
dispatch begin function
| After_rules ->
ocaml_lib "mylib"
| _ -> ()
end;;
$ cat _tags
<myprog.{byte,native}>: use_mylib
$ ocamlbuild mylib.cma mylib.cmxa myprog.byte myprog.native
HTH,
--
Nicolas Pouillard aka Ertai
prev parent reply other threads:[~2007-11-05 10:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-04 13:09 Jon Harrop
2007-11-04 18:06 ` [Caml-list] " Erick Tryzelaar
2007-11-05 10:11 ` Jon Harrop
2007-11-05 10:49 ` Nicolas Pouillard [this message]
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=1194259044-sup-1150@ausone.inria.fr \
--to=nicolas.pouillard@gmail.com \
--cc=caml-list@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