This repository is a package repository for the opam package manager. It contains OxCaml, together with Jane Street libraries and necessary patches to other packages.
Start by creating a new switch including our repository in OPAM:
# Update to make sure you get the latest version of all packages
opam update --all
# This may take some time to install
opam switch create 5.2.0+ox --repos ox=git+https://github.com/oxcaml/opam-repository.git,default
eval $(opam env --switch 5.2.0+ox)
If the installation was successful, you can now use OxCaml!
OxCaml supports developer tooling such as ocamlformat
or merlin
:
opam install ocamlformat merlin ocaml-lsp-server utop
Jane Street libraries such as Base and Core support many OxCaml features. Install them with opam install
, and read their documentation and interface files to learn more. For a general introduction to OCaml and our libraries, refer to Real World OCaml.
OxCaml does not yet support architectures other than x86_64 or ARM64.
OxCaml depends on glibc, so musl-based Linux distributions like Alpine are not yet supported.
OxCaml does not yet support Windows. Windows users are recommended to use WSL 2.
Installing OxCaml requires autoconf. Normally, OPAM will prompt you to install autoconf through your system package manager if needed, but if that doesn't work, you might have to install it manually.
Some Jane Street extensions, like comprehensions
, are unstable and thus hidden behind the -extension-universe
compiler flag.
You can use the flags
field in dune
files to enable them:
(library
(name your_lib)
(flags (:standard -extension-universe beta)))
The SIMD compiler extension is not yet supported on ARM architectures.