1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-23 10:15:26 +02:00
tldr/pages/common/ocamlfind.md
Managor 8e09a08059
common*: refresh old pages part 3 (#16257)
Co-authored-by: Machiavelli <145562237+MachiavelliII@users.noreply.github.com>
2025-04-25 21:19:03 +03:00

672 B

ocamlfind

The findlib package manager for OCaml. Simplifies linking executables with external libraries. More information: https://manned.org/ocamlfind.

  • Compile a source file to a native binary and link with packages:

ocamlfind ocamlopt -package {{package1}},{{package2}} -linkpkg -o {{path/to/executable}} {{path/to/source.ml}}

  • Compile a source file to a bytecode binary and link with packages:

ocamlfind ocamlc -package {{package1}},{{package2}} -linkpkg -o {{path/to/executable}} {{path/to/source.ml}}

  • Cross-compile for a different platform:

ocamlfind -toolchain {{cross-toolchain}} ocamlopt -o {{path/to/executable}} {{path/to/source.ml}}