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
[announce] dl-runtime
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alain Frisch <frisch@c...>
Subject: [announce] dl-runtime

this is to announce the availability of dl-runtime, a patch to OCaml for
using primitives from shared libraries.

This is done by allowing runtime systems (ocamlrun or custom systems)
to load shared libraries, in addition to statically linked primitives,
in order to fulfill the requirements of the bytecode primitive table.

There is no special annotation in the source code: the choice of using
shared libraries is done at runtime.

There are two ways to specify which libraries to import:

- give this information via the runtime system command line ("-l..."):
    ocamlrun -l/usr/local/lib/ocaml/ my_program
    LD_LIBRARY_PATH=/usr/local/lib/ocaml ocamlrun

- give the Caml linker a set of shared libraries to remember at runtime
  ("-dl ...")
    ocaml -noautolink -o my_program unix.cma my_program.cmo -dl

  This simply puts annotations in the bytecode file.

For instance, it is possible to build shared versions of libunix,
libgraphics, libstr ... and use a small generic runtime system
to run any bytecode program using these libraries.

The patch is known to work under Linux 2.2 and Solaris 5.7.


  Alain Frisch