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-template
for the Template Monad and quoting plugincoq-metacoq-pcuic
for the PCUIC development and proof of the Template-Coq -> PCUIC translationcoq-metacoq-safechecker
for the verified checker on PCUIC termscoq-metacoq-erasure
for the verifed erasure from PCUIC to untyped lambda-calculus.coq-metacoq-translations
for example translations from type theory to type theory: e.g. variants of parametricity.
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 themaster
branch). OCaml
(tested with4.06.1
,4.07.1
, and4.10.0
, beware thatOCaml 4.06.0
can produce linking errors on some platforms)Equations 1.2.3
(not necessary for thetemplate-coq
plugin).
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.13 origin/coq-8.13
# git status
This checks that you are indeed on the coq-8.13
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.13 4.07.1
# eval $(opam env)
This creates the coq.8.13
switch which initially contains only the
basic OCaml
4.07.1
compiler, 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 . 4.07.1
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. You can also selectively build each target. -
make translations
to compile the translation plugins -
make test-suite
to compile the test suite -
make install
to install the plugin 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.