1ocamlfind(1)                General Commands Manual               ocamlfind(1)
2
3
4

NAME

6       ocamlfind - [Command-line interface of the Package manager]
7

SYNOPSIS

9              ocamlfind query [-help | other options] package_name ...
10          or: ocamlfind ocamlc [-help | other options] file ...
11          or: ocamlfind ocamlcp [-help | other options] file ...
12          or: ocamlfind ocamlmktop [-help | other options] file ...
13          or: ocamlfind ocamlopt [-help | other options] file ...
14          or: ocamlfind ocamldoc [-help | other options] file ...
15          or: ocamlfind ocamldep [-help | other options] file ...
16          or: ocamlfind ocamlmklib [-help | other options] file ...
17          or: ocamlfind ocamlbrowser [-help | other options]
18          or: ocamlfind install [-help | other options] package_name file ...
19          or: ocamlfind remove [-help | other options] package_name
20          or: ocamlfind lint META
21          or: ocamlfind list [-describe]
22          or: ocamlfind printppx [-help | other options] package_name ...
23          or: ocamlfind printconf [ variable ]
24          or: ocamlfind package/command arg ...
25
26       Optional toolchain selection by:
27         ocamlfind -toolchain name ...
28

THE 'query' SUBCOMMAND

30   Synopsis
31       ocamlfind query [ -predicates p  |
32                         -format f |
33                         -long-format | -l |
34                         -i-format |
35                         -l-format |
36                         -a-format |
37                         -o-format |
38                         -p-format |
39                         -prefix p |
40                         -separator s |
41                         -suffix s |
42                         -pp |
43                         -descendants | -d |
44                         -recursive  | -r
45                         -qe | -qo] package ...
46
47   Description
48       This  command  looks  packages  up,  sorts  them optionally, and prints
49       attributes of them. If the option -recursive (short: -r) is not  speci‐
50       fied,  exactly the packages given on the command line are looked up; if
51       -recursive is present, the packages and  all  their  ancestors,  or  if
52       -descendants  (short:  -d)  is  present, too, all their descendants are
53       printed.
54
55       Package lookup and the selection of the attributes of the packages  can
56       be  modified by specifying predicates; without a -predicates option the
57       empty set of predicates is used. Note that even the  lookup  is  influ‐
58       enced  by  the set of actual predicates as the "requires" variables may
59       be conditional.
60
61       What is printed about a package depends on the specified format;  there
62       are  a  number  of  options that modify the format. Some formats denote
63       sets of values (such as -format %a),  in  which  case  multiple  output
64       records  are printed for every package. (It is even possible to specify
65       formats denoting the Cartesian product of sets, such as  -format  %a%o,
66       but  this does not make sense.) Before the first output record the pre‐
67       fix is printed, and the suffix  after  the  last  record.  Between  two
68       records the separator is printed.
69
70   Options
71         -predicates p
72
73              Sets  the set of actual predicates. The argument  p is a list of
74              predicate names separated  by commas and/or whitespace. If  mul‐
75              tiple -predicates options are  given, the union of all specified
76              sets is effectively used.
77
78         -format f
79
80              Sets the format to the string  f. Characters preceded by a  per‐
81              cent sign  are interpreted as placeholders; all other characters
82              mean  themselves. The defined placeholders are  listed  below.
83              The default format is "%d".
84
85         -long-format or -l
86
87              Sets the format such that all relevant variables are printed.
88
89         -i-format
90
91              Same  as  -format "-I %d", i.e. directory options for ocamlc are
92              printed.
93
94         -l-format
95
96              Same as -format "-ccopt -L%d", i.e. directory  options  for  the
97              linker backend are printed.
98
99         -a-format
100
101              Same as -format "%+a", i.e. archive file names are printed.
102
103         -o-format
104
105              Same as -format "%o", i.e. linker options are printed.
106
107         -p-format
108
109              Same as -format "%p", i.e. package names are printed.
110
111         -prefix p
112
113              Sets  the prefix that is printed before the first output record
114              to the given string. The default prefix is the empty string.
115
116         -suffix s
117
118              Sets the suffix that is printed after the last output record  to
119              the given string. The default suffix is the empty string.
120
121         -separator s
122
123              Sets  the  separator  that is printed between output records to
124              the given string. The default separator is a linefeed character.
125
126         -recursive or -r
127
128              Not only the packages given on the command line are queried  but
129              also all ancestors or descendants. If the option -descendants is
130               specified, too, the descendants are  printed,  otherwise  the
131              ancestors. The packages are topologically sorted.
132
133         -descendants -d
134
135              Instead  of the ancestors the descendants of the  given packages
136              are queried. This option implies -recursive.
137
138         -pp
139
140              Query preprocessor packages (camlp4 syntax extensions). Normally
141              it  is  not  needed  to set -predicates, except you need the ar‐
142              chives (then add -predicates byte). This option implies  -recur‐
143              sive.
144
145         -qe
146
147              Do not print most errors to stderr, just set the exit code
148
149         -qo
150
151              Do not print the regular output.
152
153   Placeholders meaningful in the -format option
154         %%
155
156              Replaced by a single percent sign
157
158         %p
159
160              Replaced by the package name
161
162         %d
163
164              Replaced by the package directory
165
166         %m
167
168              Replaced by the path to the META file (new since findlib-1.6)
169
170         %D
171
172              Replaced by the package description
173
174         %v
175
176              Replaced by the version string
177
178         %a
179
180              Replaced by the archive filename. If there is more  than one ar‐
181              chive, a separate output record is printed for every archive.
182
183         %+a
184
185              Like %a, but the filenames are converted to absolute  paths ("+"
186              and "@" notations are resolved)
187
188         %A
189
190              Replaced by the list of archive filenames.
191
192         %+A
193
194              Like %A, but the filenames are converted to absolute  paths ("+"
195              and "@" notations are resolved)
196
197         %o
198
199              Replaced by one linker option.  If  there  is  more  than    one
200              option, a separate output record is printed for every option.
201
202         %O
203
204              Replaced by the list of linker options.
205
206         %(property)
207
208              Replaced  by  the value of the property named in parentheses, or
209              the empty string if not defined.
210

