@@ -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,27 @@ Maven 3 manually.
253
258
gmake -C jbmc/src
254
259
```
255
260
256
- # WORKING WITH ECLIPSE
261
+ # Working with IDEs and Docker
262
+
263
+ ## Working with Visual Studio on Windows
264
+
265
+ Follow these instructions to work on Windows with Visual Studio:
266
+
267
+ 1. Open the `cbmc` folder in Visual Studio. Visual Studio 2017 and
268
+ later have automated support for CMake projects, so you need to
269
+ give sometime to Visual Studio to index the project and load its
270
+ own plugins, and then it's going to be ready to build `cbmc`.
271
+ 2. Once indexing and plugin loading has finished, a menu `Build`
272
+ should have appeared on the top bar. From there, select `Build All`.
273
+ 3. After the build has finished, there should be a folder `out` present.
274
+ Navigating `out/build/<build_parameters>/bin` should get you to the
275
+ binaries and other artifacts built, with `<build_parameters>` corresponding
276
+ to something like `x64-Debug (Default)` or whatever the equivalent is
277
+ for your system.
278
+
279
+ The above instructions have been tested against Visual Studio 2019.
280
+
281
+ ## Working with Eclipse
257
282
258
283
To work with Eclipse, do the following:
259
284
@@ -270,23 +295,23 @@ the need to integrate JBMC as a separate project. Be aware that you need to
270
295
change the build location (Select project in Eclipse -> Properties -> C/C++
271
296
Build) to one of the src directories.
272
297
273
- # WORKING WITH DOCKER
298
+ ## Working with Docker
274
299
275
300
To compile and run the tools in a Docker container, do the following:
276
301
277
302
1. From the root folder of the project, run `$ docker build -t cbmc .`
278
- 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
279
304
image with the CProver binaries installed under `/usr/local/bin/`.
280
305
281
306
To start a container using that image as a base, run `$ docker run -i -t cbmc`
282
307
This will result in dropping you to a new terminal inside the container. To
283
308
load files for analysis into the container, one way is by mounting the folder
284
309
that contains the tests to the container. A possible invocation that does that
285
- is: `$ docker run --mount type=bind,source=local/path/with/files,target=/mnt/analysis -i t cbmc`. In the
286
- resulting container, the files present in the local file system under
287
- `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`.
288
313
289
- # OPTIONS AND VARIABLES
314
+ # Compilation options and configuration
290
315
291
316
## Compiling with CUDD
292
317
0 commit comments