findlib.conf(5)

NAME
findlib.conf - [Configuration of findlib/ocamlfind]

GENERAL
There are three possibilities to configure the findlib library:

    Build time:

    Before findlib is compiled, a "configure" script is invoked to figureout the settings that are most likely to work on the system. Mostsettings are simply entered into text files and can easily be changedafter installation. The following properties cannot be changed laterbecause they are compiled into the resulting binaries:

        • The default location of the configuration file findlib.conf. However,you can set a different location by the environment variableOCAMLFIND_CONF.

        • Whether the installed O'Caml version supports autolinking or not.

    Configuration file findlib.conf:

    An initial version of this file is generated by the configure script,but you are free to modify it later. Most important, this filecontains the system-wide search path used to look up packages, and thedefault location where to install new packages.

    All files with the suffix ".conf" found in the directoryfindlib.conf.d are also scanned for parameters.

    Environment variables:

    The settings of findlib.conf can be overridden by environment variables.

Last but not least, several settings can also be passed ascommand-line options, or by invoking the functionFindlib.init.

findlib.conf
The directory containing findlib.conf is determined at build time (byrunning the configure script), the fallback default is/usr/local/etc. You can set a different location bychanging the environment variable OCAMLFIND_CONFwhich must contain the absolute path of findlib.conf.

The file has the same syntax as META, i.e. it consists of anumber of lines with the format

variable
 = "
value
"

Here is the list of allowed variables:

    path

    The search path for META files/package directories. The variableenumerates directories which are separated by colons (Windows:semicolons), and these directories are tried in turn to find a certainpackage. More exactly, if d is such a directory and p the searchedpackage, the search algorithm will first check whether d/p/METAexists. In this case, this META file is taken, and d/p is the packagedirectory. Second, the algorithm tries d/META.p, but the packagedirectory must be specified in this META.p file by adirectorydirective.

    Note that the first found META file is taken, so the order of thedirectories in the search path counts.

    This variable is required.

    Example:

    path = "/usr/local/lib/ocaml/site-lib:/usr/lib/ocaml/site-lib"

    destdir

    This variable determines the location where ocamlfindinstallputs the packages by default: If d is thisdirectory, and p the package to install, a new subdirectory d/p willbe created containing all the files of the package.

    Example:

    destdir = "/usr/local/lib/ocaml/site-lib"

    This variable is required.

    metadir

    If set, the command ocamlfind installwill put theMETA files of packages into this directory (files are named META.pwhere p=package name); otherwise the META files are put into thepackage directories like any other file.

    Example:

    metadir = "/var/lib/findlib/metaregistry"

    This variable is optional. It is not used by default.

    ocamlc,ocamlopt,ocamlcp,ocamlmktop,ocamldoc,ocamldep,ocamlbrowser

    If you want to call other executables than "ocamlc", "ocamlopt","ocamlcp", "ocamlmktop", "ocamldoc", "ocamldep", and"ocamlbrowser", you canset the names ofthe executables here. The command ocamlfindlooksinto these four variables to determine the names of the compilers tocall.

    Example:

    ocamlc     = "ocamlc.opt"

    ocamlopt   = "ocamlopt.opt"

    ocamlcp    = "ocamlcp.opt"

    ocamlmktop = "ocamlmktop.opt"

    This variable is optional. It is not used by default.

    stdlib

    This variable determines the location of the standard library. This mustbe the same directory for which the O'Caml compilers are configured.

    This variable is optional. It is not recommend to set this variableunless you know what you are doing!

    ldconf

    This variable determines the location of the ld.conf file. This mustbe the same file the O'Caml compilers read in; it is updated by ocamlfind when installing and removing packages. You can set thisvariable to the special value "ignore" to disablethe automatic modification of the ld.conf file.

    If not set, the ld.conf file is assumed to reside in the O'Camlstandard library directory.

    This variable is optional. It is not recommended to set this variableunless you know what you are doing!

Toolchains: It is possible to have variants of the original configuration.These variants are called "toolchains" because they are intended toselect different compilers, e.g. patched compilers. In order toset a variable for a certain toolchain, use the syntax

variable
(
toolchain
) = "
value
"
For example:

ocamlc(mypatch) = "ocamlc-mypatch"
When the toolchain "mypatch" is selected, this compiler will be used insteadof the standard one.

In order to switch to a certain toolchain, use the -toolchainoption of ocamlfind.

Environment
A number of environment variables modifies the behaviour offindlib/ocamlfind:

    OCAMLFIND_CONF

    This variable overrides the location of the configuration filefindlib.conf. It must contain the absolute path name of this file.

    OCAMLPATH

    This variable may contain an additional search path for packagedirectories. It is treated as if the directories were prepended tothe configuration variable path.

    OCAMLFIND_DESTDIR

    This variable overrides the configuration variabledestdir.

    OCAMLFIND_METADIR

    This variable overrides the configuration variablemetadir.

    OCAMLFIND_COMMANDS

    This variable overrides the configuration variablesocamlc, ocamlopt,ocamlcp, ocamlmktop,ocamldoc, ocamldep, and/orocamlbrowser. Its value must conform to the syntax

    ocamlc=
    name
     ocamlopt=
    name
     ocamlcp=
    name
     ocamlmktop=
    name
     ocamldoc=
    name
     ocamldep=
    name
     ocamlbrowser=
    name

    Example:

    ocamlc=ocamlc-3.00 ocamlopt=ocamlopt-3.00 ocamlcp=ocamlcp-3.00 ocamlmktop=ocamlmktop-3.00

    CAMLLIBor OCAMLLIB

    This variable overrides the configuration variablestdlib.

    OCAMLFIND_LDCONF

    This variable overrides the configuration variableldconf.