* error building native code with ocamlbuild
@ 2007-12-03 20:56 Ashish Agarwal
2007-12-04 5:00 ` [Caml-list] " Erick Tryzelaar
0 siblings, 1 reply; 5+ messages in thread
From: Ashish Agarwal @ 2007-12-03 20:56 UTC (permalink / raw)
To: caml-list
[-- Attachment #1: Type: text/plain, Size: 849 bytes --]
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.
[-- Attachment #2: Type: text/html, Size: 1064 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Caml-list] error building native code with ocamlbuild
2007-12-03 20:56 error building native code with ocamlbuild Ashish Agarwal
@ 2007-12-04 5:00 ` Erick Tryzelaar
2007-12-04 15:31 ` Ashish Agarwal
0 siblings, 1 reply; 5+ messages in thread
From: Erick Tryzelaar @ 2007-12-04 5:00 UTC (permalink / raw)
To: Ashish Agarwal; +Cc: caml-list
Ashish Agarwal wrote:
> 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.
It looks like you're getting the unix library added twice, which
ocamlopt doesn't like. In your case, I don't think you even need the
myocamlbuild.ml file. ocamlbuild already has the unix library set up for
it, so the _tags file should be enough for you.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2007-12-06 17:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-03 20:56 error building native code with ocamlbuild Ashish Agarwal
2007-12-04 5:00 ` [Caml-list] " Erick Tryzelaar
2007-12-04 15:31 ` Ashish Agarwal
2007-12-05 2:19 ` Erick Tryzelaar
2007-12-06 17:28 ` Nicolas Pouillard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox