Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] ocamlmklib question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] ocamlmklib question
From: Alessandro Baretta <>

> How is ocamlmklib different from ocamlc -a?

ocamlmklib calls differents commands according to its parameters:
* ocamlc -a for .cmo's
* ocamlopt -a for .cmx's
* ar and ld -shared for .o's

It is intended to help you build libraries mixing caml and C code.
In particular it will automatically build both .a and .so forms for
the C code, and add needed linking options in calls to ocaml{c,opt} -a.

Another nice feature is for library developpers is that it
automatically handles the building of shared objects: just compile
your C code with 'ocamlc -c -ccopt "..." src.c', and use ocamlmklib
for linking, and your Makefile will work both on architectures with
and without dynamic loading.

For more details, you can just read the source.

    Jacques Garrigue
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: