Plasma GitLab Archive
Projects Blog Knowledge

Programming with Objective Caml Document Tree
 
  NAVIGATION

Programming
 Caml
Caml Components
 Findlib
 Ocamlnet
 XML
 WDialog
 Applications
 JavaCaml
 Other Projects
 GODI
 How to...
 Download


RELATED
The Findlib manual online


Contact
   

Caml Components

Here you find some collections of Objective Caml modules that have general-purpose characteristics and that can be used for many tasks. In order to make life easier, these components are distributed as packages which simply means that they apply some rules for compiling, installing and linking them; see below for details.

All packages are distributed with the same, very liberal license which mainly excludes any warranty or liability, but allows any form of distribution provided that the copyright notice is included. The detailed license text is contained in every tarball in the file LICENSE.

All packages have been tested to some extent, and most of them are used by myself in my own programs. This means that they work for me, but there may still be bugs. I'm interested in coming into contact with the users of my software; please mail me if you have successfully solved a problem with it, or if you have trouble. You can also send wishes how to improve the software. This is my email address.

As already pointed out, I use a package format. This means:

  • All components are distributed as gzip'ed tar-files containing the full source code.

  • You need the package manager findlib to compile, install, and use the components. Findlib mainly stores the compiled components in a central directory, and maintains a database with meta data; most importantly you can find there information how to compile and link the components to your own program.

  • You do not need to configure the components; this is one of the advantages of the package manager.

  • All components are compiled by

    make all
    to get a bytecode archive, whereas

    make opt
    creates a machine code archive.
  • All components can be installed by

    make install
    and uninstalled by

    make uninstall
    You can uninstall a package even if you do not have the Makefile of the distribution by hand:

    ocamlfind remove name-of-the-package
  • Once you have installed the component, you can ask the package manager which additional compiler and linker options are needed for your own program. There is a convenience frontend (driver) for the compiler, for instance you can compile with

    ocamlfind ocamlc -package name-of-the-package -c my_program.c
    
    and link with

    ocamlfind ocamlc -package name-of-the-package -linkpkg \
      -o my_program my_program.cmo
    
    in order to get your program compiled and linked with the component. This driver even finds out if the component needs another component as prerequisite, and links it to the binary, too. This means that you need not worry about where the component is installed, which paths to include, and which libraries to link with the program.
  • The package manager can create a special toploop which is able to load packages by name. This means that Caml scripts can force to load a package by the directive

    #require "name-of-the-package"
    
    which looks up necessary information to load the package, and loads it.

See also the Findlib Quickstart Guide.

The package manager itself is simple to compile and install, too, but it requires an additional configuration step. On many platforms, it can be configured automatically by a script coming with the distribution. I've written a manual for findlib that explains the package manager step-by-step.

I hope that the package manager does not deter you from trying the components. It is only one extra step, and the manager is designed to simplify the usage of components especially for beginners.

 
This web site is published by Informatikbüro Gerd Stolpmann
Powered by Caml