|
82 | 82 | to generate IDE projects by supplying the `-G` flag. Run `cmake -G` for a
|
83 | 83 | comprehensive list of supported back-ends.
|
84 | 84 |
|
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 |
86 | 86 | "Compiling with alternative SAT solvers" in this document for configuration
|
87 | 87 | options). Should it be necessary to perform this step without network access,
|
88 | 88 | a solver can be downloaded ahead of the above `cmake` invocation as follows:
|
@@ -371,28 +371,40 @@ compilation flag:
|
371 | 371 | ## Compiling with alternative SAT solvers
|
372 | 372 |
|
373 | 373 | 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. |
376 | 376 |
|
377 | 377 | ### Compiling CBMC Using Solver Native Interfaces
|
378 | 378 |
|
379 | 379 | 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. |
381 | 381 |
|
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: |
389 | 384 | ```
|
390 | 385 | make -C src glucose-download
|
391 | 386 | make -C src GLUCOSE=../../glucose-syrup
|
392 | 387 | ```
|
| 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`. |
393 | 401 |
|
394 | 402 | 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 | +``` |
396 | 408 |
|
397 | 409 |
|
398 | 410 | ### Compiling with IPASIR Interface
|
@@ -520,7 +532,7 @@ successfully on Windows or macOS.
|
520 | 532 | This document assumes you have already been able to build CPROVER on
|
521 | 533 | your chosen architecture.
|
522 | 534 |
|
523 |
| -#RUNNING REGRESSION AND UNIT TESTS |
| 535 | +# RUNNING REGRESSION AND UNIT TESTS |
524 | 536 |
|
525 | 537 | Regression and unit tests can be run using cmake or make. Your choice here
|
526 | 538 | should be the same as the compiling of the project itself.
|
|
0 commit comments