The easiest way to get all packages is through opam
.
See Coq's opam documentation
for installing an opam
switch for Coq.
See releases and
Coq's Package Index for information on
the available releases and opam packages.
To add the Coq repository to available opam
packages, use:
# opam repo add coq-released https://coq.inria.fr/opam/released
To update the list of available packages at any point use:
# opam update
Then, simply issue:
# opam install coq-metacoq
MetaCoq is split into multiple packages that get all installed using the
coq-metacoq
meta-package:
coq-metacoq-utils
for a general library used by all MetaCoq packagescoq-metacoq-common
for definitions used both by Template-Coq and PCUIC packagescoq-metacoq-template
for the Template Monad and quoting plugincoq-metacoq-pcuic
for the PCUIC metatheory developmentcoq-metacoq-template-pcuic
for the verified Template-Coq <-> PCUIC translationscoq-metacoq-safechecker
for the verified checker on PCUIC termscoq-metacoq-safechecker-plugin
for the extracted verified checker plugincoq-metacoq-erasure
for the verifed erasure from PCUIC to untyped lambda-calculus.coq-metacoq-erasure-plugin
for the extracted verifed erasure plugincoq-metacoq-translations
for example translations from type theory to type theory: e.g. variants of parametricity.coq-metacoq-quotation
for a quotation library, allowing to quote MetaCoq terms and typing derivations as MetaCoq terms, with a work-in-progress proof of Löb's theorem.
There are also .dev
packages available in the extra-dev
repository
of Coq, to get those you will need to activate the following repositories:
opam repo add coq-core-dev https://coq.inria.fr/opam/core-dev
opam repo add coq-extra-dev https://coq.inria.fr/opam/extra-dev
To compile the library, you need:
- The
Coq
version corrsponding to your branch (you can use thecoq.dev
package for themain
branch). OCaml
(tested with4.14.0
)Equations 1.3
The recommended way to build a development environment for MetaCoq is
to have a dedicated opam
switch (see below).
To get the source code:
# git clone https://github.com/MetaCoq/metacoq.git
# git checkout -b coq-8.18 origin/coq-8.18
# git status
This checks that you are indeed on the coq-8.18
branch.
To setup a fresh opam
installation, you might want to create a
"switch" (an environment of opam
packages) for Coq
if you don't have
one yet. You need to use opam 2 to obtain the right version of
Equations
.
# opam switch create coq.8.18 --packages="ocaml-variants.4.14.0+options,ocaml-option-flambda"
# eval $(opam env)
This creates the coq.8.18
switch which initially contains only the
basic OCaml
4.13.1
compiler with the flambda
option enabled,
and puts you in the right environment (check with ocamlc -v
).
Once in the right switch, you can install Coq
and the Equations
package using:
# opam install . --deps-only
If the commands are successful you should have coq
available (check with `coqc -v**).
Remark: You can create a local switch for developing using (in the root directory of the sources):
# opam switch create . --packages="ocaml-variants.4.14.0+options,ocaml-option-flambda"
Or use opam switch link foo
to link an existing opam switch foo
with
the sources directory.
Important: To compile locally without using opam
, use ./configure.sh local
at the root.
Then use:
-
make
to compile thetemplate-coq
plugin, thepcuic
development and thesafechecker
anderasure
plugins, along with thetest-suite
,translations
,examples
andquotation
libraries. You can also selectively build each target. -
make install
to install the plugins inCoq
'suser-contrib
local library. Then theMetaCoq
namespace can be used forRequire Import
statements, e.g.From MetaCoq.Template Require Import All.
. -
make uninstall
to undo the last line.
For faster development one can use:
-
make vos
to compilevos
files (bypassing proofs) forpcuic
,safechecker
anderasure
. The template-coq library is still using the regularvo
target to be able to construct the template-coq plugin. Thesafechecker
anderasure
ML plugins cannot be built using this mode. -
make quick
is a synonymous formake vos
with the addition of a globalUnset Universe Checking
option, i.e. universes are not checked anywhere.