THE SUBCOMMANDS 'ocamlc', 'ocamlcp', 'ocamlopt', and 'ocamlmktop'

212   Synopsis
213       ocamlfind ( ocamlc | ocamlcp | ocamlopt | ocamlmktop )
214                 [ -package package-name-list |
215                   -linkpkg |
216                   -predicates pred-name-list |
217                   -dontlink package-name-list |
218                   -syntax pred-name-list |
219                   -ppopt camlp4-arg |
220                   -ppxopt package,arg |
221                   -dllpath-pkg package-name-list |
222                   -dllpath-all |
223                   -passopt arg |
224                   -passrest arg... |
225                   -only-show |
226                   standard-option ]
227                 file ...
228
229   Description
230       These subcommands are drivers for the compilers with  the  same  names,
231       i.e.  "ocamlfind  ocamlc" is a driver for "ocamlc", and so on. The sub‐
232       commands understand all  documented  options  of  the  compilers  (here
233       called standard-options), but also a few more options. If these subcom‐
234       mands are invoked only with standard options, they  behave  as  if  the
235       underlying  compiler had been called directly. The extra options modify
236       this.
237
238       Internally, these subcommands transform the given list of  options  and
239       file  arguments  into an invocation of the driven compiler. This trans‐
240       formation only adds options and files, and the relative  order  of  the
241       options and files passed directly is unchanged.
242
243       If  there  are -package options, additional directory search specifiers
244       will be included ("-I", and "-ccopt -I"), such that files of all  named
245       packages and all ancestors can be found.
246
247       The  -linkpkg  option  causes  that the packages listed in the -package
248       options and all necessary ancestors are linked in. This means that  the
249       archive  files  implementing the packages are inserted into the list of
250       file arguments.
251
252       As the package database is queried a set of predicates is needed.  Most
253       predicates  are set automatically, see below, but additional predicates
254       can be given by a -predicates option.
255
256       If there is a -syntax option, the drivers assume that a preprocessor is
257       to  be used. In this case, the preprocessor command is built first in a
258       preprocessor stage, and this command is passed to  the  compiler  using
259       the -pp option. The set of predicates in the preprocessor stage is dif‐
260       ferent from the set in the compiler/linker stage.
261
262   Options for compiling and linking
263       Here, only the additional options not interpreted by the  compiler  but
264       by   the  driver  itself,  and  options  with  additional  effects  are
265       explained. Some options are only meaningful for the preprocessor  call,
266       and are explained below.
267
268         -package package-name-list
269
270              Adds  the listed package names to the set of included  packages.
271              The package names may be separated by commas and/or  whitespace.
272              In  the  transformed  command,  for every package of the set  of
273              included packages and for any ancestor a directory search option
274                is  inserted after the already given options. This means that
275              "-I" and "-ccopt -I" options are added for every package  direc‐
276              tory.
277
278         -linkpkg
279
280              Causes  that  in  the  transformed  command all archives  of the
281              packages specified by -packages and all  their  ancestors  are
282              added to the file arguments. More precisely, these archives are
283              inserted before the  first  given  file  argument.  Furthermore,
284              "-ccopt  -L" options for all package directories, and the linker
285              options of  the selected packages are added, too. Note that  the
286              archives  are    inserted  in topological order while the linker
287              options are added in  reverse toplogical order.
288
289         -predicates pred-name-list
290
291              Adds the given predicates to the set of actual  predicates.  The
292              predicates must be separated by commas and/or  whitespace.
293
294         -dontlink package-name-list
295
296              This option modifies the behaviour of  -linkpkg. Packages speci‐
297              fied here and all ancestors are not linked  in. Again the  pack‐
298              ages are separated by commas and/or whitespace.
299
300         -dllpath-pkg package-name-list
301
302              For  these  packages -dllpath options  are added to the compiler
303              command. This may be useful when the ld.conf  file is not  prop‐
304              erly configured.
305
306         -dllpath-all
307
308              For  all linked packages -dllpath options  are added to the com‐
309              piler command. This may be useful when the ld.conf  file is  not
310              properly configured.
311
312         -passopt arg
313
314              The argument arg is  passed directly to the underlying compiler.
315              This is needed to  specify undocumented compiler options.
316
317         -passrest arg...
318
319              All following arguments arg...  are    passed  directly  to  the
320              underlying  compiler.  This  is  needed to  specify undocumented
321              compiler options.
322
323         -only-show
324
325              Only prints the constructed command (ocamlc/ocamlopt) to    std‐
326              out, but does not execute the command. (This is for the unlikely
327              event  that you need a wrapper around ocamlfind.)
328
329         -verbose
330
331              This standard option is interpreted by the driver, too.
332
333         -thread
334
335              This standard option causes that the predicate "mt"  is added to
336              the  set  of actual predicates. If POSIX threads are available,
337              the predicate "mt_posix" is selected, too. If  only  VM  threads
338              are   available, the predicate "mt_vm" is included into the set,
339              and the  compiler switch is changed into -vmthread.
340
341              Note that the presence of the "mt"  predicate  triggers  special
342              fixup of the dependency graph (see below).
343
344         -vmthread
345
346              This  standard  option  causes  that  the  predicates  "mt"  and
347              "mt_vm" are added to the set of actual predicates.
348
349              Note that the presence of the "mt"  predicate  triggers  special
350              fixup of the dependency graph (see below).
351
352         -p
353
354              This  standard  option  of "ocamlopt" causes that the  predicate
355              "gprof" is added to the set of actual predicates.
356
357   Options for preprocessing
358       The options relevant for the preprocessor are the following:
359
360         -package package-name-list
361
362              These packages are considered while looking up the  preprocessor
363              arguments.  (It  does not cause problems that the same  -package
364              option is used for this purpose, because the set of predicates
365              is  different.)  It  is  recommended to mention at least camlp4
366              here if the preprocessor is going to be used.
367
368         -syntax pred-name-list
369
370              These predicates are assumed to be true  in  addition    to  the
371              standard preprocessor predicates. See below for a list.
372
373         -ppopt camlp4-arg
374
375              This argument is passed to the camlp4 call.
376
377         -ppxopt package,arg
378
379              Add  arg  to  the ppx  preprocessor invocation specified via the
380              "ppx" property in  the META file of package.
381
382   Predicates for compiling and linking
383         byte
384
385              The "byte" predicate means that one of the bytecode compilers is
386              used. It is automatically included into the predicate set if the
387              "ocamlc", "ocamlcp", or "ocamlmktop" compiler is used.
388
389         native
390
391              The "native" predicate means that the native compiler  is  used.
392              It  is  automatically  included  into  the  predicate set if the
393              "ocamlopt" compiler is used.
394
395         toploop
396
397              The "toploop" predicate means that the toploop is  available  in
398              the  linked program. This predicate is only set when the toploop
399              is actually being executed, not  when  the  toploop  is  created
400              (this changed in version 1.0.4 of findlib).
401
402         create_toploop
403
404              This  predicate  means  that  a  toploop is being created (using
405              ocamlmktop).
406
407         mt
408
409              The "mt" predicate means that the program is multi-threaded.  It
410              is  automatically included into the predicate set if the -thread
411              option is given.
412
413         mt_posix
414
415              The "mt_posix" predicate means that in the  case  "mt"  is  set,
416              too,   the  POSIX  libraries  are  used  to  implement  threads.
417              "mt_posix" is automatically included into the predicate  set  if
418              the  variable  "type_of_threads"  in the META description of the
419              "threads" package has the value "posix". This  is  normally  the
420              case if "findlib" is configured for POSIX threads.
421
422         mt_vm
423
424              The  "mt_vm"  predicate means that in the case "mt" is set, too,
425              the VM thread emulation is used to implement multi-threading.
426
427         gprof
428
429              The "gprof" predicate means that in the case  "native"  is  set,
430              too,  the program is compiled for profiling. It is automatically
431              included into the predicate set if "ocamlopt" is used and the -p
432              option is in effect.
433
434         autolink
435
436              The  "autolink"  predicate  means that ocamlc is able to perform
437              automatic linking. It is automatically included into the  predi‐
438              cate  set if ocamlc knows automatic linking (from version 3.00),
439              but it is not set if the -noautolink option is set.
440
441         syntax
442
443              This predicate is set if there is a -syntax  option. It  is  set
444              both for the preprocessor and the compiler/linker stage,  and it
445              can be used to find out whether the preprocessor is  enabled  or
446              not.
447
448   Predicates for preprocessing
449         preprocessor
450
451              This  predicate is always set while looking up the  preprocessor
452              arguments. It can be used to distinguish between the  preproces‐
453              sor stage and the compiler/linker stage.
454
455         syntax
456
457              This  predicate  is set if there is a -syntax  option. It is set
458              both for the preprocessor and the compiler/linker stage,  and it
459              can  be  used to find out whether the preprocessor is enabled or
460              not.
461
462         camlp4o
463
464              This is the reserved predicate for the standard O'Caml syntax.
465              It can be used in the -syntax predicate list.
466
467         camlp4r
468
469              This  is  the reserved predicate for the revised O'Caml syntax.
470              It can be used in the -syntax predicate list.
471
472   Special behaviour of 'ocamlmktop'
473       As there is a special module Topfind that supports loading of  packages
474       in scripts, the "ocamlmktop" subcommand can add initialization code for
475       this module. This extra code is linked into the executable if "findlib"
476       is in the set of effectively linked packages.
477
478   Fixup of the dependency graph for multi-threading
479       For  a  number  of  reasons the presence of the "mt" predicate triggers
480       that (1) the package "threads" is added to the list of  required  pack‐
481       ages  and  (2)  the package "threads" becomes prerequisite of all other
482       packages (except of itself and a few hardcoded exceptions). The  effect
483       is  that  the  options  -thread  and -vmthread automatically select the
484       "threads" package, and that "threads" is inserted at the right position
485       in the package list.
486
487   Extended file naming
488       At  a  number  of places one can not only refer to files by absolute or
489       relative path names, but also by extended names. These have  two  major
490       forms:  "+name" refers to the subdirectory name of the standard library
491       directory, and "@name" refers to the package directory of  the  package
492       name.  Both  forms  can  be  continued by a path, e.g. "@netstring/net‐
493       string_top.cma".
494
495       You can use extended names: (1) With -I options,  (2)  as  normal  file
496       arguments of the compiler, (3) in the  "archive" property of packages.
497
498   How to set the names of the compiler executables
499       Normally,  the  O'Caml  bytecode  compiler can be called under the name
500       ocamlc. However, this is not always true; sometimes a different name is
501       chosen.
502
503       You  can  instruct  ocamlfind to call executables with other names than
504       ocamlc, ocamlopt, ocamlmktop, and ocamlcp. If present, the  environment
505       variable  OCAMLFIND_COMMANDS is interpreted as a mapping from the stan‐
506       dard names to the actual names of the executables.  It  must  have  the
507       following format:
508
509       standardname1=actualname1 standardname2=actualname2 ...
510
511       Example: You may set OCAMLFIND_COMMANDS as follows:
512
513       OCAMLFIND_COMMANDS='ocamlc=ocamlc-3.00 ocamlopt=ocamlopt-3.00'
514       export OCAMLFIND_COMMANDS
515
516       Alternatively, you can change the configuration file findlib.conf.
517

THE SUBCOMMAND 'ocamlmklib'

519   Synopsis
520       ocamlfind ocamlmklib
521                 [ -package package-name-list |
522                   -predicates pred-name-list |
523                   -dllpath-pkg package-name-list |
524                   -dllpath-all |
525                   -passopt arg |
526                   -passrest arg... |
527                   standard-option ]
528                   file ...
529
530   Description
531       This  is  a wrapper around ocamlmklib, and creates library archives and
532       DLLs. In addition to the standard options, one can use -package to  add
533       the search path of packages. Note that no predicates are set by default
534       - the wrapper does not know whether this is about byte or  native  code
535       linking.
536
537       This wrapper is mostly provided for completeness.
538

THE 'ocamldep' SUBCOMMAND

540   Synopsis
541       ocamlfind ocamldep [-package package-name-list |
542                           -syntax pred-name-list |
543                           -ppopt camlp4-arg |
544                           -passopt arg |
545                           -passrest arg... |
546                           -verbose |
547                           standard-option] file ...
548
549   Description
550       This  command is a driver for the tool ocamldep of the O'Caml distribu‐
551       tion. This driver is only useful in conjunction with  the  preprocessor
552       camlp4;  otherwise  it  does  not  provide more functions than ocamldep
553       itself.
554
555   Options
556       Here, only the additional options not interpreted by  ocamldep  but  by
557       the driver itself, and options with additional effects are explained.
558
559         -package package-name-list
560
561              The  packages named here are only used to look up the preproces‐
562              sor options. The package camlp4 should be specified anyway,  but
563              further  packages  that add capabilities to the preprocessor can
564              also be passed.
565
566         -syntax pred-name-list
567
568              The predicates that are in effect during the look-up of the pre‐
569              processor  options. At least, either camlp4o (selecting the nor‐
570              mal syntax), or camlp4r (selecting the revised syntax) should be
571              specified.
572
573         -ppopt camlp4-arg
574
575              An option that is passed through to the camlp4 call.
576
577         -passopt arg
578
579              An option that is passed through to the ocamldep call.
580
581         -passrest arg...
582
583              All further arguments are passed down to ocamldep  unprocessed
584
585         -verbose
586
587              Displays the resulting ocamldep command (for debugging)
588
589   Example
590       A typical way of using this driver:
591
592       ocamlfind ocamldep -package camlp4,xstrp4 -syntax camlp4r file1.ml file2.ml
593           This  command  outputs  the  dependencies of file1.ml and file2.ml,
594       although these modules make use of the syntax  extensions  provided  by
595       xstrp4 and are written in revised syntax.
596

THE 'ocamlbrowser' SUBCOMMAND

598   Synopsis
599       ocamlfind ocamlbrowser [-package package-name-list |
600                               -all |
601                               -passopt arg
602                               -passrest ]
603
604   Description
605       This driver calls the ocamlbrowser with package options. With -package,
606       the specified packages  are  included  into  the  search  path  of  the
607       browser,  and the modules of these packages become visible (in addition
608       to the standard library). The option -all causes that all packages  are
609       selected that are managed by findlib.
610
611       As for other drivers, the options -passopt and -passrest can be used to
612       pass arguments directly to the ocamlbrowser program.
613

THE SUBCOMMAND 'ocamldoc'

615   Synopsis
616       ocamlfind ocamldoc
617                 [ -package package-name-list |
618                   -predicates pred-name-list |
619                   -syntax pred-name-list |
620                   -ppopt camlp4-arg |
621                   standard-option ]
622                 file ...
623
624   Description
625       This subcommand is a driver for ocamldoc.  It  undestands  all  options
626       ocamldoc  supports  plus  the mentioned findlib options. Basically, the
627       -package options are translated into -I options, and the selected  syn‐
628       tax options are translated into camlp4 options.
629
630   Options
631       Here,  only  the  additional options not interpreted by ocamldep but by
632       the driver itself, and options with additional effects are explained.
633
634         -package package-name-list
635
636              Adds the listed package names to the set of included   packages.
637              The package names may be separated by commas and/or  whitespace.
638              In the transformed command, for every package of  the  set    of
639              included packages and for any ancestor a directory search option
640               is inserted after the already given options. This means  that
641              "-I" options are added for every package directory.
642
643         -predicates pred-name-list
644
645              Adds  the given predicates to the set of actual  predicates. The
646              predicates must be separated by commas and/or  whitespace.
647
648         -syntax pred-name-list
649
650              The predicates that are in effect during the look-up of the pre‐
651              processor  options. At least, either camlp4o (selecting the nor‐
652              mal syntax), or camlp4r (selecting the revised syntax) should be
653              specified.
654
655         -ppopt camlp4-arg
656
657              An option that is passed through to the camlp4 call.
658

THE 'install' SUBCOMMAND

660   Synopsis
661       ocamlfind install [ -destdir directory ]
662                         [ -metadir directory ]
663                         [ -ldconf path ]
664                         [ -dont-add-directory-directive ]
665                         [ -patch-version string ]
666                         [ -patch-rmpkg name ]
667                         [ -patch-archives ]
668                         [ -dll ] [ -nodll ] [ -optional ] [ -add ]
669                         package_name file ...
670
671   Description
672       This  subcommand  installs a new package either at the default location
673       (see the variable destdir of findlib.conf), or in the directory  speci‐
674       fied by the -destdir option. This means that a new package directory is
675       created and that the files on the  command  line  are  copied  to  this
676       directory.  It  is required that a META file is one of the files copied
677       to the target directory.
678
679       Note that package  directories  should  be  flat  (no  subdirectories).
680       Existing packages are never overwritten.
681
682       It  is possible to have a separate directory for all the META files. If
683       you want that, you have either to set the variable metadir  of    find‐
684       lib.conf,  or  to  specify  the -metadir option. In this case, the file
685       called META is copied to the specified directory and renamed to  META.p
686       (where  p is the package name), while all the other files are copied to
687       the package directory as usual. Furthermore, the META file is  modified
688       such  that  the  directory  variable  contains  the path of the package
689       directory.
690
691       The option -dont-add-directory-directive prevents  the  installer  from
692       adding a directory variable.
693
694       If  there  are  files  ending  in the suffixes .so or .dll, the package
695       directory will be added to the DLL  configuration  file  ld.conf,  such
696       that the dynamic loader can find the DLL. The location of this file can
697       be overriden by the -ldconf option.  To  turn  this  feature  off,  use
698       "-ldconf ignore"; this causes that the ld.conf file is not modified.
699
700       However, if there is a stublibs directory in site-lib, the DLLs are not
701       installed in the package directory,  but  in  this  directory  that  is
702       shared by all packages that are installed at the same location. In this
703       case, the configuration file ld.conf is not modified,  so  you  do  not
704       need to say "-ldconf ignore" if you prefer this style of installation.
705
706       The  options -dll and -nodll can be used to control exactly which files
707       are considered as DLLs and which not. By default, the mentioned  suffix
708       rule is in effect: files ending in ".so" (Unix) or ".dll" (Windows) are
709       DLLs. The switch -dll changes this, and all following files are consid‐
710       ered  as DLLs, regardless of their suffix. The switch  -nodll expresses
711       that the following files are not DLLs, even if  they  have  a  DLL-like
712       suffix. For example, in the following call the files f1 and f2 are han‐
713       dled by the suffix rule; f3 and f4 are DLLs anyway; and f5 and  f6  are
714       not DLLs:
715
716       ocamlfind install p f1 f2 -dll f3 f4 -nodll f5 f6
717
718       The  switch  -optional  declares that all following files are optional,
719       i.e. the command will not fail if files do not exist.
720
721       The -patch options may be used to change the contents of the META files
722       while it is being installed. The option -patch-version changes the con‐
723       tents of the top-level  "version"  variable.  The  option  -patch-rmpkg
724       removes  the given subpackage. The option -patch-archives is experimen‐
725       tal, in particular it removes all  non-existing  files  from  "archive"
726       variables, and even whole subpackages if the archives are missing.
727
728       The  effect  of  -add  is  to add further files to an already installed
729       packages.
730

