How to install SSReflect and MathComp in Linux?

天大地大妈咪最大 提交于 2019-11-29 04:14:17

I'm on Ubuntu 16.04. Let's take a step back and begin by installing OPAM:

$ sudo apt update && sudo apt install opam
$ opam --version
1.2.2
$ opam init     # agree to modify your dot-files
$ eval `opam config env`
$ ocamlc -version
4.02.3

Next, you may want to switch from Ubuntu's pretty old OCaml version to a more recent one. This step is optional and it takes around 10 min.

$ opam switch 4.04.1
$ eval `opam config env`
$ ocamlc -version
4.04.1

Now, let's add the following repository to be able to install math-comp:

$ opam repo add coq-released https://coq.inria.fr/opam/released

And, finally, install ssreflect:

$ opam install coq-mathcomp-ssreflect

OPAM will figure out the dependencies (including Coq), download and install what we have asked!

For sake of completeness, an alternative way is by using the Nix package manager (instead of OPAM). After installing it (curl https://nixos.org/nix/install | sh), you can launch a CoqIDE with Math-Comp available with the following command:

nix-shell -p coqPackages_8_6.mathcomp --run coqide

Then you can just start your file with From mathcomp Require Import ssreflect.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!