The findlib User's Guide
Prev | Chapter 2. Using packages | Next

# Querying information stored in META files

By setting some options of ocamlfind you can query the variables from the META files. For example, -long-format (or short -l) selects all interesting variables:

    ocamlfind query -long-format p

This would answer something like:

    package:     p
    description: Our super-duper package
    version:     1
    archive(s):
    linkopts:
    location:    /usr/local/lib/ocaml/site-lib/p

The values of the "archive" variable are missing because no predicate has been set, without further options "ocamlfind query" operates with an empty set of predicates. To get the bytecode archive, run:

    ocamlfind query -long-format -predicates byte p

You can set more than one predicate. It usually does not make sense, but you could for example select both bytecode and native archives by:

    ocamlfind query -long-format -predicates byte,native p

As both settings for "archive" are now equally like, the extraction mechanism chooses simply the first. The general rule is that the first most special value is selected.

Prev | Home | Next
How a package directory looks like | Up | How to compile and link a program that uses a package