From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 763AC7ED26 for ; Thu, 14 Jun 2012 17:47:39 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvQBAK0G2k9ZELGagWdsb2JhbABFtV4BARYmJ4JGE4FxDIYkgXoEmFOhP5BjYAOVIYESkUuBXg X-IronPort-AV: E=Sophos;i="4.75,770,1330902000"; d="scan'208";a="147719445" Received: from recoil.dh.bytemark.co.uk (HELO dark.recoil.org) ([89.16.177.154]) by mail4-smtp-sop.national.inria.fr with SMTP; 14 Jun 2012 17:47:38 +0200 Received: (qmail 30211 invoked by uid 634); 14 Jun 2012 15:47:38 -0000 X-Spam-Level: * X-Spam-Check-By: dark.recoil.org Received: from dhcp-128-232-142-20.eduroam.csx.cam.ac.uk (HELO dhcp-128-232-142-20.eduroam.csx.cam.ac.uk) (128.232.142.20) (smtp-auth username remote@recoil.org, mechanism cram-md5) by dark.recoil.org (qpsmtpd/0.84) with ESMTPA; Thu, 14 Jun 2012 16:47:37 +0100 From: Anil Madhavapeddy Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Thu, 14 Jun 2012 16:47:34 +0100 Message-Id: To: caml-list users Mime-Version: 1.0 (Apple Message framework v1257) X-Mailer: Apple Mail (2.1257) X-Virus-Checked: Checked by ClamAV on dark.recoil.org Subject: [Caml-list] building profile cmx libraries with ocamlbuild Hi, I'm shifting our build system to produce profiling versions of libraries, a= nd am using ocamlbuild's %.p.cmx target. It seems to interact oddly with c= ross-module inlining, and I wanted to check if this was a bug or a misunder= standing on my part. Consider two modules: foo.ml, bar.ml, and Bar has references to Foo. If I = compile 'ocamlbuild bar.cmx', then foo.cmx will be built first and be avail= able to ocamlopt when bar.cmx is being produced. However, if I compile 'ocamlbuild bar.p.cmx', the rule generates 'foo.p.cmx= ', which is not picked up as a valid CMX for the Foo module. This normally= silently works, except in the case when Foo and Bar are being packed into = a module, and the compiler then complains that bar.cmx was compiled without= access to foo.cmx. So what is the best way to fix the rule? I could put in an artificial depen= dency on %.p.cmx->%.cmx to ensure that there is always something picked up.= Alternatively, ocamlopt's compileenv could be modified to also look for %.= .cmx, depending on the current compilation unit's . Or is there a = third, correct way to build a profiled library that I'm missing? Incidentally, I've also had to add a custom build rule for %.d.cmx, which a= ppears to be missing. %.d.cma exists, and %.p.cmx, but not %.p.cma (becaus= e ocamlcp is not supported by ocamlbuild, which is fine), but is the lack o= f a '-g' option for native code libraries an oversight, or unnecessary for = some other reason? -Anil, from the darkest depths of myocamlbuild.ml=