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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 8278FBC6B for ; Wed, 27 Jun 2007 18:35:08 +0200 (CEST) Received: from smtp.janestcapital.com (janestcapital.com [66.155.124.107]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5RGZ79P003204 for ; Wed, 27 Jun 2007 18:35:08 +0200 Received: from [172.25.131.129] [38.96.172.125] by janestcapital.com (SMTPD-9.10) id A1CB0158; Wed, 27 Jun 2007 12:35:23 -0400 Message-ID: <468291BA.3060204@janestcapital.com> Date: Wed, 27 Jun 2007 12:35:06 -0400 From: Andrew Warshaver User-Agent: Thunderbird 2.0.0.0 (X11/20070505) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] ocamlbuild and c libraries References: <46828CCF.20901@janestcapital.com> In-Reply-To: <46828CCF.20901@janestcapital.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-IMAIL-SPAM-VALFROM: (91cb0162000012c6) X-IMAIL-SPAM-VALREVDNS: (91cb0162000012c6) X-Miltered: at discorde with ID 468291BB.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; intern:01 ocaml:01 cmx:01 cmo:01 cmx:01 -for-pack:01 cmo:01 -for-pack:01 intern:01 byte:01 bigarray:01 pcre:01 netstring:01 ocamlfind:01 ocamlfind:01 Andrew Warshaver wrote: > For the most part I tried to follow Nicolas's example on the previous > thread with similar name, but unfortunately I get an error that I do not > entirely understand. > > My target is intern/live_query/live_query.native. It uses an ocaml/c > library called jane that lives in janebase/lb (thanks Nicolas, for the > renaming tip). In there exists a jane.mlpack, and a libjane.clib. Also > there is a couple of _tags file: > > $ cat janebase/lb/_tags > <*.cmx>: for-pack(Jane) > <*.cmo>: for-pack(Jane) > : -for-pack(Jane) > : -for-pack(Jane) > : include > : use_libjane > > $ cat intern/live_query/_tags > <{single,live}_query.{byte,native}>: use_jane (i also tried > include_jane, this results in a different error message; in fact the > same error if I omit this _tags altogether, it says undefined references > in jane.o) > > Also, myocamlbuild.ml : > > $ cat myocamlbuild.ml > open Ocamlbuild_plugin;; > open Command;; > > let packages = "bigarray,pcre,res,netstring" > > let headers = ["janebase/lb/cephes/mconf.h"; > "janebase/lb/cephes/protos.h"];; > > let ocamlfind cmd = > S [A "ocamlfind"; A cmd; A "-package"; A packages; > A "-I"; A "+camlp4"; A "-pp"; A "camlp4orf"; > A "-pp"; A "camlp4o /home/awarshaver/multi-oc/lib/pa_type_conv.cmo > /home/awarshaver/multi-oc/lib/pa_sexp_conv.cmo"];; > > 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 "jane"; > > flag ["link"; "library"; "ocaml"; "byte"; "use_libjane"] > (S[A"-dllib"; A"-ljane"; A"-cclib"; A"-ljane"]); > > flag ["link"; "library"; "ocaml"; "native"; "use_libjane"] > (S[A"-cclib"; A"-ljane"]); > > dep ["link"; "ocaml"; "use_libjane"] ["janebase/lb/libjane.a"]; > > dep ["compile"; "c"] headers; > | _ -> () > end > > I can build the library ok... > > $ ocamlbuild janebase/lb/jane.cmxa > + ocamlfind c -package bigarray,pcre,res,netstring -I +camlp4 -pp > camlp4orf -pp 'camlp4o /home/awarshaver/multi-oc/lib/pa_type_conv.cmo > /home/awarshaver/multi-oc/lib/pa_sexp_conv.cmo' -c > janebase/lb/cephes/main.c > janebase/lb/cephes/main.c: In function ‘main’: > janebase/lb/cephes/main.c:9: warning: control reaches end of non-void > function > Finished, 286 targets (0 cached) in 00:01:12. > > But not my target.. > > $ ocamlbuild intern/live_query/live_query.native > Solver failed: > Ocamlbuild knows of no rules that apply to a target named jane.cmx. > This can happen if you ask Ocamlbuild to build a target with the wrong > extension (e.g. .opt instead of .native) or if the source files live in > directories that have not been specified as include directories. > Backtrace: > - Failed to build the target intern/live_query/live_query.native > - Building intern/live_query/live_query.native: So I think I know why this is bad, it thinks that jane lives in the root directory of my project. This is probably a result of my line ocaml_lib "jane" in myocamlbuild. Removing that, I'm not sure how I should specify to live_query.native that it needs to use jane.cmxa (otherwise, it seems to think it only needs jane.cmx). > - Building jane.a: > - Failed to build all of these: > - Building jane.cmx > - Building jane.mllib > Compilation unsuccessful after building 358 targets (358 cached) in > 00:00:28. > > Insights appreciated! > > Thanks, > Andrew > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs