---
title: "#증명보조기: #콕 #설치 #오펨 #VSCODE"
url: "https://notes.junghanacs.com/notes/20240708T194652"
author: "Junghan Kim"
date: "2024-07-08T19:46:00+09:00"
lastmod: "2025-06-08T00:00:00+09:00"
tags: ["coq","vscode","proof"]
description: "opam과 VSCode 경로를 이용해 Coq를 설치하고 언어 서버까지 맞추는 절차를 적은 기록."
---

> [!abstract] 이 노트에 대하여
> 
> opam으로 Coq와 CoqIDE, VSCoq 언어 서버를 설치하는 과정을 명령어 중심으로 정리한다. Emacs 외의 편집기 경로까지 함께 보며 Coq 환경을 넓게 이해하려는 보조 설치 노트다.

## OPAM

```shell

opam pin add coq 8.18.0
opam install coqide
opam install vscoq-language-server

```

## 먼저 opam 을 설치

.zshrc 수정 된다.

```text
bash -c "sh <(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)"

# sudo add-apt-repository ppa:avsm/ppa
# sudo apt install opam


```

## coq 설치

```text
$ opam pin add coq 8.18.0

coq is now pinned to version 8.18.0

coq The following actions will be performed:
=== install 8 packages
  ∗ conf-gmp      4               [required by zarith]
  ∗ coq           8.18.0 (pinned)
  ∗ coq-core      8.18.0          [required by coq]
  ∗ coq-stdlib    8.18.0          [required by coq]
  ∗ coqide-server 8.18.0          [required by coq]
  ∗ dune          3.16.0          [required by coq]
  ∗ ocamlfind     1.9.6           [required by coq-core]
  ∗ zarith        1.13            [required by coq-core]

Proceed with ∗ 8 installations? [y/n] y

➜ coqtop --version
The Coq Proof Assistant, version 8.18.0
compiled with OCaml 4.13.1
(base) ~ via  v20.14.0
```

## coq-ide 설치

필요한 패키지를 apt 에서 일부 가져온다. 아무튼 설치 된다.

```text
  $ opam install coqide

  <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
∗ installed conf-pkg-config.3
∗ installed conf-adwaita-icon-theme.2
∗ installed conf-findutils.1
∗ installed conf-gtk3.18
∗ installed conf-cairo.1
∗ installed conf-gtksourceview3.0+2
⬇ retrieved coqide.8.18.0  (cached)
⬇ retrieved camlp-streams.5.0.1  (https://opam.ocaml.org/cache)
⬇ retrieved cairo2.0.6.4  (https://opam.ocaml.org/cache)
∗ installed camlp-streams.5.0.1
⬇ retrieved dune-configurator.3.16.0  (cached)
⬇ retrieved csexp.1.5.2  (https://opam.ocaml.org/cache)
∗ installed csexp.1.5.2
⬇ retrieved lablgtk3.3.1.5, lablgtk3-sourceview3.3.1.5  (https://opam.ocaml.org/cache)
∗ installed dune-configurator.3.16.0
∗ installed cairo2.0.6.4
∗ installed lablgtk3.3.1.5
∗ installed lablgtk3-sourceview3.3.1.5
∗ installed coqide.8.18.0

```

## vscoq-language-server 설치

이제 설치한다.

```text

$ opam install vscoq-language-server

After installation, check that you have vscoqtop in your shell and note the path to this executable:

$ which vscoqtop

```

## 이맥스 설정을 넣어라

opam으로 잡혀있으니까 넣어줘야 한다.

```elisp
(setq coq-prog-name "/home/junghan/.opam/default/bin/coqtop")
```

## 관련노트

## BIBLIOGRAPHY
