Search code examples
ocamlupgradecoqubuntu-18.04opam

How to upgrade Ocaml to the latest version to support QuickChick in Coq?


When I installed QuickChick from opam, I obtained:

The following dependencies couldn't be met:

  • coq-quickchick → ocaml >= 4.04.0

    base of this switch (use --unlock-base to force)

How should I upgrade ocaml to the latest version to support QuickChick without ruining the configuration of Coq?


which ocaml:

/home/hengxin/opam-coq.8.9.0/ocaml-base-compiler.4.02.3/bin/ocaml

opam list: opam-list


Solution

  • If I'm not mistaken, using the suggested option (--unlock-base) will allow opam to upgrade your ocaml version and keep the same switch. However, since nearly all packages depend on the ocaml package, the operation will actually reinstall all the packages, so you won't gain much w.r.t. creating a new switch.

    If you try this way, you may have to relock some packages afterwards (such as ocaml) to avoid modifying them in usual operations with opam (I do not remember whether that --unlock-base is temporary or permanent).