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