- OCaml version > 4.03 and < 5.0.0
We recommend using OPAM the OCaml Package Manager
to install and manage the OCaml environment.
The quickest way to get the latest opam up and working is to run this script:
bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)"
Similarly, you can also use your distribution's package manager to install
pacman -S opam
apt-get install opam
Do not put sudo in front of any opam commands. That would break your OCaml installation.
After Installing OPAM, we need to initialize it
For the general case, we can execute
opam init --bare -a -y
If you are using WSL1 on windows, run:
opam init --bare -a -y --disable-sandboxing
Using opam, we can have multiple versions of ocaml at the same time; this is called switch.
Due to the upstream ocaml-rs
, we currently do not support OCaml5, and recommend using the latest version of OCaml4
We can create use this command:
opam switch create opendal-ocaml4.14 ocaml-base-compiler.4.14.0
eval $(opam env)
OpenDAL does not depend on opam package except ounit2
for testing.
However, to facilitate development in an IDE such as vscode, it is usually necessary to install the following content
opam install -y utop odoc ounit2 ocaml-lsp-server ocamlformat ocamlformat-rpc
cd bindings/ocaml
dune build
To execute unit tests, we can simply use the following command:
cd bindings/ocaml
dune test
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
Apache OpenDAL, OpenDAL, and Apache are either registered trademarks or trademarks of the Apache Software Foundation.