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.2 required=5.0 tests=AWL,HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 1AA48BC69 for ; Mon, 3 Dec 2007 21:56:22 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAGv8U0dC+Vyrj2dsb2JhbACCPTaMWAEBAQEHBAQTEQUC X-IronPort-AV: E=Sophos;i="4.23,245,1194217200"; d="scan'208";a="19941010" Received: from ug-out-1314.google.com ([66.249.92.171]) by mail4-smtp-sop.national.inria.fr with ESMTP; 03 Dec 2007 21:56:21 +0100 Received: by ug-out-1314.google.com with SMTP id k40so1544202ugc for ; Mon, 03 Dec 2007 12:56:21 -0800 (PST) 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=VVna+rIdPBVCMi694nqjV17+cTM4WSXq9tMuiROTM9M=; b=dqg9t8JoCX797IEok703iy+AMN6T5Ofn9YAOjYNqUf0NpFIQQzTJqVN9yQwFKxiV4rpJyaunkqN5pmP0ezvAlRGdZdwDMDzq9dRgOWTf1Xyr3i0VB6jhrlCBLpIOSC51yRiYr4d1cYF3F+FCLTSzUDmSmkMkjDPotQX+evbUoUk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:to:subject:mime-version:content-type; b=a43Ob0Iz8SCbI5Yz2je+Dt2TEFX4LSJ3s8fVALK+T/OS/7RWbK9Rk1D16Z85JtP9KqaaWcDWVTNqOmU3EX/oqTty1AVt0hwWmGVyiK9wyvHyV/pGmV3ZUm+m1HVVJLIQWsmhu7Idm3U4jKWyVR2IsOO1Q/wLCF4tHfe7oDyD4e4= Received: by 10.78.165.16 with SMTP id n16mr3464162hue.1196715377063; Mon, 03 Dec 2007 12:56:17 -0800 (PST) Received: by 10.78.180.12 with HTTP; Mon, 3 Dec 2007 12:56:16 -0800 (PST) Message-ID: Date: Mon, 3 Dec 2007 15:56:16 -0500 From: "Ashish Agarwal" To: caml-list@yquem.inria.fr Subject: error building native code with ocamlbuild MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2366_8338683.1196715377071" X-Spam: no; 0.00; byte-code:01 bug:01 ocaml:01 lib:01 extern:01 byte:01 endline:01 getcwd:01 byte:01 usr:01 ocamlopt:01 cmxa:01 cmxa:01 cmx:01 usr:01 ------=_Part_2366_8338683.1196715377071 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Using ocamlbuild on the following example to build native code includes a library twice, causing an error, but byte-code works fine. Am I doing something wrong or is it a bug? Thanks for any help. ~/tmp$ cat myocamlbuild.ml open Ocamlbuild_plugin;; open Command;; dispatch begin function | After_rules -> ocaml_lib ~extern:true "unix"; | _ -> () end;; ~/tmp$ cat _tags : use_unix ~/tmp$ cat pwd.ml let _ = print_endline (Unix.getcwd()) ~/tmp$ ocamlbuild pwd.byte Finished, 3 targets (3 cached) in 00:00:00. ~/tmp$ ocamlbuild pwd.native + /usr/local/bin/ocamlopt.opt unix.cmxa unix.cmxa pwd.cmx -o pwd.native Files /usr/local/lib/ocaml/unix.cmxa and /usr/local/lib/ocaml/unix.cmxa both define a module named Unix Command exited with code 2. Compilation unsuccessful after building 4 targets (2 cached) in 00:00:00. ------=_Part_2366_8338683.1196715377071 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Using ocamlbuild on the following example to build native code includes a library twice, causing an error, but byte-code works fine. Am I doing something wrong or is it a bug? Thanks for any help.

~/tmp$ cat myocamlbuild.ml
open Ocamlbuild_plugin;;
open Command;;

dispatch begin function
  | After_rules ->
      ocaml_lib ~extern:true "unix";
  | _ -> ()
end;;

~/tmp$ cat _tags
<pwd.{native,byte}>: use_unix

~/tmp$ cat pwd.ml
let _ = print_endline (Unix.getcwd())

~/tmp$ ocamlbuild pwd.byte
Finished, 3 targets (3 cached) in 00:00:00.

~/tmp$ ocamlbuild pwd.native
+ /usr/local/bin/ocamlopt.opt unix.cmxa unix.cmxa pwd.cmx -o pwd.native
Files /usr/local/lib/ocaml/unix.cmxa and /usr/local/lib/ocaml/unix.cmxa
both define a module named Unix
Command exited with code 2.
Compilation unsuccessful after building 4 targets (2 cached) in 00:00:00.

------=_Part_2366_8338683.1196715377071--