Skip to content

Commit 4b17867

Browse files
committed
Update installation instructions to include how to build CBMC with multiple backend solvers
1 parent d070932 commit 4b17867

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

COMPILING.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ files.
8282
to generate IDE projects by supplying the `-G` flag. Run `cmake -G` for a
8383
comprehensive list of supported back-ends.
8484
85-
As part of this step, CMake will download the back-end solver (see Section
85+
As part of this step, CMake will download the back-end solvers (see Section
8686
"Compiling with alternative SAT solvers" in this document for configuration
8787
options). Should it be necessary to perform this step without network access,
8888
a solver can be downloaded ahead of the above `cmake` invocation as follows:
@@ -371,28 +371,40 @@ compilation flag:
371371
## Compiling with alternative SAT solvers
372372
373373
For the packaged builds of CBMC on our release page we currently build CBMC
374-
with the MiniSat2 SAT solver statically linked at compile time. However it is
375-
also possible to build CBMC using alternative SAT solvers.
374+
with the MiniSat2 and CaDiCaL SAT solvers statically linked at compile time.
375+
However it is also possible to build CBMC using alternative SAT solvers.
376376
377377
### Compiling CBMC Using Solver Native Interfaces
378378
379379
The following solvers are supported by CBMC using custom interfaces and can
380-
by downloaded and compiled by the build process: MiniSAT2, CaDiCaL, and Glucose.
380+
be downloaded and compiled by the build process: MiniSAT2, CaDiCaL, and Glucose.
381381
382-
For `make` alternatives to the default (i.e. not MiniSAT) can be built with the
383-
following commands for CaDiCaL:
384-
```
385-
make -C src cadical-download
386-
make -C src CADICAL=../../cadical
387-
```
388-
and for glucose
382+
For `make`, alternatives to the default (i.e. not MiniSAT and CaDiCaL) can be
383+
built with the following commands for glucose:
389384
```
390385
make -C src glucose-download
391386
make -C src GLUCOSE=../../glucose-syrup
392387
```
388+
CBMC can be built with multiple solvers, which can then be selected at runtime
389+
using the `--sat-solver` option.
390+
For example, to build CBMC with MiniSAT2 and Glucose, do:
391+
```
392+
make -C src minisat2-download glucose-download
393+
make -C src MINISAT2=../../minisat-2.2.1 GLUCOSE=../../glucose-syrup
394+
```
395+
The build sets the default solver based on the priority defined by the
396+
`#if/#elif` tree defined at the end of
397+
[`src/solvers/sat/satcheck.h`](https://github.com/diffblue/cbmc/blob/develop/src/solvers/sat/satcheck.h).
398+
In the above example, MiniSAT2 will be set as the default solver because it is
399+
listed before Glucose. To switch to glucose at runtime, run CBMC with
400+
`--sat-solver glucose`.
393401
394402
For CMake the alternatives can be built with the following arguments to `cmake`
395-
for CaDiCaL `-Dsat_impl=cadical` and for glucose `-Dsat_impl=glucose`.
403+
for glucose `-Dsat_impl=glucose`.
404+
To build CBMC with multiple solvers, specify the solvers in a semicolon-separated list to `-Dsat_impl`, e.g.:
405+
```
406+
cmake -S . -Bbuild -Dsat_impl="minisat2;glucose"
407+
```
396408
397409
398410
### Compiling with IPASIR Interface
@@ -520,7 +532,7 @@ successfully on Windows or macOS.
520532
This document assumes you have already been able to build CPROVER on
521533
your chosen architecture.
522534

523-
#RUNNING REGRESSION AND UNIT TESTS
535+
# RUNNING REGRESSION AND UNIT TESTS
524536

525537
Regression and unit tests can be run using cmake or make. Your choice here
526538
should be the same as the compiling of the project itself.

0 commit comments

Comments
 (0)