2025-03-14 21:59:59 -06:00
|
|
|
# ocamlfind
|
|
|
|
|
|
|
|
|
|
> The findlib package manager for OCaml.
|
|
|
|
|
> Simplifies linking executables with external libraries.
|
2025-05-08 12:26:01 -06:00
|
|
|
> More information: <https://manned.org/ocamlfind>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- 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}}`
|