@@ -10,7 +10,7 @@ following environments:
10
10
The above environments are currently tested as part of our continuous
11
11
integration system. It separately tests both the CMake build system and the
12
12
hand-written make files. The latest build steps being used in CI can be
13
- [ referenced here] ( https://github.com/diffblue/cbmc/blob/develop/.github/workflows/pull-request-checks.yaml ) .
13
+ [ found here] ( https://github.com/diffblue/cbmc/blob/develop/.github/workflows/pull-request-checks.yaml ) .
14
14
15
15
The environments below have been used successfully in the
16
16
past, but are not actively tested:
@@ -22,7 +22,7 @@ past, but are not actively tested:
22
22
23
23
Building with CMake is supported across Linux, MacOS X and Windows with Visual
24
24
Studio 2019. There are also hand-written make files which can be used to build
25
- separate binaries independently. Usage of the hand-written make files is
25
+ separate targets independently. Usage of the hand-written make files is
26
26
explained in a separate section. The CMake build can build the complete
27
27
repository in fewer steps and supports better integration with various IDEs and
28
28
static-analysis tools. On Windows, the CMake build has the advantage of not
47
47
```
48
48
You should also install [Homebrew](https://brew.sh), after which you can
49
49
run `brew install cmake` to install CMake.
50
- - On platforms where installing the Java Development Kit and Maven is
51
- difficult, you can avoid needing these dependencies by not building
52
- JBMC. Just pass `-DWITH_JBMC=OFF` to `cmake` in step (4) below.
53
50
- On Windows, ensure you have Visual Studio 2019 or later installed. The
54
51
developer command line that comes with Visual Studio 2019 has CMake
55
52
already available. You will also need to ensure that you have winflexbison
@@ -103,6 +100,10 @@ files.
103
100
`-DCMAKE_EXE_LINKER_FLAGS=...`. This is useful for enabling clang's
104
101
sanitizers.
105
102
103
+ **Note: Building without JBMC**: On platforms where installing the Java
104
+ Development Kit and Maven is difficult, you can avoid needing these
105
+ dependencies by not building JBMC. Just pass `-DWITH_JBMC=OFF` to `cmake`.
106
+
106
107
Finally, to enable building universal binaries on macOS, you can pass the
107
108
flag `-DCMAKE_OSX_ARCHITECTURES=i386;x86_64`. If you don't supply this flag,
108
109
the built binaries will only work on the architecture of the machine being
@@ -115,15 +116,19 @@ files.
115
116
This command tells CMake to invoke the correct tool to run the build in the
116
117
`build` directory. You can also use the build back-end directly by invoking
117
118
`make`, `ninja`, or opening the generated IDE project as appropriate. The
118
- complete set of built binaries can be found in `./ build/bin` once the build
119
+ complete set of built binaries can be found in `build/bin/ ` once the build
119
120
is complete.
120
121
121
- # Building using hand-written make files.
122
+ *Parellel building*: You can pass `-j<numjobs>` to `make` to indicate how many
123
+ jobs to run simultaneously. `ninja` defaults to building with `# of cores + 2`
124
+ jobs at the same time.
125
+
126
+ # Building using Make
122
127
123
- The rest of this section is split up based on the platform being built on.
124
- Please read the section appropriate for your machine .
128
+ The rest of this section is split up based on the platform being built on.
129
+ Please read the section appropriate for your platform .
125
130
126
- ## COMPILATION ON LINUX
131
+ ## Compiling with Make on Linux
127
132
128
133
We assume that you have a Debian/Ubuntu or Red Hat-like distribution.
129
134
@@ -175,7 +180,7 @@ We assume that you have a Debian/Ubuntu or Red Hat-like distribution.
175
180
make -C jbmc/src
176
181
```
177
182
178
- ## COMPILATION ON MACOS X
183
+ ## Compiling with Make on MacOS
179
184
180
185
Follow these instructions:
181
186
@@ -202,7 +207,7 @@ Follow these instructions:
202
207
make -C jbmc/src
203
208
```
204
209
205
- ## COMPILATION ON SOLARIS 11
210
+ ## Compiling with Make on Solaris
206
211
207
212
We assume Solaris 11.4 or newer. To build JBMC, you'll need to install
208
213
Maven 3 manually.
@@ -227,7 +232,7 @@ Maven 3 manually.
227
232
gmake -C jbmc/src
228
233
```
229
234
230
- ## COMPILATION ON FREEBSD 11
235
+ ## Compiling with Make on FreeBSD
231
236
232
237
1. As root, get the necessary tools:
233
238
```
@@ -253,7 +258,7 @@ Maven 3 manually.
253
258
gmake -C jbmc/src
254
259
```
255
260
256
- # Working with IDEs
261
+ # Working with IDEs and Docker
257
262
258
263
## Working with Visual Studio on Windows
259
264
@@ -290,23 +295,23 @@ the need to integrate JBMC as a separate project. Be aware that you need to
290
295
change the build location (Select project in Eclipse -> Properties -> C/C++
291
296
Build) to one of the src directories.
292
297
293
- # WORKING WITH DOCKER
298
+ ## Working with Docker
294
299
295
300
To compile and run the tools in a Docker container, do the following:
296
301
297
302
1. From the root folder of the project, run `$ docker build -t cbmc .`
298
- 2. After the building phase has finished, there should be a new
303
+ 2. After the building phase has finished, there should be a new
299
304
image with the CProver binaries installed under `/usr/local/bin/`.
300
305
301
306
To start a container using that image as a base, run `$ docker run -i -t cbmc`
302
307
This will result in dropping you to a new terminal inside the container. To
303
308
load files for analysis into the container, one way is by mounting the folder
304
309
that contains the tests to the container. A possible invocation that does that
305
- is: `$ docker run --mount type=bind,source=local/path/with/files,target=/mnt/analysis -i t cbmc`. In the
306
- resulting container, the files present in the local file system under
307
- `local/path/with/files` will be present under `/mnt/analysis`.
310
+ is: `$ docker run --mount type=bind,source=local/path/with/files,target=/mnt/analysis -i t cbmc`.
311
+ In the resulting container, the files present in the local file system under
312
+ `local/path/with/files` will be present under `/mnt/analysis`.
308
313
309
- # OPTIONS AND VARIABLES
314
+ # Compilation options and configuration
310
315
311
316
## Compiling with CUDD
312
317
0 commit comments