2020-10-05 15:19:55 +01:00
|
|
|
# ocamlfind
|
|
|
|
|
|
|
|
> The findlib package manager for OCaml.
|
|
|
|
> Simplifies linking executables with external libraries.
|
|
|
|
> More information: <http://projects.camlcity.org/projects/findlib.html>.
|
|
|
|
|
|
|
|
- Compile a source file to a native binary and link with packages:
|
|
|
|
|
2023-05-19 18:51:42 +01:00
|
|
|
`ocamlfind ocamlopt -package {{package1}},{{package2}} -linkpkg -o {{path/to/executable}} {{path/to/source.ml}}`
|
2020-10-05 15:19:55 +01:00
|
|
|
|
|
|
|
- Compile a source file to a bytecode binary and link with packages:
|
|
|
|
|
2023-05-19 18:51:42 +01:00
|
|
|
`ocamlfind ocamlc -package {{package1}},{{package2}} -linkpkg -o {{path/to/executable}} {{path/to/source.ml}}`
|
2020-10-05 15:19:55 +01:00
|
|
|
|
|
|
|
- Cross-compile for a different platform:
|
|
|
|
|
2023-05-19 18:51:42 +01:00
|
|
|
`ocamlfind -toolchain {{cross-toolchain}} ocamlopt -o {{path/to/executable}} {{path/to/source.ml}}`
|