2 .\" Adapted from the source manpage for the OpenIndiana Project
4 .TH OCAMLFIND 1 "May 26, 2020"
7 ocamlfind \- The findlib package manager for OCaml
13 \-help | other options
20 \-help | other options
27 \-help | other options
34 \-help | other options
48 \-help | other options
55 \-help | other options
62 \-help | other options
67 ocamlfind ocamlbrowser
69 \-help | other options
74 \-help | other options
81 \-help | other options
96 \-help | other options
107 .I package/command arg
110 Optional toolchain selection by:
112 ocamlfind \-toolchain
116 .SH THE SUBCOMMAND \[lq]query\[rq]
123 \fBocamlfind\fR query [ \fB\-predicates\fR \fIp\fR |
125 \fB\-long\-format\fR | \fB\-l\fR |
131 \fB\-prefix\fR \fIp\fR |
132 \fB\-separator\fR \fIs\fR |
133 \fB\-suffix\fR \fIs\fR |
135 \fB\-descendants\fR | \fB\-d\fR |
136 \fB\-recursive\fR | \fB\-r\fR |
138 \fB\-qo\fR ] \fIpackage\fR \&...
145 This command looks packages up, sorts them optionally, and prints
147 If the option \-recursive (short: \-r) is not specified, exactly the
148 packages given on the command line are looked up; if \-recursive is
149 present, the packages and all their ancestors, or if \-descendants
150 (short: \-d) is present, too, all their descendants are printed.
152 Package lookup and the selection of the attributes of the packages can
153 be modified by specifying predicates; without a \-predicates option the
154 empty set of predicates is used.
155 Note that even the lookup is influenced by the set of actual predicates
156 as the \[lq]requires\[rq] variables may be conditional.
158 What is printed about a package depends on the specified format; there
159 are a number of options that modify the format.
160 Some formats denote sets of values (such as \-format %a), in which case
161 multiple output records are printed for every package.
162 (It is even possible to specify formats denoting the Cartesian product
163 of sets, such as \-format %a%o, but this does not make sense.) Before
164 the first output record the prefix is printed, and the suffix after the
166 Between two records the separator is printed.
175 \fB\-predicates\fR \fIp\fR
179 Sets the set of actual predicates.
180 The argument \fIp\fR is a list of predicate names separated by commas and/or
182 If multiple \-predicates options are given, the union of all specified
183 sets is effectively used.
190 \fB\-format\fR \fIf\fR
194 Sets the format to the string f.
195 Characters preceded by a percent sign are interpreted as placeholders;
196 all other characters mean themselves.
197 The defined placeholders are listed below.
198 The default format is \[lq]%d\[rq].
211 Sets the format such that all relevant variables are printed.
222 Same as \-format \[lq]\-I %d\[rq], i.e.\ directory options for ocamlc
234 Same as \-format \[lq]\-ccopt \-L%d\[rq], i.e.\ directory options for
235 the linker backend are printed.
246 Same as \-format \[lq]%+a\[rq], i.e.\ archive file names are printed.
257 Same as \-format \[lq]%o\[rq], i.e.\ linker options are printed.
268 Same as \-format \[lq]%p\[rq], i.e.\ package names are printed.
280 Sets the prefix that is printed before the first output record to the
282 The default prefix is the empty string.
294 Sets the suffix that is printed after the last output record to the
296 The default suffix is the empty string.
308 Sets the separator that is printed between output records to the given
310 The default separator is a linefeed character.
323 Not only the packages given on the command line are queried but also all
324 ancestors or descendants.
325 If the option \fB\-descendants\fR is specified, too, the descendants are
326 printed, otherwise the ancestors.
327 The packages are topologically sorted.
340 Instead of the ancestors the descendants of the given packages are
342 This option implies \fB\-recursive\fR.
354 Query preprocessor packages (camlp4 syntax extensions).
355 Normally it is not needed to set \-predicates, except you need the
356 archives (then add \-predicates byte).
357 This option implies \-recursive.
368 Do not print most errors to stderr, just set the exit code
379 Do not print the regular output.
382 .B Placeholders meaningful in the \-format option
392 Replaced by a single percent sign
403 Replaced by the package name
414 Replaced by the package directory
425 Replaced by the path to the META file (new since findlib\-1.6)
436 Replaced by the package description
447 Replaced by the version string
458 Replaced by the archive filename.
459 If there is more than one archive, a separate output record is printed
471 Like %a, but the filenames are converted to absolute paths (\[lq]+\[rq]
472 and \[lq]\@\[rq] notations are resolved)
483 Replaced by the list of archive filenames.
494 Like %A, but the filenames are converted to absolute paths (\[lq]+\[rq]
495 and \[lq]\@\[rq] notations are resolved)
506 Replaced by one linker option.
507 If there is more than one option, a separate output record is printed
519 Replaced by the list of linker options.
530 Replaced by the value of the property named in parentheses, or the empty
531 string if not defined.
535 .SH THE SUBCOMMANDS \[lq]ocamlc\[rq], \[lq]ocamlcp\[rq],\[lq]ocamlopt\[rq], and \[lq]ocamlmktop\[rq]
542 \fBocamlfind\fR ( ocamlc | ocamlcp | ocamlopt | ocamlmktop )
543 [ \fB\-package\fR \fIpackage\-name\-list\fR |
545 \fB\-predicates\fR \fIpred\-name\-list\fR |
546 \fB\-dontlink\fR \fIpackage\-name\-list\fR |
547 \fB\-syntax\fR \fIpred\-name\-list\fR |
548 \fB\-ppopt\fR \fIcamlp4\-arg\fR |
549 \fB\-ppxopt\fR \fIpackage,arg\fR |
550 \fB\-dllpath\-pkg\fR \fIpackage\-name\-list\fR |
551 \fB\-dllpath\-all\fR |
552 \fB\-passopt\fR \fIarg\fR |
553 \fB\-passrest\fR \fIarg\fR \&... |
555 \fBstandard\-option\fR ] \fIfile\fR \&...
562 These subcommands are drivers for the compilers with the same names,
564 \[lq]ocamlfind ocamlc\[rq] is a driver for \[lq]ocamlc\[rq], and so on.
565 The subcommands understand all documented options of the compilers (here
566 called standard\-options), but also a few more options.
567 If these subcommands are invoked only with standard options, they behave
568 as if the underlying compiler had been called directly.
569 The extra options modify this.
571 Internally, these subcommands transform the given list of options and
572 file arguments into an invocation of the driven compiler.
573 This transformation only adds options and files, and the relative order
574 of the options and files passed directly is unchanged.
576 If there are \-package options, additional directory search specifiers
577 will be included (\[lq]\-I\[rq], and \[lq]\-ccopt \-I\[rq]), such that
578 files of all named packages and all ancestors can be found.
580 The \-linkpkg option causes that the packages listed in the \-package
581 options and all necessary ancestors are linked in.
582 This means that the archive files implementing the packages are inserted
583 into the list of file arguments.
585 As the package database is queried a set of predicates is needed.
586 Most predicates are set automatically, see below, but additional
587 predicates can be given by a \-predicates option.
589 If there is a \-syntax option, the drivers assume that a preprocessor is
591 In this case, the preprocessor command is built first in a preprocessor
592 stage, and this command is passed to the compiler using the \-pp option.
593 The set of predicates in the preprocessor stage is different from the
594 set in the compiler/linker stage.
597 .B Options for compiling and linking
600 Here, only the additional options not interpreted by the compiler but by
601 the driver itself, and options with additional effects are explained.
602 Some options are only meaningful for the preprocessor call, and are
609 .I package\-name\-list
613 Adds the listed package names to the set of included packages.
614 The package names may be separated by commas and/or whitespace.
615 In the transformed command, for every package of the set of included
616 packages and for any ancestor a directory search option is inserted
617 after the already given options.
618 This means that \[lq]\-I\[rq] and \[lq]\-ccopt \-I\[rq] options are
619 added for every package directory.
630 Causes that in the transformed command all archives of the packages
631 specified by \-packages and all their ancestors are added to the file
633 More precisely, these archives are inserted before the first given file
635 Furthermore, \[lq]\-ccopt \-L\[rq] options for all package directories,
636 and the linker options of the selected packages are added, too.
637 Note that the archives are inserted in topological order while the
638 linker options are added in reverse toplogical order.
650 Adds the given predicates to the set of actual predicates.
651 The predicates must be separated by commas and/or whitespace.
659 .I package\-name\-list
663 This option modifies the behaviour of \-linkpkg.
664 Packages specified here and all ancestors are not linked in.
665 Again the packages are separated by commas and/or whitespace.
673 .I package\-name\-list
677 For these packages \-dllpath options are added to the compiler command.
678 This may be useful when the ld.conf file is not properly configured.
689 For all linked packages \-dllpath options are added to the compiler
691 This may be useful when the ld.conf file is not properly configured.
703 The argument arg is passed directly to the underlying compiler.
704 This is needed to specify undocumented compiler options.
717 All following arguments arg\&... are passed directly to the underlying
719 This is needed to specify undocumented compiler options.
730 Only prints the constructed command (ocamlc/ocamlopt) to stdout, but
731 does not execute the command.
732 (This is for the unlikely event that you need a wrapper around
744 This standard option is interpreted by the driver, too.
752 .I package\-name\-list
756 This standard option causes that the predicate \[lq]mt\[rq] is added to
757 the set of actual predicates.
758 If POSIX threads are available, the predicate \[lq]mt_posix\[rq] is
760 If only VM threads are available, the predicate \[lq]mt_vm\[rq] is
761 included into the set, and the compiler switch is changed into \-vmthread.
762 Note that the presence of the \[lq]mt\[rq] predicate triggers special
763 fixup of the dependency graph (see below).
774 This standard option causes that the predicates \[lq]mt\[rq] and
775 \[lq]mt_vm\[rq] are added to the set of actual predicates.
776 Note that the presence of the \[lq]mt\[rq] predicate triggers special
777 fixup of the dependency graph (see below).
788 This standard option of \[lq]ocamlopt\[rq] causes that the predicate
789 \[lq]gprof\[rq] is added to the set of actual predicates.
793 .B Options for preprocessing
796 The options relevant for the preprocessor are the following:
802 .I package\-name\-list
806 These packages are considered while looking up the preprocessor
808 (It does not cause problems that the same \-package option is used for
809 this purpose, because the set of predicates is different.) It is
810 recommended to mention at least camlp4 here if the preprocessor is going
823 These predicates are assumed to be true in addition to the standard
824 preprocessor predicates.
825 See below for a list.
837 This argument is passed to the camlp4 call.
849 Add arg to the ppx preprocessor invocation specified via the
850 \[lq]ppx\[rq] property in the META file of package.
854 .B Predicates for compiling and linking
864 The \[lq]byte\[rq] predicate means that one of the bytecode compilers is
866 It is automatically included into the predicate set if the
867 \[lq]ocamlc\[rq], \[lq]ocamlcp\[rq], or \[lq]ocamlmktop\[rq] compiler is
879 The \[lq]native\[rq] predicate means that the native compiler is used.
880 It is automatically included into the predicate set if the
881 \[lq]ocamlopt\[rq] compiler is used.
892 The \[lq]toploop\[rq] predicate means that the toploop is available in
894 This predicate is only set when the toploop is actually being executed,
895 not when the toploop is created (this changed in version 1.0.4 of
907 This predicate means that a toploop is being created (using ocamlmktop).
909 The \[lq]mt\[rq] predicate means that the program is multi\-threaded.
910 It is automatically included into the predicate set if the \-thread
922 The \[lq]mt_posix\[rq] predicate means that in the case \[lq]mt\[rq] is
923 set, too, the POSIX libraries are used to implement threads.
924 \[lq]mt_posix\[rq] is automatically included into the predicate set if
925 the variable \[lq]type_of_threads\[rq] in the META description of the
926 \[lq]threads\[rq] package has the value \[lq]posix\[rq].
927 This is normally the case if \[lq]findlib\[rq] is configured for POSIX
939 The \[lq]mt_vm\[rq] predicate means that in the case \[lq]mt\[rq] is
940 set, too, the VM thread emulation is used to implement multi\-threading.
942 The \[lq]gprof\[rq] predicate means that in the case \[lq]native\[rq] is
943 set, too, the program is compiled for profiling.
944 It is automatically included into the predicate set if
945 \[lq]ocamlopt\[rq] is used and the \-p option is in effect.
956 The \[lq]autolink\[rq] predicate means that ocamlc is able to perform
958 It is automatically included into the predicate set if ocamlc knows
959 automatic linking (from version 3.00), but it is not set if the
960 \-noautolink option is set.
971 This predicate is set if there is a \-syntax option.
972 It is set both for the preprocessor and the compiler/linker stage, and
973 it can be used to find out whether the preprocessor is enabled or not.
977 .B Predicates for preprocessing
987 This predicate is always set while looking up the preprocessor
989 It can be used to distinguish between the preprocessor stage and the
990 compiler/linker stage.
1001 This predicate is set if there is a \-syntax option.
1002 It is set both for the preprocessor and the compiler/linker stage, and
1003 it can be used to find out whether the preprocessor is enabled or not.
1014 This is the reserved predicate for the standard OCaml syntax.
1015 It can be used in the \-syntax predicate list.
1026 This is the reserved predicate for the revised OCaml syntax.
1027 It can be used in the \-syntax predicate list.
1031 .B Special behaviour of \[lq]ocamlmktop\[rq]
1034 As there is a special module Topfind that supports loading of packages
1035 in scripts, the \[lq]ocamlmktop\[rq] subcommand can add initialization
1036 code for this module.
1037 This extra code is linked into the executable if \[lq]findlib\[rq] is in
1038 the set of effectively linked packages.
1041 .B Fixup of the dependency graph for multi\-threading
1044 For a number of reasons the presence of the \[lq]mt\[rq] predicate
1045 triggers that (1) the package \[lq]threads\[rq] is added to the list of
1046 required packages and (2) the package \[lq]threads\[rq] becomes
1047 prerequisite of all other packages (except of itself and a few hardcoded
1049 The effect is that the options \-thread and \-vmthread automatically
1050 select the \[lq]threads\[rq] package, and that \[lq]threads\[rq] is
1051 inserted at the right position in the package list.
1054 .B Extended file naming
1057 At a number of places one can not only refer to files by absolute or
1058 relative path names, but also by extended names.
1059 These have two major forms: \[lq]+name\[rq] refers to the subdirectory
1060 name of the standard library directory, and \[lq]\@name\[rq] refers to
1061 the package directory of the package name.
1062 Both forms can be continued by a path, e.g.
1063 \[lq]\@netstring/netstring_top.cma\[rq].
1065 You can use extended names: (1) With \-I options, (2) as normal file
1066 arguments of the compiler, (3) in the \[lq]archive\[rq] property of
1070 .B How to set the names of the compiler executables
1073 Normally, the OCaml bytecode compiler can be called under the name
1075 However, this is not always true; sometimes a different name is chosen.
1077 You can instruct ocamlfind to call executables with other names than
1078 ocamlc, ocamlopt, ocamlmktop, and ocamlcp.
1079 If present, the environment variable OCAMLFIND_COMMANDS is interpreted
1080 as a mapping from the standard names to the actual names of the
1082 It must have the following format:
1085 \fIstandardname1\fR=\fIactualname1\fR \fIstandardname2\fR=\fIactualname2\fR \&...
1088 Example: You may set OCAMLFIND_COMMANDS as follows:
1091 .B OCAMLFIND_COMMANDS=`ocamlc=ocamlc\-3.00 ocamlopt=ocamlopt\-3.00'
1092 .B export OCAMLFIND_COMMANDS
1095 Alternatively, you can change the configuration file findlib.conf.
1098 .SH THE SUBCOMMAND \[lq]ocamlmklib\[rq]
1104 \fBocamlfind\fR ocamlmklib [ \fB\-package\fR \fIpackage\-name\-list\fR |
1105 \fB\-predicates\fR \fIpred\-name\-list\fR |
1106 \fB\-dllpath\-pkg\fR \fIpackage\-name\-list\fR |
1107 \fB\-dllpath\-all\fR |
1108 \fB\-passopt\fR \fIarg\fR |
1109 \fB\-passrest\fR \fIarg\&...\fR |
1110 \fBstandard\-option\fR ] \fIfile\fR \&...
1117 This is a wrapper around ocamlmklib, and creates library archives and
1119 In addition to the standard options, one can use \-package to add the
1120 search path of packages.
1121 Note that no predicates are set by default \- the wrapper does not know
1122 whether this is about byte or native code linking.
1124 This wrapper is mostly provided for completeness.
1127 .SH THE SUBCOMMAND \[lq]ocamldep\[rq]
1133 \fBocamlfind\fR ocamldep [ \fB\-package\fR \fIpackage\-name\-list\fR |
1134 \fB\-syntax\fR \fIpred\-name\-list\fR |
1135 \fB\-ppopt\fR \fIcamlp4\-arg\fR |
1136 \fB\-passopt\fR \fIarg\fR |
1137 \fB\-passrest\fR \fIarg\fR \&... |
1139 \fBstandard\-option\fR ] \fIfile\fR \&...
1146 This command is a driver for the tool ocamldep of the OCaml
1148 This driver is only useful in conjunction with the preprocessor camlp4;
1149 otherwise it does not provide more functions than ocamldep itself.
1155 Here, only the additional options not interpreted by ocamldep but by the
1156 driver itself, and options with additional effects are explained.
1162 .B \-package package\-name\-list
1166 The packages named here are only used to look up the preprocessor
1168 The package camlp4 should be specified anyway, but further packages that
1169 add capabilities to the preprocessor can also be passed.
1176 .B \-syntax pred\-name\-list
1180 The predicates that are in effect during the look\-up of the
1181 preprocessor options.
1182 At least, either camlp4o (selecting the normal syntax), or camlp4r
1183 (selecting the revised syntax) should be specified.
1190 \fB\-ppopt\fR \fIcamlp4\-arg\fR
1194 An option that is passed through to the camlp4 call.
1201 \fB\-passopt\fR \fIarg\fR
1205 An option that is passed through to the ocamldep call.
1212 \fB\-passrest\fR \fIarg\fR \&...
1216 All further arguments are passed down to ocamldep unprocessed
1227 Displays the resulting ocamldep command (for debugging)
1234 A typical way of using this driver:
1237 \fBocamlfind\fR ocamldep \fB\-package\fR \fIcamlp4,xstrp4\fR \fB\-syntax\fR \fIcamlp4r\fR file1.ml file2.ml
1240 This command outputs the dependencies of file1.ml and file2.ml, although
1241 these modules make use of the syntax extensions provided by xstrp4 and
1242 are written in revised syntax.
1245 .SH THE SUBCOMMAND \[lq]ocamlbrowser\[rq]
1251 \fBocamlfind\fR ocamlbrowser [ \fB\-package package\-name\-list\fR |
1253 \fB\-passopt\fR \fIarg\fR \fB\-passrest\fR \fIargs\fR \&... ]
1260 This driver calls the ocamlbrowser with package options.
1261 With \-package, the specified packages are included into the search path
1262 of the browser, and the modules of these packages become visible (in
1263 addition to the standard library).
1264 The option \-all causes that all packages are selected that are managed
1267 As for other drivers, the options \-passopt and \-passrest can be used
1268 to pass arguments directly to the ocamlbrowser program.
1271 .SH THE SUBCOMMAND \[lq]ocamldoc\[rq]
1277 \fBocamlfind\fR ocamldoc [ \fB\-package\fR \fIpackage\-name\-list\fR |
1278 \fB\-predicates\fR \fIpred\-name\-list\fR |
1279 \fB\-syntax\fR \fIpred\-name\-list\fR |
1280 \fB\-ppopt\fR \fIcamlp4\-arg\fR |
1281 \fBstandard\-option\fR ] \fIfile \&...\fR
1288 This subcommand is a driver for ocamldoc.
1289 It understands all options ocamldoc supports plus the mentioned findlib
1291 Basically, the \-package options are translated into \-I options, and
1292 the selected syntax options are translated into camlp4 options.
1298 Here, only the additional options not interpreted by ocamldep but by the
1299 driver itself, and options with additional effects are explained.
1304 \fB\-package\fR \fIpackage\-name\-list\fR
1308 Adds the listed package names to the set of included packages.
1309 The package names may be separated by commas and/or whitespace.
1310 In the transformed command, for every package of the set of included
1311 packages and for any ancestor a directory search option is inserted
1312 after the already given options.
1313 This means that \[lq]\-I\[rq] options are added for every package
1321 \fB\-predicates\fR \fIpred\-name\-list\fR
1325 Adds the given predicates to the set of actual predicates.
1326 The predicates must be separated by commas and/or whitespace.
1333 \fB\-syntax\fR \fIpred\-name\-list\fR
1337 The predicates that are in effect during the look\-up of the
1338 preprocessor options.
1339 At least, either camlp4o (selecting the normal syntax), or camlp4r
1340 (selecting the revised syntax) should be specified.
1347 \fB\-ppopt\fR \fIcamlp4\-arg\fR
1351 An option that is passed through to the camlp4 call.
1355 .SH THE SUBCOMMAND \[lq]install\[rq]
1361 \fBocamlfind\fR install [ \fB\-destdir\fR \fIdirectory\fR ]
1362 [ \fB\-metadir\fR \fIdirectory\fR ]
1363 [ \fB\-ldconf\fR \fIpath\fR ]
1364 [ \fB\-dont\-add\-directory\-directive\fR ]
1365 [ \fB\-patch\-version\fR \fIstring\fR ]
1366 [ \fB\-patch\-rmpkg\fR \fIname\fR ]
1367 [ \fB\-patch\-archives\fR ]
1370 [ \fB\-optional\fR ]
1371 [ \fB\-add\fR ] \fIpackage_name\R \fIfile\fR \&...
1378 This subcommand installs a new package either at the default location
1379 (see the variable destdir of findlib.conf), or in the directory
1380 specified by the \-destdir option.
1381 This means that a new package directory is created and that the files on
1382 the command line are copied to this directory.
1383 It is required that a META file is one of the files copied to the target
1386 Note that package directories should be flat (no subdirectories).
1387 Existing packages are never overwritten.
1389 It is possible to have a separate directory for all the META files.
1390 If you want that, you have either to set the variable metadir of
1391 findlib.conf, or to specify the \-metadir option.
1392 In this case, the file called META is copied to the specified directory
1393 and renamed to META.p (where p is the package name), while all the other
1394 files are copied to the package directory as usual.
1395 Furthermore, the META file is modified such that the directory variable
1396 contains the path of the package directory.
1398 The option \-dont\-add\-directory\-directive prevents the installer from
1399 adding a directory variable.
1401 If there are files ending in the suffixes .so or .dll, the package
1402 directory will be added to the DLL configuration file ld.conf, such that
1403 the dynamic loader can find the DLL.
1404 The location of this file can be overriden by the \-ldconf option.
1405 To turn this feature off, use \[lq]\-ldconf ignore\[rq]; this causes
1406 that the ld.conf file is not modified.
1408 However, if there is a stublibs directory in site\-lib, the DLLs are not
1409 installed in the package directory, but in this directory that is shared
1410 by all packages that are installed at the same location.
1411 In this case, the configuration file ld.conf is not modified, so you do
1412 not need to say \[lq]\-ldconf ignore\[rq] if you prefer this style of
1415 The options \-dll and \-nodll can be used to control exactly which files
1416 are considered as DLLs and which not.
1417 By default, the mentioned suffix rule is in effect: files ending in
1418 \[lq].so\[rq] (Unix) or \[lq].dll\[rq] (Windows) are DLLs.
1419 The switch \-dll changes this, and all following files are considered as
1420 DLLs, regardless of their suffix.
1421 The switch \-nodll expresses that the following files are not DLLs, even
1422 if they have a DLL\-like suffix.
1423 For example, in the following call the files \fIf1\fR and \fIf2\fR are handled by
1424 the suffix rule; \fIf3\fR and \fIf4\fR are DLLs anyway; and \fIf5\fR and \fIf6\fR are not DLLs:
1427 \fBocamlfind\fR install \fIp\fR \fIf1\fR \fIf2\fR \fB\-dll\fR \fIf3\fR \fIf4\fR \fB\-nodll\fR \fIf5\fR \fIf6\fR
1430 The switch \-optional declares that all following files are optional,
1431 i.e.\ the command will not fail if files do not exist.
1433 The \-patch options may be used to change the contents of the META files
1434 while it is being installed.
1435 The option \-patch\-version changes the contents of the top\-level
1436 \[lq]version\[rq] variable.
1437 The option \-patch\-rmpkg removes the given subpackage.
1438 The option \-patch\-archives is experimental, in particular it removes
1439 all non\-existing files from \[lq]archive\[rq] variables, and even whole
1440 subpackages if the archives are missing.
1442 The effect of \-add is to add further files to an already installed
1446 .SH THE SUBCOMMAND \[lq]remove\[rq]
1452 \fBocamlfind\fR remove [ \fB\-destdir\fR \fIdirectory\fR ] [ \fB\-metadir\fR \fIdirectory\fR ]
1453 [ \fB\-ldconf\fR \fIpath\fR ] \fIpackage_name\fR
1460 The package will removed if it is installed at the default location (see
1461 the variable destdir of findlib.conf).
1462 If the package resides at a different location, it will not be removed
1463 by default; however, you can pass an alternate directory for packages by
1464 the \-destdir option.
1465 (This must be the same directory as specified at installation time.)
1467 Note that package directories should be flat (no subdirectories); this
1468 subcommand cannot remove deep package directories.
1470 If you have a separate directory for META files, you must either
1471 configure this directory by the metadir variable of findlib.conf, or by
1472 specifying the \-metadir option.
1474 The command does not fail if the package and/or the META file cannot be
1476 You will get a warning only in this case.
1478 If the package directory is mentioned in the ld.conf configuration file
1479 for DLLs, it will be tried to remove this entry from the file.
1480 The location of this file can be overriden by the \-ldconf option.
1481 To turn this feature off, use \[lq]\-ldconf ignore\[rq]; this causes
1482 that the ld.conf file is not modified.
1484 If there is a stublibs directory, it is checked whether the package owns
1485 any of the files in this directory, and the owned files will be deleted.
1488 .SH THE SUBCOMMAND \[lq]list\[rq]
1494 \fBocamlfind\fR list [ \fB\-describe\fR ]
1501 This command lists all packages in the search path.
1502 The option \-describe outputs the package descriptions, too.
1505 .SH THE SUBCOMMAND \[lq]printppx\[rq]
1511 \fBocamlfind\fR printppx [ \fB\-predicates\fR \fIpred\-name\-list\fR ]
1512 [ \fB\-ppxopt\fR \fIpackage,arg\fR ] \fIpackage\fR \&...
1519 This command prints the ppx preprocessor options as they would occur in
1520 an OCaml compiler invocation for the packages listed in the command.
1521 The output includes one \[lq]\-ppx\[rq] option for each preprocessor.
1522 The possible options have the same meaning as for \[lq]ocamlfind
1524 The option \[lq]\-predicates\[rq] adds assumed predicates and
1525 \[lq]\-ppxopt package,arg\[rq] adds \[lq]arg\[rq] to the ppx invocation
1528 The output of \[lq]ocamlfind printppx\[rq] will contain quotes
1529 \[lq]\[rq]" for ppx commands that contain space\-separated arguments.
1530 In this case $(ocamlfind printppx \&...) won't work as naively expected,
1531 because many shells (including bash and dash) perform field splitting on
1532 the result of command substitutions without honoring quotes.
1535 .SH THE SUBCOMMAND \[lq]lint\[rq]
1541 \fBocamlfind\fR lint \fIfile\fR
1548 Checks the META file, and reports possible problems.
1551 .SH THE SUBCOMMAND \[lq]printconf\[rq]
1557 \fBocamlfind\fR printconf [ \fBconf\fR | \fBpath\fR | \fBdestdir\fR | \fBmetadir\fR | \fBmetapath\fR |
1558 \fBstdlib\fR | \fBldconf\fR ]
1565 This command prints the effective configuration after reading the
1566 configuration file, and after applying the various environment variables
1567 overriding settings.
1568 When called without arguments, the command prints all configuration
1569 options in a human\-readable form.
1570 When called with an argument, only the value of the requested option is
1571 printed without explaining texts:
1580 Prints the location of the configuration file findlib.conf
1591 Prints the search path for packages.
1592 The members of the path are separated by linefeeds.
1603 Prints the location where package are installed and removed by default.
1614 Prints the location where META files are installed and removed (if the
1615 alternative layout is used).
1626 Prints the path where the META file is installed for a fictive package.
1627 The name of the package is marked with `%s' in the path.
1628 For instance, this command could output \[lq]/some/path/%s/META\[rq] or
1629 \[lq]/some/path/META.%s\[rq], depending on the layout.
1640 Prints the location of the standard library.
1651 Prints the location of the ld.conf file
1655 .SH THE SUBCOMMAND CALLING PACKAGE PROGRAMS
1661 \fBocamlfind\fR pkg/cmd \fIargument\fR \&...
1668 This subcommand is useful to call programs that are installed in package
1670 It looks up the directory for pkg and calls the command named cmd in
1672 The remaining arguments are passed to this command.
1674 argv(0) contains the absolute path to the command, and argv(1) and the
1675 following argv entries contain the arguments.
1676 The working directory is not changed.
1678 Example: To call the program \[lq]x\[rq] that is installed in package
1679 \[lq]p\[rq], with arguments \[lq]y\[rq] and \[lq]z\[rq], run:
1682 \fBocamlfind\fR \fIp/x\fR \fIy\fR \fIz\fR
1686 .SH CONFIGURATION FILE, ENVIRONMENT VARIABLES
1688 The configuration file and environment variables are documented in the
1689 manual page for findlib.conf.
1691 .SH HOW TO SET THE TOOLCHAIN
1697 \fBocamlfind \-toolchain\fR \fIname\fR \&...
1704 The \-toolchain option can be given before any other command, e.g.
1705 ocamlfind \-toolchain foo ocamlc \-c file.ml
1706 compiles file.ml with toolchain \[lq]foo\[rq].
1707 By selecting toolchains one can switch to different command sets.
1708 For instance, the toolchain \[lq]foo\[rq] may consist of a patched
1711 See findlib.conf how to configure toolchains.