|
1 | 1 | # Installation
|
2 | 2 |
|
3 |
| -To install the latest version of Kani, run: |
4 |
| - |
5 |
| -```bash |
6 |
| -cargo install --locked kani-verifier |
7 |
| -cargo-kani setup |
8 |
| -``` |
| 3 | +Kani offers an easy installation option on two platforms: |
9 | 4 |
|
10 |
| -This will build and place in `~/.cargo/bin` (in a typical environment) the `kani` and `cargo-kani` binaries. |
11 |
| -The second step (`cargo-kani setup`) will download the Kani compiler and other necessary dependencies (and place them under `~/.kani/`). |
| 5 | +* `x86_64-unknown-linux-gnu` (Most Linux distributions) |
| 6 | +* `x86_64-apple-darwin` (Intel Mac OS) |
12 | 7 |
|
13 |
| -Currently, only two platforms are supported: |
| 8 | +Other platforms are either not yet supported or require instead that you [build from source](build-from-source.md). |
14 | 9 |
|
15 |
| -* `x86_64-unknown-linux-gnu` |
16 |
| -* `x86_64-apple-darwin` |
| 10 | +## Dependencies |
17 | 11 |
|
18 | 12 | The following must already be installed:
|
19 | 13 |
|
20 |
| -* **Python version 3.8 or greater** and the package installer pip. |
21 |
| -* Rust installed via `rustup` |
22 |
| -* `ctags` is required for Kani's `--visualize` option to work correctly. |
| 14 | +* **Python version 3.6 or greater** and the package installer `pip`. |
| 15 | +* Rust installed via `rustup`. |
| 16 | +* `ctags` is required for Kani's `--visualize` option to work correctly. [Universal ctags](https://ctags.io/) is recommended. |
| 17 | + |
| 18 | +## Installing the latest version |
23 | 19 |
|
24 |
| -# Installing an older version of Kani |
| 20 | +To install the latest version of Kani, run: |
25 | 21 |
|
26 | 22 | ```bash
|
27 |
| -cargo install --lock kani-verifier --version <VERSION> |
| 23 | +cargo install --locked kani-verifier |
28 | 24 | cargo-kani setup
|
29 | 25 | ```
|
30 | 26 |
|
31 |
| -# Building from source |
32 |
| - |
33 |
| -In general, the following dependencies are required. |
34 |
| - |
35 |
| -> **NOTE**: These dependencies may be installed by running the CI scripts shown |
36 |
| -> below and there's no need to install them separately, for their respective |
37 |
| -> OS. |
38 |
| -
|
39 |
| -1. Cargo installed via [rustup](https://rustup.rs/) |
40 |
| -2. [CBMC](https://github.com/diffblue/cbmc) (>= 5.59.0) |
41 |
| -3. [CBMC Viewer](https://github.com/awslabs/aws-viewer-for-cbmc) (>= 3.5) |
42 |
| - |
43 |
| -Kani has been tested in [Ubuntu](#install-dependencies-on-ubuntu) and [macOS](##install-dependencies-on-macos) platforms. |
44 |
| - |
45 |
| -## Install dependencies on Ubuntu |
46 |
| - |
47 |
| -Support is available for Ubuntu 18.04 and 20.04. |
48 |
| -The simplest way to install dependencies (especially if you're using a fresh VM) |
49 |
| -is following our CI scripts: |
50 |
| - |
51 |
| -``` |
52 |
| -# git clone [email protected]:model-checking/kani.git |
53 |
| -git clone https://github.com/model-checking/kani.git |
54 |
| -cd kani |
55 |
| -git submodule update --init |
56 |
| -./scripts/setup/ubuntu/install_deps.sh |
57 |
| -./scripts/setup/ubuntu/install_cbmc.sh |
58 |
| -./scripts/setup/install_viewer.sh 3.5 |
59 |
| -./scripts/setup/install_rustup.sh |
60 |
| -# If you haven't already: |
61 |
| -source $HOME/.cargo/env |
62 |
| -``` |
63 |
| - |
64 |
| -## Install dependencies on macOS |
65 |
| - |
66 |
| -Support is available for macOS 10.15. You need to have [Homebrew](https://brew.sh/) installed already. |
67 |
| - |
68 |
| -``` |
69 |
| -# git clone [email protected]:model-checking/kani.git |
70 |
| -git clone https://github.com/model-checking/kani.git |
71 |
| -cd kani |
72 |
| -git submodule update --init |
73 |
| -./scripts/setup/macos-10.15/install_deps.sh |
74 |
| -./scripts/setup/macos-10.15/install_cbmc.sh |
75 |
| -./scripts/setup/install_viewer.sh 3.5 |
76 |
| -./scripts/setup/install_rustup.sh |
77 |
| -# If you haven't already: |
78 |
| -source $HOME/.cargo/env |
79 |
| -``` |
80 |
| - |
81 |
| -## Build and test Kani |
82 |
| - |
83 |
| -Build the Kani package: |
84 |
| - |
85 |
| -``` |
86 |
| -cargo build --workspace |
87 |
| -``` |
88 |
| - |
89 |
| -Then, optionally, run the regression tests: |
90 |
| - |
91 |
| -``` |
92 |
| -./scripts/kani-regression.sh |
93 |
| -``` |
94 |
| - |
95 |
| -This script has a lot of noisy output, but on a successful run you'll see: |
96 |
| - |
97 |
| -``` |
98 |
| -All Kani regression tests completed successfully. |
99 |
| -``` |
100 |
| - |
101 |
| -## Try running Kani |
| 27 | +This will build and place in `~/.cargo/bin` (in a typical environment) the `kani` and `cargo-kani` binaries. |
| 28 | +The second step (`cargo-kani setup`) will download the Kani compiler and other necessary dependencies (and place them under `~/.kani/`). |
102 | 29 |
|
103 |
| -Add the Kani scripts to your path: |
| 30 | +## Installing an older version |
104 | 31 |
|
105 | 32 | ```bash
|
106 |
| -export PATH=$(pwd)/scripts:$PATH |
| 33 | +cargo install --lock kani-verifier --version <VERSION> |
| 34 | +cargo-kani setup |
107 | 35 | ```
|
108 | 36 |
|
109 |
| -Create a test file: |
| 37 | +## Checking your installation |
| 38 | + |
| 39 | +After you've installed Kani, |
| 40 | +you can try running it by creating a test file: |
110 | 41 |
|
111 | 42 | ```rust
|
112 | 43 | // File: test.rs
|
|
0 commit comments