@@ -19,41 +19,36 @@ We assume that you have a Debian/Ubuntu or Red Hat-like distribution.
19
19
20
20
1 . You need a C/C++ compiler, Flex and Bison, and GNU make.
21
21
The GNU Make needs to be version 3.81 or higher.
22
- On Debian-like distributions, do
22
+ On Debian-like distributions, do as root:
23
23
```
24
24
apt-get install g++ gcc flex bison make git libwww-perl patch
25
25
```
26
- On Red Hat/Fedora or derivates, do
26
+ On Red Hat/Fedora or derivates, do as root:
27
27
```
28
- yum install gcc gcc-c++ flex bison perl-libwww-perl patch devtoolset-6
28
+ dnf install gcc gcc-c++ flex bison perl-libwww-perl patch
29
29
```
30
30
Note that you need g++ version 5.0 or newer.
31
31
32
32
To compile JBMC, you additionally need the JDK and the java-models-library.
33
- For the JDK, on Debian-like distributions, do
33
+ For the JDK, on Debian-like distributions, do as root:
34
34
```
35
35
apt-get install openjdk-8-jdk
36
36
```
37
- On Red Hat/Fedora or derivates, do
37
+ On Red Hat/Fedora or derivates, do as root:
38
38
```
39
- yum install java-1.8.0-openjdk-devel
39
+ dnf install java-1.8.0-openjdk-devel
40
40
```
41
41
42
42
2 . As a user, get the CBMC source via
43
43
```
44
44
git clone https://github.com/diffblue/cbmc cbmc-git
45
+ cd cbmc-git
45
46
```
46
47
47
- 3 . On Debian or Ubuntu , do
48
+ 3 . To compile , do
48
49
```
49
- make -C cbmc-git/src minisat2-download
50
- make -C cbmc-git/src
51
- ```
52
- On Redhat/Fedora etc., do
53
- ```
54
- scl enable devtoolset-6 bash
55
- make -C cbmc-git/src minisat2-download
56
- make -C cbmc-git/src
50
+ make -C src minisat2-download
51
+ make -C src
57
52
```
58
53
59
54
4 . Linking against an IPASIR SAT solver
@@ -71,8 +66,8 @@ We assume that you have a Debian/Ubuntu or Red Hat-like distribution.
71
66
72
67
5 . To compile JBMC, do
73
68
```
74
- make -C cbmc-git/ jbmc/src java-models-library-download
75
- make -C cbmc-git/ jbmc/src
69
+ make -C jbmc/src java-models-library-download
70
+ make -C jbmc/src
76
71
```
77
72
78
73
# COMPILATION ON SOLARIS 11
@@ -87,16 +82,17 @@ We assume that you have a Debian/Ubuntu or Red Hat-like distribution.
87
82
```
88
83
export PATH=/opt/csw/bin:$PATH
89
84
git clone https://github.com/diffblue/cbmc cbmc-git
85
+ cd cbmc-git
90
86
```
91
87
3 . To compile CBMC, type
92
88
```
93
- gmake -C cbmc-git/ src minisat2-download DOWNLOADER=wget TAR=gtar
94
- gmake -C cbmc-git/ src
89
+ gmake -C src minisat2-download DOWNLOADER=wget TAR=gtar
90
+ gmake -C src
95
91
```
96
92
4 . To compile JBMC, type
97
93
```
98
- gmake -C cbmc-git/ jbmc/src java-models-library-download
99
- gmake -C cbmc-git/ jbmc/src
94
+ gmake -C jbmc/src java-models-library-download
95
+ gmake -C jbmc/src
100
96
```
101
97
102
98
# COMPILATION ON FREEBSD 11
@@ -115,13 +111,13 @@ We assume that you have a Debian/Ubuntu or Red Hat-like distribution.
115
111
```
116
112
3 . To compile CBMC, do
117
113
```
118
- gmake -C cbmc-git/ src minisat2-download
119
- gmake -C cbmc-git/ src
114
+ gmake -C src minisat2-download
115
+ gmake -C src
120
116
```
121
117
4 . To compile JBMC, do
122
118
```
123
- gmake -C cbmc-git/ jbmc/src java-models-library-download
124
- gmake -C cbmc-git/ jbmc/src
119
+ gmake -C jbmc/src java-models-library-download
120
+ gmake -C jbmc/src
125
121
```
126
122
127
123
# COMPILATION ON MACOS X
@@ -137,16 +133,17 @@ Follow these instructions:
137
133
2 . Then get the CBMC source via
138
134
```
139
135
git clone https://github.com/diffblue/cbmc cbmc-git
136
+ cd cbmc-git
140
137
```
141
138
3 . To compile CBMC, do
142
139
```
143
- make -C cbmc-git/ src minisat2-download
144
- make -C cbmc-git/ src
140
+ make -C src minisat2-download
141
+ make -C src
145
142
```
146
143
4 . To compile JBMC, do
147
144
```
148
- make -C cbmc-git/ jbmc/src java-models-library-download
149
- make -C cbmc-git/ jbmc/src
145
+ make -C jbmc/src java-models-library-download
146
+ make -C jbmc/src
150
147
```
151
148
152
149
# COMPILATION ON WINDOWS
@@ -163,6 +160,7 @@ Follow these instructions:
163
160
2 . Get the CBMC source via
164
161
```
165
162
git clone https://github.com/diffblue/cbmc cbmc-git
163
+ cd cbmc-git
166
164
```
167
165
3 . Depending on your choice of compiler:
168
166
1 . To compile with Visual Studio, change the second line of ` src/config.inc `
@@ -171,19 +169,19 @@ Follow these instructions:
171
169
BUILD_ENV = MSVC
172
170
```
173
171
Open the Developer Command Prompt for Visual Studio, then start the
174
- Cygwin shell with
175
- ```
176
- bash.exe -login
177
- ```
172
+ Cygwin shell with
173
+ ```
174
+ bash.exe -login
175
+ ```
178
176
2. To compile with MinGW, use Cygwin setup to install a mingw g++ compiler
179
177
package, i.e. one of `mingw{32,64}-{x86_64,i686}-gcc-g++`. You may also
180
178
have to adjust the section in `src/common` that defines `CC` and `CXX`
181
179
for BUILD_ENV = Cygwin.
182
180
Then start the Cygwin shell.
183
181
4. In the Cygwin shell, type
184
182
```
185
- make -C cbmc-git/ src DOWNLOADER=wget minisat2-download
186
- make -C cbmc-git/ src
183
+ make -C src DOWNLOADER=wget minisat2-download
184
+ make -C src
187
185
```
188
186
189
187
(Optional) A Visual Studio project file can be generated with the script
@@ -278,96 +276,3 @@ To work with Eclipse, do the following:
278
276
5. Click "Finish"
279
277
6. Select Project -> Build All
280
278
281
- # CODE COVERAGE
282
-
283
- Code coverage metrics are provided using gcov and lcov. Ensure that you have
284
- installed lcov from http://ltp.sourceforge.net/coverage/lcov.php note for
285
- ubuntu lcov is available in the standard apt-get repos.
286
-
287
- To get coverage metrics run the following script from the regression directory:
288
- ```
289
- get_coverage.sh
290
- ```
291
- This will:
292
- 1) Rebuild CBMC with gcov enabled
293
- 2) Run all the regression tests
294
- 3) Collate the coverage metrics
295
- 4) Provide an HTML report of the current coverage
296
-
297
- # USING CLANG-FORMAT
298
-
299
- CBMC uses clang-format to ensure that the formatting of new patches is readable
300
- and consistent. There are two main ways of running clang-format: remotely, and
301
- locally.
302
-
303
- ## RUNNING CLANG-FORMAT REMOTELY
304
-
305
- When patches are submitted to CBMC, they are automatically run through
306
- continuous integration (CI). One of the CI checks will run clang-format over
307
- the diff that your pull request introduces. If clang-format finds formatting
308
- issues at this point, the build will be failed, and a patch will be produced
309
- in the CI output that you can apply to your code so that it conforms to the
310
- style guidelines.
311
-
312
- To apply the patch, copy and paste it into a local file (`patch.txt`) and then
313
- run:
314
- ```
315
- patch -p1 -i patch.txt
316
- ```
317
- Now, you can commit and push the formatting fixes.
318
-
319
- ## RUNNING CLANG-FORMAT LOCALLY
320
-
321
- ### INSTALLATION
322
-
323
- To avoid waiting until you've made a PR to find formatting issues, you can
324
- install clang-format locally and run it against your code as you are working.
325
-
326
- Different versions of clang-format have slightly different behaviors. CBMC uses
327
- clang-format-3.8 as it is available the repositories for Ubuntu 16.04 and
328
- Homebrew.
329
- To install on a Unix-like system, try installing using the system package
330
- manager:
331
- ```
332
- apt-get install clang-format-3.8 # Run this on Ubuntu, Debian etc.
333
- brew install
[email protected] # Run this on a Mac with Homebrew installed
334
- ```
335
-
336
- If your platform doesn't have a package for clang-format, you can download a
337
- pre-built binary, or compile clang-format yourself using the appropriate files
338
- from the [LLVM Downloads page](http://releases.llvm.org/download.html).
339
-
340
- An installer for Windows (along with a Visual Studio plugin) can be found at
341
- the [LLVM Snapshot Builds page](http://llvm.org/builds/).
342
-
343
- ### FORMATTING A RANGE OF COMMITS
344
-
345
- Clang-format is distributed with a driver script called git-clang-format-3.8.
346
- This script can be used to format git diffs (rather than entire files).
347
-
348
- After committing some code, it is recommended to run:
349
- ```
350
- git-clang-format-3.8 upstream/develop
351
- ```
352
- *Important:* If your branch is based on a branch other than `upstream/develop`,
353
- use the name or checksum of that branch instead. It is strongly recommended to
354
- rebase your work onto the tip of the branch it's based on before running
355
- `git-clang-format` in this way.
356
-
357
- ### RETROACTIVELY FORMATTING INDIVIDUAL COMMITS
358
-
359
- If your works spans several commits and you'd like to keep the formatting
360
- correct in each individual commit, you can automatically rewrite the commits
361
- with correct formatting.
362
-
363
- The following command will stop at each commit in the range and run
364
- clang-format on the diff at that point. This rewrites git history, so it's
365
- *unsafe*, and you should back up your branch before running this command:
366
- ```
367
- git filter-branch --tree-filter 'git-clang-format-3.8 upstream/develop' \
368
- -- upstream/develop..HEAD
369
- ```
370
- *Important*: `upstream/develop` should be changed in *both* places in the
371
- command above if your work is based on a different branch. It is strongly
372
- recommended to rebase your work onto the tip of the branch it's based on before
373
- running `git-clang-format` in this way.
0 commit comments