From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 9A3E8BC6B for ; Mon, 5 Nov 2007 11:50:05 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAHODLkfAXQInh2dsb2JhbACOcAIBCAopgQ8 X-IronPort-AV: E=Sophos;i="4.21,371,1188770400"; d="scan'208";a="3906752" Received: from concorde.inria.fr ([192.93.2.39]) by mail2-smtp-roc.national.inria.fr with ESMTP; 05 Nov 2007 11:50:05 +0100 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id lA5Ao5mK011132 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 5 Nov 2007 11:50:05 +0100 X-IronPort-AV: E=Sophos;i="4.21,371,1188770400"; d="scan'208";a="3906751" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail2-relais-roc.national.inria.fr with SMTP; 05 Nov 2007 11:50:04 +0100 Received: by ausone.inria.fr (sSMTP sendmail emulation); Mon, _d Nov 2007 11:49:26 +0100 From: "Nicolas Pouillard" Cc: caml-list Subject: Re: [Caml-list] Concurrent ocamlbuild To: jon References: <200711041309.44590.jon@ffconsultancy.com> <472E0A0D.3010106@dslextreme.com> <200711051011.43263.jon@ffconsultancy.com> In-Reply-To: <200711051011.43263.jon@ffconsultancy.com> Date: Mon, 05 Nov 2007 11:49:26 +0100 Message-Id: <1194259044-sup-1150@ausone.inria.fr> User-Agent: Sup/0.2 Content-Type: text/plain; charset=UTF-8 X-Miltered: at concorde with ID 472EF55D.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; makefile:01 makefile:01 compilation:01 byte-code:01 compilation:01 byte-code:01 parallelism:01 dependencies:01 inlining:01 compiler:01 cmx:01 parallelism:01 inlining:01 mylib:01 ocaml:01 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 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 : use_mylib $ ocamlbuild mylib.cma mylib.cmxa myprog.byte myprog.native HTH, -- Nicolas Pouillard aka Ertai