THE 'remove' SUBCOMMAND

732   Synopsis
733       ocamlfind remove [ -destdir directory ]
734                        [ -metadir directory ]
735                        [ -ldconf path ]
736                        package_name
737
738   Description
739       The package will removed if it is installed at the  default  location
740       (see the variable destdir of findlib.conf). If the package resides at a
741       different location, it will not be removed by default; however, you can
742       pass  an alternate directory for packages by the -destdir option. (This
743       must be the same directory as specified at installation time.)
744
745       Note that package directories should be flat (no subdirectories);  this
746       subcommand cannot remove deep package directories.
747
748       If  you  have a separate directory for META files, you must either con‐
749       figure this directory by the metadir variable of  findlib.conf,  or  by
750       specifying the -metadir option.
751
752       The command does not fail if the package and/or the META file cannot be
753       located. You will get a warning only in this case.
754
755       If the package directory is mentioned in the ld.conf configuration file
756       for  DLLs,  it  will  be  tried to remove this entry from the file. The
757       location of this file can be overriden by the -ldconf option.  To  turn
758       this  feature  off,  use "-ldconf ignore"; this causes that the ld.conf
759       file is not modified.
760
761       If there is a stublibs directory, it is  checked  whether  the  package
762       owns  any  of  the files in this directory, and the owned files will be
763       deleted.
764

