English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Re: [Caml-list] Compiling a library with findlib
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-05-14 (13:46)
From: Sébastien Hinderer <Sebastien.Hinderer@e...>
Subject: Re: Compiling a library with findlib
Dear David, dear all,

> > 1. Is it necessary to compile/install the lib;a and lib.so files ?
> Yes they are both needed:
> lib.so is the bytecode stub library --- so needed for any .cmo file that
> uses the C module
> lib.a is the native stub library --- linked in when you compile with
> ocamlopt for the same purpose

Okay, thanks a lot for this clarification.

> > 2. How can these files be produced (in addition to the .cma and .cmxa
> > files) on a system where ocamlfindlib is installed ?
> I'm a Windows native port user so detest Makefiles that use ocamlmklib
> because the Windows port doesn't include it!

Too bad :)
> The automation provided by ocamlmklib is IMHO pretty simplistic (see #18.10
> in the manual). ocamlmklib -verbose will tell you the commands it uses for
> your project - all the ocamlc/ocamlopt commands can then be prefixed with
> ocamlfind to import any packages you may need.

To me, the work done by ocamlmklib is not _that_ simplistic. Indeed, the
use of -verbose reveals that is calls commands like ar and ranlib, which
I'd prefer not tocall directly in the Makefile.
Also, I'd rather avoid depending on OCamlMakefile, to try to minimize
the dependencies and keep the compilationprocess assimple as possible.

> When doing ocamlfind install, you just need to include lib.so and lib.a with
> the files (r17.html#OCAMLFIND.INSTALL of the findlib docs explains how stub
> libraries are dealt with).

I will have a look to this section, thanks !