From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p3L7WRsE002886 for ; Thu, 21 Apr 2011 09:32:27 +0200 X-IronPort-AV: E=Sophos;i="4.64,250,1301868000"; d="scan'208";a="97660897" Received: from mp-57040.rocqadm.inria.fr ([128.93.57.40]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA; 21 Apr 2011 09:32:22 +0200 Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1084) From: xclerc In-Reply-To: <609126.88288.qm@web120619.mail.ne1.yahoo.com> Date: Thu, 21 Apr 2011 09:32:22 +0200 Message-Id: <76F38E09-21B2-4639-B20E-ED3B59DF2784@inria.fr> References: <609126.88288.qm@web120619.mail.ne1.yahoo.com> To: Caml List X-Mailer: Apple Mail (2.1084) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p3L7WRsE002886 Subject: Re: [Caml-list] problems with ocamlbuild in 3.12 Le 18 avr. 2011 à 14:14, evil sloot a écrit : > Hi, > > I'm upgrading from ocaml 3.11 to 3.12 and I'm facing some problems with my ocamlfind buildscripts. > > In essence, I see the following. > > - static linking gives problems when you have multiple libraries with dependencies amongst each other. The gcc linker needs to have them in correct order or it will fail. I have to revert to tricks like this in my ocamlbuild.ml file: > > flag ["ocaml";"link";"is_main"]( > S[A"-linkpkg"; > A"src/otc/libotc.a"; (* depends on libtokyocabinet, so must come before (really) on the linking line *) > A"-ccopt"; A("-L" ^ tc_home); > A"-cclib"; A"-ltokyocabinet"; > ]); > to force the order in which the arguments are processed. > Is there a more > > - building of .cmxa libraries fails in combination with package(...) tags > for example, I have > true:package(lwt) in my _tags file > > and the build of my library gives: > ocamlbuild -use-ocamlfind my_lib.cmxa > > + /usr/bin/ocamlfind ocamlopt -a -linkpkg ... -package lwt .... > -o my_lib.cmxa > File "_none_", line 1, characters 0-1: > Error: /usr/lib/ocaml/unix.cmxa > is not a compilation unit description. > Command exited with code 2. > > the -linkpkg should not be there.... > So how do I avoid this? > > Since I can't find these things in the documentation, I think I can ask here. Sure, but also filling a bug report at is a good idea to ensure tracking, and that developers are notified that a bug has to be fixed. Providing a minimal source file along with the used "_tags" file is also a great help in order to quickly fix a bug. > Also, how do I make it so that ocamlbuild always uses ocamlfind so I > don't have to type > ocamlbuild -use-ocamlfind ... > all the time ? (I could not find it anywhere in the documentation) I don't think you can do so. The "canonical" way of using "ocamlbuild" is to call it from a minimal makefile of shell script. Doing this way, you only pay once the extra "-use-ocamlfind ..." characters. > - ocamlbuild & ocamlfind are part of the core but the reference manual > (http://caml.inria.fr/pub/docs/manual-ocaml/manual022.html) > doesn't even mention them. The "ocamlfind" tool was created and is maintained by Gerd Stolpmann, hence its absence from the Objective Caml manual. At the opposite, the "ocamlbuild" tool was created by Nicolas Pouillard and Berke Durak inside the INRIA and is maintained by the Gallium team. Its absence from the Objective Caml manual stems from the fact that it is not (yet) a first-class citizen tool in the distribution. The medium-term goal is clearly to make it a first-class citizen tool. > - The ocamlbuild manual does not mention the recent developments such as > package(...), and the new way of handling syntax extensions, > - ocamlbuild wiki mostly has old examples. I acknowledge the problem; nevertheless, this allows us to be unbound by compatibility issues... Not that the tool will dramatically change in its behavior, but we are not tightly tied by backward compatibility issues. In the move to make "ocamlbuild" a first-class citizen tool, having a proper and up-to-date documentation is part of the requirements. > - I see that lwt is moving towards Oasis, should I do this too? >From my limited understanding, "ocamlbuild" is a building tool while Oasis[-db] is a packaging tool. Moreover, if memory serves, Oasis can use "ocamlbuild" in order to compile a package / project. Regards, Xavier Clerc