caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Andrew Warshaver <awarshaver@janestcapital.com>
To: caml-list@yquem.inria.fr
Subject: missing library on .native using ocamlbuild
Date: Thu, 28 Jun 2007 17:02:21 -0400	[thread overview]
Message-ID: <468421DD.5040402@janestcapital.com> (raw)

Hello,

I'm trying to compile a program called live_query, to native code. 
After I finally got ocamlbuild to be happy, now when I run it I get a 
complaint of a missing library.  I was under the (apparently false) 
impression that after one compiles to native code no more linking needs 
to be done.

My error message:
$ ./live_query.native
./live_query.native: error while loading shared libraries: liblbm.so.1: 
cannot open shared object file: No such file or directory

I actually do have access to this library; it should not a problem to 
link it in, but I do not know how to tell ocamlbuild either to look at a 
specific spot at runtime for this library or to force it linked in at 
compile time.

Please help if you might know why :)  Thanks you!

Andrew

I also include my myocamlbuild.ml:

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

let packages = "bigarray,pcre,res,netstring";;

let janeheaders = ["janebase/lb/cephes/mconf.h"; 
"janebase/lb/cephes/protos.h"; "janebase/lb/ocaml_utils.h"];;

let ocamlfind cmd =
   S [A "ocamlfind"; A cmd; A "-package"; A packages];;

flag ["ocaml"; "compile"] (A"-thread");;
flag ["ocaml"; "link"; "program"] (S[A"-linkpkg"; A"-thread"]);;

dispatch begin function
   | After_options ->
       Options.ocamlc := ocamlfind "c";
       Options.ocamlopt := ocamlfind "opt";
       Options.ocamldep := ocamlfind "dep";
   | After_rules ->
       ocaml_lib "janebase/lb/jane";
       ocaml_lib "lbm/lb/lbm";

       flag ["link"; "library"; "ocaml"; "byte"; "use_libjane"]
         (S[
            A"-ccopt"; A"-Ljanebase/lb";
            A"-dllpath"; A"janebase/lb";
            A"-dllib"; A"-ljane"; A"-ccopt"; A"-ljane"]);

       flag ["link"; "library"; "ocaml"; "native"; "use_libjane"]
         (S[A"-cclib"; A"-Ljanebase/lb"; A"-cclib"; A"-ljane"]);

       flag ["link"; "library"; "ocaml"; "byte"; "use_liblbm"]
         (S[
           A"-ccopt"; A"-Llbm/lb"; A"-ccopt"; A"-llbm_stubs";
           A"-dllpath"; A"lbm/lb"; A"-dllib"; A"-llbm_stubs";
           A"-cclib"; A"-L/opt/lbm-3.0/Linux-2.4-glibc-2.3-i686/lib";
           A"-cclib"; A"-llbm"]);

       flag ["link"; "library"; "ocaml"; "native"; "use_liblbm"]
         (S[A"-cclib"; A"-Llbm/lb"; A"-cclib"; A"-llbm_stubs";
            A"-cclib"; A"-L/opt/lbm-3.0/Linux-2.4-glibc-2.3-i686/lib";
            A"-cclib"; A"-llbm"]);

       flag ["compile"; "liblbm_headers"]
         (S[A"-ccopt"; A"-I/opt/lbm-3.0/Linux-2.4-glibc-2.3-i686/include"]);

       dep ["link"; "ocaml"; "use_libjane"] ["janebase/lb/libjane.a"];
       dep ["link"; "ocaml"; "use_liblbm"] ["lbm/lb/liblbm_stubs.a"];

       dep ["sexp_pp"] ["janebase/sexp/lib/pa_sexp_conv.cmo"; 
"type-conv/pa_type_conv.cmo"];

       dep ["compile"; "c"; "libjane_headers"] janeheaders;
   | _ -> ()
end


                 reply	other threads:[~2007-06-28 21:02 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=468421DD.5040402@janestcapital.com \
    --to=awarshaver@janestcapital.com \
    --cc=caml-list@yquem.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).