Skip to content

Installing dependencies

Jonathan Yong edited this page Mar 30, 2023 · 7 revisions

The command to build the programme is dune build @all, or just dune build for short. However, dune isn't capable of directly installing project dependencies (see e.g. https://github.com/ocaml/dune/issues/164). Instead, the dependencies are specified in the dune-project file, and from this dune can create a whatwhat.opam file using:

dune build

You will get error messages of the form Library "..." not found. This is perfectly normal—after all, the dependencies haven't been installed yet. However, you should now find a whatwhat.opam file in the project directory. From this directory, run

opam install . --deps-only -y

and opam should install all the necessary dependencies. After that, dune build should complete successfully.

If it still complains about missing dependencies, then you need to figure out which package it is (dune's output will tell you). Then, add it to the dune-project file (inside the depends stanza), and rerun both commands above. (And commit the changes to dune-project!)

The Makefile contains a target to install all dependencies: just run make install-deps.

Clone this wiki locally