Search code examples
ocamlopam

After installing a program using opam, how do I run it?


I successfully installed a program using opam: opam install lustre-v6. But how to run it? I stupidly tried lv6, opam lv6, ocaml lv6, opam lustre-v6, opam run lustre-v6, ocaml lustre-v6, etc., to no avail.


Solution

  • To add to @Ayrat 's answer: the important command here is

    eval `opam env`
    

    which detects your shell and sets appropriate environment variables. This is because opam installs binaries to a custom directory within your current opam switch, and that directory is not in your system's search path. You probably want to put the command above into your shell's init script.