caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: xclerc <xavier.clerc@inria.fr>
To: Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] problems with ocamlbuild in 3.12
Date: Thu, 21 Apr 2011 09:32:22 +0200	[thread overview]
Message-ID: <76F38E09-21B2-4639-B20E-ED3B59DF2784@inria.fr> (raw)
In-Reply-To: <609126.88288.qm@web120619.mail.ne1.yahoo.com>


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 <http://caml.inria.fr/mantis> 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



      reply	other threads:[~2011-04-21  7:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-18 12:14 evil sloot
2011-04-21  7:32 ` xclerc [this message]

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=76F38E09-21B2-4639-B20E-ED3B59DF2784@inria.fr \
    --to=xavier.clerc@inria.fr \
    --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).