caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Hugo Ferreira <hmf@inescporto.pt>
To: caml-list@inria.fr
Subject: ocamlbuild: -use-runtime flag not working?
Date: Mon, 28 Jul 2008 08:20:14 +0100	[thread overview]
Message-ID: <488D732E.9020600@inescporto.pt> (raw)

Hello,

I am attempting to use the MLCuDD library that gives me access to
the CuDD C library. I order to use this library I did various
successful experiments using the ocamlbuid command-line.
Two examples are:

  # Bytecode, one option
ocamlbuild -no-hygiene -Is $PROJ_PATH -lib cudd -cflags 
-I,/home/hugof/Desktop/cudd/ -lflags 
-I,/home/hugof/Desktop/cudd/,-use-runtime,/home/hugof/Desktop/cudd/cuddrun 
-verbose 100 src/parser.byte

Bytecode, second option
#ocamlbuild -no-hygiene -Is $PROJ_PATH -lib cudd -cflags 
-I,/home/hugof/Desktop/cudd/ -lflags 
-I,/home/hugof/Desktop/cudd/,-custom -verbose 100 src/parser.byte

I assume that the use of "-custom" and "-use-runtime" are equivalent.
I then proceeded to use the _tags and myocamlbuild.ml files.
The contents of these are:

cat _tags
true: use_menhir, debug, profile
<cudd/**>: not_hygienic
"src/parser.d.byte": use_unix, use_cudd

cat myocamlbuild.ml
open Ocamlbuild_plugin;;
open Command;;

dispatch begin function
| After_rules ->
     (* add CuDD library as external library *)
     ocaml_lib ~extern:true ~dir:"/home/hugof/Desktop/cudd" "cudd";

     (* CuDD is a C library. So handle native code linking correctly *)
     flag ["link"; "ocaml"; "byte" ; "use_cudd"]
     (*(S[A"-custom"]);*)
     (S[A"-use-runtime"; A"/home/hugof/Desktop/cudd/cuddrun"]);

| _ -> ()
end;;

Unfortunately, using the above files with the following command:

PROJ_PATH="cudd,src"
ocamlbuild -Is $PROJ_PATH -verbose 100 all.otarget

fails with:

+ /home/hugof/ocaml/godi/bin/ocamlc.opt unix.cma -g -I 
/home/hugof/Desktop/cudd cudd.cma -use-runtime 
/home/hugof/Desktop/cudd/cuddrun src/parser.d.cmo -o src/parser.d.byte
Error while linking /home/hugof/ocaml/godi/lib/ocaml/std-lib/unix.cma(Unix):
The external function `unix_dup' is not available
Command exited with code 2.

However if I use (S[A"-custom"]); compilation succeeds.
Am I doing anything wrong?

TIA,
Hugo Ferreira.



                 reply	other threads:[~2008-07-28  7:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=488D732E.9020600@inescporto.pt \
    --to=hmf@inescporto.pt \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).