Building Yices from Source¶
Use the matching Yices 2.8.0 source archive from https://yices.csl.sri.com and verify its release checksum. The development repository is also available on GitHub:
git clone https://github.com/SRI-CSL/yices2.git
A moving development branch is not the release archive. For release work, use the commit identified by the release’s source receipt.
Warning
Source make install can overwrite existing Yices files without
prompting. Unlike the binary installer, it has no collision protection.
Omitting --prefix selects /usr/local. Use a new, user-owned prefix
for each build variant, without sudo. Read the
Yices 2.8.0 installation errata before following the archive’s static or
manual dependency-install examples. Deliberate shared-prefix replacement
is a separate administrative action requiring backups, not this example.
Changing a protected system-owned prefix requires the appropriate authorized
privileges, which may mean administrator/root access. Do not elevate privileges
merely to bypass a collision or a failed fresh-prefix check.
Choose your workspace and prefix¶
Run these commands in a new Bash shell. Replace the first value with an existing directory that you own and trust; it need not be in your home directory. Use an absolute path without whitespace or a colon. These restrictions also apply after resolving directory symlinks. No elevated privileges are needed.
set -eu
YICES_WORK_PARENT="/absolute/path/you/own"
case "$YICES_WORK_PARENT" in
/*) ;;
*) printf '%s\n' 'Choose an absolute work-parent path.' >&2; exit 1 ;;
esac
test -d "$YICES_WORK_PARENT" && test -O "$YICES_WORK_PARENT"
YICES_WORK_PARENT=$(CDPATH= cd -- "$YICES_WORK_PARENT" && pwd -P)
case "$YICES_WORK_PARENT" in
*[[:space:]:]*) printf '%s\n' 'Work-parent path must have no whitespace or colon.' >&2; exit 1 ;;
esac
umask 077
YICES_WORK_ROOT=$(mktemp -d "$YICES_WORK_PARENT/yices-2.8.0.XXXXXXXX")
YICES_PREFIX="$YICES_WORK_ROOT/install"
test ! -e "$YICES_PREFIX" && test ! -L "$YICES_PREFIX"
export YICES_WORK_ROOT YICES_PREFIX
printf 'Fresh workspace: %s\nInstallation prefix: %s\n' "$YICES_WORK_ROOT" "$YICES_PREFIX"
Keep this shell open. Extract a fresh source tree for each build variant;
repeat the setup to allocate a different workspace for another variant.
Do not point YICES_PREFIX at an existing installation.
The examples below assume that setup has succeeded in the current shell.
Run this setup once, after the fresh-workspace block, before building any optional dependency or staging the static delegates. It deliberately refuses an existing staging directory. Reuse this newly created prefix only for the matching dependencies of this one build variant.
DELEGATE_PREFIX="$YICES_WORK_ROOT/delegates"
mkdir "$DELEGATE_PREFIX" "$DELEGATE_PREFIX/lib" "$DELEGATE_PREFIX/include" "$DELEGATE_PREFIX/bin"
export DELEGATE_PREFIX
You can choose between different compile-time features and optional components:
Support for the MCSAT solver (necessary for non-linear arithmetic).
Support for back-end Boolean SAT solvers (which can provide performance improvements on bit-vector problems).
Build a thread-safe version of the Yices library.
The following build instructions are written for Ubuntu but they should work with adjustments on other Unix variants. The 2.8.0 binary release covers Linux x86_64 and macOS x86_64/arm64, not Windows. Older Windows source-build instructions are not a promise of a tested 2.8.0 Windows distribution.
The sudo apt-get install commands below are explicitly system-managed
prerequisite installation. Review their proposed changes or ask an
administrator. They are not fresh-prefix source installation and do not
have the binary installer’s collision protection.
Common Dependencies¶
No matter which variant you want to build, you need a C compiler that
supports C99. Any reasonably recent version of GCC or Clang should
work. You will also need standard build tools such as GNU Make and sed.
You also need the GNU Multiple Precision library (GMP) and the gperf utility.
If you cloned the GitHub repository, you will also need autoconf.
Basic Build¶
The simplest type of build does not include MCSAT or third-party SAT solvers. Start by installing the dependencies:
sudo apt-get install libgmp-dev
sudo apt-get install gperf
Build from a source tarfile¶
If you downloaded the source tarfile from https://yices.csl.sri.com, you can configure and build Yices as follows:
./configure --prefix="$YICES_PREFIX"
make -j
make install
This installs into the fresh prefix’s bin, include and lib
directories. Use the installed executables’ full paths or deliberately add
that prefix’s bin directory to your PATH.
Build from a clone of our Git repository¶
If you got the source from our GitHub repository, the build process is almost
the same as from a tarfile. Make sure autoconf is installed:
sudo apt-get install autoconf
Then build Yices as follows:
autoconf
./configure --prefix="$YICES_PREFIX"
make -j
make install
Running the tests¶
Optionally, you can check that the build was fine by using
make -j check
This runs the regression tests. make check-api runs the API tests;
make test runs the unit tests. They are separate targets.
MCSAT Support¶
The MCSAT solver has two more dependencies:
The LibPoly library for manipulating polynomials.
The CUDD libray for Binary Decision Diagrams.
Install LibPoly¶
For this release, use the supplied
libpoly-c342ff1ad2f0-yices-release.tar.gz, verified against
RELEASE-INPUTS. Do not substitute an unpinned “latest” checkout.
The release relink kits’ REBUILDING.md and rebuild-gmp-libpoly.sh
describe rebuilding the supplied GMP/LibPoly sources into new prefixes.
Those files are in the matching relink kit, not this web page or the binary
archive. For a separate source build, use LibPoly’s own build instructions
with -DCMAKE_INSTALL_PREFIX="$DELEGATE_PREFIX" and position-independent
code, and run its tests. Keep matching headers and libraries together.
Install CUDD¶
Use the CUDD source version recorded in the release inputs when reproducing
the release; https://github.com/ivmai/cudd is its upstream repository.
CUDD must be built as Position-Independent Code (i.e., with option -fPIC) to be linked
with Yices.
Here is how you can build CUDD:
# In a fresh extraction of the selected CUDD source:
./configure --prefix="$DELEGATE_PREFIX" CFLAGS=-fPIC
make
make install
This installs CUDD headers and libraries in your dependency prefix.
Note
The CUDD Makefile was created with automake-1.14. Compilation may
fail if you have a different version of automake with a complaint
like WARNING ’automake-1.14’ is missing on your system. If this
happens to you, try this before you type make
aclocal
automake
Configure and Build Yices with MCSAT Support¶
Once you’ve installed LibPoly and CUDD, you can build Yices as follows:
./configure --prefix="$YICES_PREFIX" --enable-mcsat \
CPPFLAGS="-I$DELEGATE_PREFIX/include" LDFLAGS="-L$DELEGATE_PREFIX/lib"
make -j
make install
If LibPoly is installed in another private prefix, add its matching include
and library directories too. Shared dependencies also need to be visible
to your platform’s runtime loader; link-time -L alone does not configure
the runtime search path. Do not move or delete a prefix used by that build.
Third-Party SAT Solvers¶
Yices can use third-party SAT solvers as backends to the bit-vector solvers. Currently one internal and three third-party solvers are supported
Internal y2sat SAT solver (default solver)
Armin Biere’s CaDiCal
Mate Soos’ CryptoMiniSAT
Armin Biere’s Kissat (patched version)
You can also compile Yices with any of these SAT solvers.
Install CaDiCaL¶
CaDiCaL must be built with option -fPIC for a shared Yices library.
Use the version recorded in the release inputs and a fresh extraction.
In Bash, stage the matching outputs in the private dependency prefix:
# In the selected CaDiCaL source:
CXXFLAGS=-fPIC ./configure
make
make test
install build/libcadical.a "$DELEGATE_PREFIX/lib"
install build/cadical build/mobical "$DELEGATE_PREFIX/bin"
install -m644 src/ccadical.h "$DELEGATE_PREFIX/include"
Install CryptoMiniSAT¶
Yices requires a patched version of CryptoMiniSAT 5 that we provide at https://github.com/BrunoDutertre/cryptominisat. You may also need to install CryptoMiniSAT’s dependencies:
sudo apt-get install cmake zlib1g-dev libboost-program-options-dev
Then you can build and install CryptoMiniSAT as follows:
# In a fresh extraction of the patched source recorded in RELEASE-INPUTS:
mkdir build
cd build
cmake .. -DENABLE_PYTHON_INTERFACE=OFF \
-DCMAKE_INSTALL_PREFIX="$DELEGATE_PREFIX" -DCMAKE_INSTALL_LIBDIR=lib
make
make install
This installs CryptoMiniSAT into the private dependency prefix. Use the recorded patched source rather than a moving branch to reproduce the release.
There are more detailed build instructions in the CryptoMiniSAT README.
Install Kissat¶
We provide a patched version of Kissat that fixes an issue. Download this patched version at https://github.com/BrunoDutertre/kissat. The original is at https://github.com/arminbiere/kissat. To compile the code, follow these instructions:
# In a fresh extraction of the patched Kissat source recorded in RELEASE-INPUTS:
./configure -fPIC
make
install build/libkissat.a "$DELEGATE_PREFIX/lib"
install -m644 src/kissat.h "$DELEGATE_PREFIX/include"
Configure and Build Yices with Third-Party Solvers¶
To build Yices with support for all third-party solvers, use the following configure command in the top-level yices source directory:
./configure --prefix="$YICES_PREFIX" \
CPPFLAGS="-I$DELEGATE_PREFIX/include -DHAVE_CADICAL -DHAVE_CRYPTOMINISAT -DHAVE_KISSAT" \
LDFLAGS="-L$DELEGATE_PREFIX/lib" \
LIBS='-lcryptominisat5 -lcadical -lkissat -lstdc++ -lm'
This form is for non-static builds. If both CaDiCaL and Kissat are built as
shared libraries, their private Kitten symbols must be hidden or namespaced by
the delegate builds. Otherwise the dynamic linker may bind one solver to the
other’s incompatible embedded Kitten implementation. The Yices Makefile does
not verify this automatically, so raw dynamic targets with both delegates are
rejected by default. If you have validated that both shared libraries hide
these private Kitten symbols while still exporting their public APIs, add
--enable-dynamic-delegates-assuming-hidden-kitten to the configure command. This
option is an assertion about shared libraries; it does not fix raw static
archives.
Three-delegate static variant (CaDiCaL + CryptoMiniSat + Kissat).
This example intentionally differs from doc/COMPILING section 4a’s
two-delegate variant (CaDiCaL + Kissat). It additionally requires
matching static CryptoMiniSat inputs; the ordinary shared CryptoMiniSat
build above is not sufficient. Use the matching relink kit’s static
dependency inputs/instructions when reproducing the release configuration.
The two-delegate example does not need CryptoMiniSat, its define or its
linker option. See Yices 2.8.0 installation errata for the exact distinction.
For the three-delegate static Yices executable build, give
configure the directory that contains the raw static delegate archives and
headers:
./configure --prefix="$YICES_PREFIX" \
CPPFLAGS="-I$DELEGATE_PREFIX/include -DHAVE_CADICAL -DHAVE_CRYPTOMINISAT -DHAVE_KISSAT" \
LDFLAGS="-L$DELEGATE_PREFIX/lib" \
LIBS="-lcryptominisat5 -lcadical -lkissat -lstdc++ -lm" \
--with-static-delegates="$DELEGATE_PREFIX/lib" \
--with-static-delegates-include-dir="$DELEGATE_PREFIX/include"
make static-bin
make static-bin generates libkissat_yices.a under
$(BUILD)/static_deps and links the static executables against this
rewritten archive. The public Kissat API and kissat.h are unchanged. Do not
use -Wl,--allow-multiple-definition for this collision: it can silently bind
one solver to the other’s incompatible Kitten functions.
On macOS, set KISSAT_SOURCE_DIR before make to the configured Kissat
source tree that produced the raw libkissat.a. The rewrite script builds
the namespaced archive a second time from that source with a forced namespace
header. It deliberately refuses binary objcopy rewriting on Mach-O because
that can drop deployment metadata or damage relocations.
Do not use a bare make or make all for this all-delegate static release
configuration: those targets also build dynamic artifacts, and Yices rejects
raw dynamic CaDiCaL + Kissat builds by default.
For this static-only build, do not use make install. Follow the explicit
static_bin copy instructions in doc/COMPILING section 4a together
with Yices 2.8.0 installation errata, keeping the fresh prefixes above.
Skip both old fixed-/tmp assignments and the later /usr/local
reassignment. Do not substitute a shared prefix without a separate,
deliberate replacement decision and backups.
If you want only CaDiCaL:
./configure --prefix="$YICES_PREFIX" CPPFLAGS="-I$DELEGATE_PREFIX/include -DHAVE_CADICAL" \
LDFLAGS="-L$DELEGATE_PREFIX/lib" LIBS='-lcadical -lstdc++ -lm'
If you want only CryptoMiniSAT:
./configure --prefix="$YICES_PREFIX" CPPFLAGS="-I$DELEGATE_PREFIX/include -DHAVE_CRYPTOMINISAT" \
LDFLAGS="-L$DELEGATE_PREFIX/lib" LIBS='-lcryptominisat5 -lstdc++'
If you want only Kissat, use this command:
./configure --prefix="$YICES_PREFIX" CPPFLAGS="-I$DELEGATE_PREFIX/include -DHAVE_KISSAT" \
LDFLAGS="-L$DELEGATE_PREFIX/lib" LIBS='-lkissat -lm'
After a non-static configure command that does not use the raw unsafe CaDiCaL + Kissat combination, you can build Yices as usual:
make -j
make install
Note
These third-party solvers are compatible with MCSAT. So you can add
the flag --enable-mcsat to also include support for MCSAT.
Thread-Safe Yices Library¶
By default, the Yices library is not re-entrant and should not be used in multithreaded applications. If you need a thread-safe version of the library, configure and build Yices as follows:
./configure --prefix="$YICES_PREFIX" --enable-thread-safety
make -j
make install
When configured in this way, the Yices library allows multiple threads
to operate on separate contexts and models without causing race
conditions. This is useful to call yices_check_context on
different contexts in parallel. API functions that create terms and
types are automatically serialized by an internal locking mechanism.
Note
It is not safe for distinct threads to operate on the same context or model concurrently. It you want to do that, you have to implement your own locking mechanism.