---
name: "ocamlmklib"
section: "1"
platform: "linux"
package: "ocaml"
version: "5.3.0-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ocamlmklib"
---

# ocamlmklib(1)

generate libraries with mixed C / Caml code.

## NAME

ocamlmklib - generate libraries with mixed C / Caml code.

## SYNOPSIS

**ocalmklib** \[*options*\] *files*

## DESCRIPTION

The **ocamlmklib** command facilitates the construction of libraries containing both Caml code and C code, and usable both in static linking and dynamic linking modes.

## OPTIONS

- **-h, --help**

  Show summary of options.

- **-cclib** *lib*

  C library passed to ocamlc **-a** or [**ocamlopt**(1)](/ocamlopt/1.md) **-a** only.

- **-ccopt** *opt*

  C option passed to [**ocamlc**(1)](/ocamlc/1.md) **-a** or [**ocamlopt**(1)](/ocamlopt/1.md) **-a** only.

- **-custom**

  Disable dynamic loading.

- **-dllpath** *dir*

  Add *dir* to the run-time search path for DLLs.

- **-I** *dir*

  Add *dir* to the path searched for Caml object files.

- **-failsafe**

  Fall back to static linking if DLL construction failed.

- **-ldopt opt**

  C option passed to the shared linker only.

- **-linkall**

  Build Caml archive with link-all behavior.

- **-l***lib*

  Specify a dependent C library.

- **-L***dir*

  Add *dir* to the path searched for C libraries.

- **-ocamlc** *cmd*

  Use *cmd* in place of [**ocamlc**(1)](/ocamlc/1.md).

- **-ocamlopt** *cmd*

  Use *cmd* in place of [**ocamlopt**(1)](/ocamlopt/1.md).

- **-o** *name*

  Generated Caml library is named *name*.cma or *name*.cmxa.

- **-oc** *name*

  Generated C library is named dll*name*.so or lib*name*.a.

- **-rpath** *dir*

  Same as **-dllpath** *dir*.

- **-R***dir*

  Same as **-rpath**.

- **-verbose**

  Print commands before executing them.

- **-Wl**, **-rpath** *dir*

  *Same as* **-dllpath** *dir*.

- **-Wl**, **-rpath -Wl** *dir*

  *Same as* **-dllpath** *dir*.

- **-Wl**, **-R***dir*

  *Same as* **-dllpath** *dir*.

- **-F***dir*

  *Specify a framework directory (MacOSX).*

- **-framework** *name*

  *Use framework* *name* *(MacOSX).*

## SEE ALSO

[**ocamlc**(1)](/ocamlc/1.md), [**ocamlopt**(1)](/ocamlopt/1.md).

## AUTHOR

*This manual page was written by Samuel Mimram \<samuel.mimram@ens-lyon.org\>,* *for the Debian project (but may be used by others).*