THE 'list' SUBCOMMAND

766   Synopsis
767       ocamlfind list [-describe]
768
769   Description
770       This command  lists  all  packages  in  the  search  path.  The  option
771       -describe outputs the package descriptions, too.
772

THE 'printppx' SUBCOMMAND

774   Synopsis
775       ocamlfind printppx
776                 [ -predicates pred-name-list ]
777                 [ -ppxopt package,arg ]
778                 package ...
779
780   Description
781       This command prints the ppx preprocessor options as they would occur in
782       an OCaml compiler invocation for the packages listed  in  the  command.
783       The output includes one "-ppx" option for each preprocessor. The possi‐
784       ble options have the same meaning as for "ocamlfind ocamlc". The option
785       "-predicates"  adds  assumed  predicates and "-ppxopt package,arg" adds
786       "arg" to the ppx invocation of package package.
787
788       The output of "ocamlfind printppx" will contain quotes """ for ppx com‐
789       mands  that contain space-separated arguments. In this case $(ocamlfind
790       printppx ...) won't work  as  naively  expected,  because  many  shells
791       (including bash and dash) perform field splitting on the result of com‐
792       mand substitutions without honoring quotes.
793

THE 'lint' SUBCOMMAND

795   Synopsis
796       ocamlfind lint file
797
798   Description
799       Checks the META file, and reports possible problems.
800

THE 'printconf' SUBCOMMAND

802   Synopsis
803       ocamlfind printconf [ conf | path | destdir | metadir | metapath | stdlib | ldconf ]
804
805   Description
806       This command prints the effective configuration after reading the  con‐
807       figuration  file,  and after applying the various environment variables
808       overriding settings. When called without arguments, the command  prints
809       all configuration options in a human-readable form. When called with an
810       argument, only the value of the requested  option  is  printed  without
811       explaining texts:
812
813         conf
814
815              Prints the location of the configuration file findlib.conf
816
817         path
818
819              Prints  the  search  path for packages. The members of the  path
820              are separated by linefeeds.
821
822         destdir
823
824              Prints the location where package are installed and  removed  by
825              default.
826
827         metadir
828
829              Prints  the location where META files are installed and  removed
830              (if the alternative layout is used).
831
832         metapath
833
834              Prints the path where the META file is installed for  a  fictive
835              package.  The  name  of  the  package is marked with '%s' in the
836              path.    For    instance,    this    command    could     output
837              "/some/path/%s/META"  or  "/some/path/META.%s", depending on the
838              layout.
839
840         stdlib
841
842              Prints the location of the standard library.
843
844         ldconf
845
846              Prints the location of the ld.conf file
847

THE SUBCOMMAND CALLING PACKAGE PROGRAMS

849   Synopsis
850       ocamlfind pkg/cmd argument ...
851
852   Description
853       This subcommand is useful to call programs that are installed in  pack‐
854       age  directories. It looks up the directory for  pkg and calls the com‐
855       mand named cmd in this directory. The remaining arguments are passed to
856       this command.
857
858       argv(0)  contains the absolute path to the command, and argv(1) and the
859       following argv entries contain the arguments. The working directory  is
860       not changed.
861
862       Example: To call the program "x" that is installed in package "p", with
863       arguments "y" and "z", run:
864
865       ocamlfind p/x y z
866

CONFIGURATION FILE, ENVIRONMENT VARIABLES

868       The configuration file and environment variables are documented in  the
869       manual page for  findlib.conf.
870

HOW TO SET THE TOOLCHAIN

872   Synopsis
873       ocamlfind -toolchain name ...
874
875   Description
876       The -toolchain option can be given before any other command, e.g.
877
878       ocamlfind -toolchain foo ocamlc -c file.ml
879        compiles file.ml with toolchain "foo". By selecting toolchains one can
880       switch to different command sets. For instance, the toolchain "foo" may
881       consist of a patched ocamlc compiler.   See findlib.conf how to config‐
882       ure toolchains.
883
884
885
886User Manual          The findlib package manager for OCaml        ocamlfind(1)
Impressum