caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* 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

* Re: [Caml-list] error building native code with ocamlbuild
  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
  0 siblings, 2 replies; 5+ messages in thread
From: Ashish Agarwal @ 2007-12-04 15:31 UTC (permalink / raw)
  To: Erick Tryzelaar; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 89 bytes --]

Thanks. Is there a list of tags somewhere? I cannot find them in the user
guide or wiki.

[-- Attachment #2: Type: text/html, Size: 97 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] error building native code with ocamlbuild
  2007-12-04 15:31   ` Ashish Agarwal
@ 2007-12-05  2:19     ` Erick Tryzelaar
  2007-12-06 17:28     ` Nicolas Pouillard
  1 sibling, 0 replies; 5+ messages in thread
From: Erick Tryzelaar @ 2007-12-05  2:19 UTC (permalink / raw)
  To: Ashish Agarwal; +Cc: caml-list

Ashish Agarwal wrote:
> Thanks. Is there a list of tags somewhere? I cannot find them in the 
> user guide or wiki.
>
I don't believe so, but that'd be nice. From what I understand, you can 
just do "use_foo" with all of the built in ocaml libraries, like str, 
nums, and etc.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] error building native code with ocamlbuild
  2007-12-04 15:31   ` Ashish Agarwal
  2007-12-05  2:19     ` Erick Tryzelaar
@ 2007-12-06 17:28     ` Nicolas Pouillard
  1 sibling, 0 replies; 5+ messages in thread
From: Nicolas Pouillard @ 2007-12-06 17:28 UTC (permalink / raw)
  To: Ashish Agarwal; +Cc: Erick Tryzelaar, caml-list

Excerpts from Ashish Agarwal's message of Tue Dec 04 16:31:58 +0100 2007:
> Thanks. Is there a list of tags somewhere? I cannot find them in the user
> guide or wiki.

You  can  get  dynamic  list  of  flags  (referring  to  tags) and rules using
ocamlbuild -documentation.

Regards,
-- 
Nicolas Pouillard aka Ertai


^ 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;
as well as URLs for NNTP newsgroup(s).