aboutsummaryrefslogtreecommitdiffstats
path: root/INSTALL.md
blob: 755ba690fb4790ea27f5577966785fc429280e9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# CompCert Install Instructions

## Dependencies

### Additional dependencies

Replace with the package manager for your distribution
```
sudo <pkg-manager> install -y mercurial darcs ocaml bubblewrap
```

### Opam

```
sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)
```

## Post-install

Run
```
eval `opam config env`
```
Add this to your `.bashrc` or `.bash_profile`
```
. $HOME/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
```
Switch to a recent OCaml compiler version
```
opam switch create 4.12.0
opam switch 4.12.0
```
Install dependencies available through opam
```
opam install coq menhir
```
Note: it may happen that a newer version of Coq is not supported yet.
You may downgrade to solve the problem:
```
opam pin add coq 8.13.2 # example of Coq version
```

### For Kalray KVX
On this platform, we also need Gappa installed.
You may need to first install some development packages. On Ubuntu:
```
apt install bison flex libmpfr-dev libboost-dev
```

This install Gappa and Flocq:
```
opam pin add coq-flocq 3.4.0 --no-action
opam install gappa coq-gappa coq-flocq
```

## Compilation

You can choose change the installation directory by modifying the
`config_simple.sh` file before running the configuration script.

Then, use the configuration script corresponding to your desired platform:
(for Kalray Coolidge it is `config_kvx.sh`)
```
./config_<platform>.sh
```

If using Kalray's platform, make sure that the kvx tools are on your path
Compile (adapt -j# to the number of cores and available RAM)
```
make -j12
make install
```

## Tests

## Documentation

You can generate the documentation locally with:
```
make documentation
```

Note that you need to install [coq2html](https://github.com/xavierleroy/coq2html)
before doing so.

## Utilization

`ccomp` binaries are installed at `$(CCOMP_INSTALL_PREFIX)/bin`
(variable defined in `config_simple.sh`).
Make sure to add that to your path to ease its use
Now you may use it like a regular compiler
```
ccomp -O3 test.c -S
ccomp -O3 test.c -o test.bin
```

## Changing platform

If you decide to change the platform, for instance from kvx-cos to kvx-mbr, you
should change the `compcert.ini` file with the respective tools and then run
```
make install
```

## Cleaning

To clean only object files while keeping the platform configuration:
```
make clean
```

To clean everything (to then reconfigure for another platform):
```
make distclean
```