Prerequisites
Before building MiniSat, ensure you have the following installed:- C++ compiler with C++11 support (GCC 4.8+, Clang 3.4+, or MSVC 2015+)
- GNU Make or CMake (version 2.6 or higher)
- zlib development library
Building with Make
MiniSat uses a flexible Makefile-based build system with multiple configuration options.Quick installation
The simplest approach uses GNU standard locations with a prefix:Build targets
MiniSat provides multiple build configurations:- Release builds
- Debug builds
- Profile builds
- Dynamic builds
-O3 -DNDEBUG flags.The default
make all target builds the release binary, static library, and shared library.Configuration options
Customize the build by modifying these variables:| Variable | Default | Description |
|---|---|---|
BUILD_DIR | build | Directory for object files and binaries |
MINISAT_REL | -O3 -DNDEBUG | Release build flags |
MINISAT_DEB | -O0 -DDEBUG | Debug build flags |
MINISAT_RELSYM | -g | Include debug symbols in release |
prefix | /usr/local | Installation root directory |
includedir | $(prefix)/include | Header installation directory |
bindir | $(prefix)/bin | Binary installation directory |
libdir | $(prefix)/lib | Library installation directory |
The configuration is stored in
config.mk. To reset to defaults, run:Installing specific components
You can install individual components:Building with CMake
CMake provides a cross-platform alternative to Make:CMake options
| Option | Default | Description |
|---|---|---|
CMAKE_BUILD_TYPE | Release | Build type: Release, Debug, RelWithDebInfo |
STATIC_BINARIES | ON | Link binaries statically |
USE_SORELEASE | ON | Use SORELEASE in shared library filename |
CMAKE_INSTALL_PREFIX | /usr/local | Installation prefix |
Build artifacts
After building, you’ll find:Executables
-
minisatorminisat_simp: Full solver with preprocessing- Location (Make):
build/release/bin/minisat - Location (CMake):
build/minisat_simp
- Location (Make):
-
minisat_core: Core solver without simplification- Location (Make):
build/release/bin/minisat_core - Location (CMake):
build/minisat_core
- Location (Make):
Libraries
-
Static library:
libminisat.a- Location (Make):
build/release/lib/libminisat.a - Location (CMake):
build/libminisat.a
- Location (Make):
-
Shared library:
libminisat.so.2.1.0(Linux) orlibminisat.dylib(macOS)- Location (Make):
build/dynamic/lib/ - Location (CMake):
build/
- Location (Make):
Headers
Installed to$(includedir)/minisat/ with the following structure:
Verifying the installation
Test your installation:Cleaning build files
- Make
- CMake
Troubleshooting
zlib not found
zlib not found
Install the zlib development package:
Compiler not found
Compiler not found
Install a C++ compiler:
Permission denied during install
Permission denied during install
Use
sudo for system-wide installation or choose a user-writable prefix:Library not found when running minisat
Library not found when running minisat
Update your library path:Or add to
/etc/ld.so.conf.d/ and run sudo ldconfig.Next steps
Quick start guide
Learn how to use MiniSat to solve SAT problems in C++