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=0.3 required=5.0 tests=AWL,HTML_MESSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 11DB1BB84 for ; Mon, 30 Jun 2008 23:37:23 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApYAACfvaEjRVcbldWdsb2JhbACCPzSPTkMBDAMEBgcPmWGEZw X-IronPort-AV: E=Sophos;i="4.27,728,1204498800"; d="scan'208";a="14602713" Received: from concorde.inria.fr ([192.93.2.39]) by mail1-smtp-roc.national.inria.fr with ESMTP; 30 Jun 2008 23:37:22 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m5ULbMHP027775 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 30 Jun 2008 23:37:22 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApYAACfvaEjRVcbldWdsb2JhbACCPzSPTkMBDAMEBgcPmWGEZw X-IronPort-AV: E=Sophos;i="4.27,728,1204498800"; d="scan'208";a="14602710" Received: from rv-out-0506.google.com ([209.85.198.229]) by mail1-smtp-roc.national.inria.fr with ESMTP; 30 Jun 2008 23:37:21 +0200 Received: by rv-out-0506.google.com with SMTP id k40so1346315rvb.57 for ; Mon, 30 Jun 2008 14:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=ZPOytWBrUuxw/sTxJQecQTrtdyDQ/3xNZxXCG0fmHe0=; b=MLSIPo97JVNCwYnEotrMw2l/sXSDijwtU5FgqyVHuRWMcxhUROZpXLK4DwfTDrbO2O yeD46fR/KPGzyKKo9L4isFJPzHMb38rVDBIbhGryZh+PsbG3YMXN3IVkfg6pnzBoNL7z qfIxESleTq5Yztmvp6O/zQeBiSLy1A8NdL5GQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=e3BSjW5YStMYRcpoV83XV4+GZpwksJf3fEshX1BWn238GWlah42C1i8mhTVT3GbWj0 SRuXE2IE20ywoOYhELSW0w4H9lkK3GFQmEh9KvabC8k6ZKnNZxkk3fL+XvBwO1axZPOx mol3Z39/vb6jwfJIhakrNV7HElRgU5cMyZiho= Received: by 10.140.165.21 with SMTP id n21mr3001179rve.97.1214861840444; Mon, 30 Jun 2008 14:37:20 -0700 (PDT) Received: by 10.141.19.4 with HTTP; Mon, 30 Jun 2008 14:37:20 -0700 (PDT) Message-ID: Date: Mon, 30 Jun 2008 17:37:20 -0400 From: "Ashish Agarwal" To: "Caml List" Subject: ocamlbuild fails to link dependent module MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_28061_21000689.1214861840429" X-Miltered: at concorde with ID 48695212.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; reproduces:01 mli:01 val:01 lib:01 lib:01 byte:01 ocamlc:01 cmo:01 cmo:01 byte:01 exited:01 mli:01 reproduces:01 val:01 ocamlc:01 ------=_Part_28061_21000689.1214861840429 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I cannot get ocamlbuild to link properly under a very specific situation that involves nested and packed modules. The following is a minimal example that reproduces the problem. $ cat a2.mli val f : unit -> unit $ cat a2.ml let f _ = () $ cat lib.ml module A = A2 $ cat b.ml let g = Lib.A.f $ cat sup.mlpack B $ cat prog.ml let _ = Sup.B.g () Now try compiling: $ ocamlbuild prog.byte + /Users/ashish/godi/bin/ocamlc.opt lib.cmo sup.cmo prog.cmo -o prog.byte Error while linking lib.cmo: Reference to undefined global `A2' Command exited with code 2. The problem is that a2.cmo should be included but is not. The linking is done correctly if I do any of the following: - delete a2.mli - in prog.ml, directly call Lib.A.f (which is what Sup.B.g is defined as) - in prog.ml, directly call B.g, without packing B in Sup I would appreciate any help. Thank you. ------=_Part_28061_21000689.1214861840429 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I cannot get ocamlbuild to link properly under a very specific situation that involves nested and packed modules. The following is a minimal example that reproduces the problem.

$ cat a2.mli
val f : unit -> unit

$ cat a2.ml
let f _ = ()

$ cat lib.ml 
module A = A2

$ cat b.ml
let g = Lib.A.f

$ cat sup.mlpack 
B

$ cat prog.ml 
let _ = Sup.B.g ()

Now try compiling:
$ ocamlbuild prog.byte
+ /Users/ashish/godi/bin/ocamlc.opt lib.cmo sup.cmo prog.cmo -o prog.byte
Error while linking lib.cmo: Reference to undefined global `A2'
Command exited with code 2.

The problem is that a2.cmo should be included but is not. The linking is done correctly if I do any of the following:
- delete a2.mli
- in prog.ml, directly call Lib.A.f (which is what Sup.B.g is defined as)
- in prog.ml, directly call B.g, without packing B in Sup

I would appreciate any help. Thank you.

------=_Part_28061_21000689.1214861840429--