### Add z3 Crate to Project Source: https://github.com/prove-rs/z3.rs/blob/master/z3/README.md Installs the z3 Rust crate into your project using Cargo, the Rust package manager. This is the primary step to include the Z3 bindings in your Rust application. ```bash cargo add z3 ``` -------------------------------- ### Add z3-sys to Cargo Project Source: https://github.com/prove-rs/z3.rs/blob/master/z3-sys/README.md Installs the z3-sys crate into your Rust project using Cargo. This is the standard method for adding dependencies. ```bash cargo add z3-sys ``` -------------------------------- ### Z3 Library and Header Configuration Source: https://github.com/prove-rs/z3.rs/blob/master/z3-sys/README.md Details on how the z3-sys crate finds the Z3 SMT solver libraries and header files during the build process. It supports multiple methods including system installation, bundled builds, vcpkg, and GitHub releases, with options for environment variable overrides. ```APIDOC Z3 Library Discovery: - System Default: Looks for a system-installed Z3 (e.g., via package manager or Homebrew). - `bundled` feature: Uses `cmake` to build a local copy of Z3 from a git submodule. - `vcpkg` feature: Uses `vcpkg` to build and install Z3. - `gh-release` feature: Downloads a pre-compiled Z3 from GitHub releases. - `Z3_SYS_Z3_VERSION` environment variable: Specifies the Z3 version for `gh-release`. - `READ_ONLY_GITHUB_TOKEN` environment variable: Provides a GitHub token to mitigate rate limiting for `gh-release` downloads. Z3 Header (`z3.h`) Discovery: - System Default: Looks for `z3.h` in standard system include paths. - `bundled` feature: Uses the bundled copy of `z3.h`. - `vcpkg` or `gh-release` features: Uses the `z3.h` provided by the respective installation method. - `Z3_SYS_Z3_HEADER` environment variable: Customizes the path to `z3.h` (except when `vcpkg` or `gh-release` features are used, which manage their own header paths). ``` -------------------------------- ### Set Z3 Header Path for macOS Homebrew Source: https://github.com/prove-rs/z3.rs/blob/master/z3/README.md Sets the Z3_SYS_Z3_HEADER environment variable to point to the Z3 header file. This is often required on macOS when Z3 is installed via Homebrew and Cargo cannot automatically locate the headers. ```bash Z3_SYS_Z3_HEADER=/opt/homebrew/include/z3.h cargo build ``` -------------------------------- ### Configure z3 Crate Features Source: https://github.com/prove-rs/z3.rs/blob/master/z3/README.md Specifies feature flags for the z3 crate in your Cargo.toml file. Features like 'gh-release' or 'vcpkg' control how the Z3 library is found, bundled, or linked during the build process. ```toml [dependencies] z3 = {version="0", features = ["gh-release"]} ``` ```toml [dependencies] z3 = {version="0", features = ["vcpkg"]} ``` -------------------------------- ### Configure Cargo for Z3 Library Path Source: https://github.com/prove-rs/z3.rs/blob/master/z3/README.md Configures Cargo to use specific environment variables for finding Z3 libraries and headers. This is typically done in a project's .cargo/config.toml file to manage build-time dependencies, especially for system-installed libraries like Z3 on macOS. ```toml [env] LIBRARY_PATH = "/opt/homebrew/lib" Z3_SYS_Z3_HEADER = "/opt/homebrew/include/z3.h" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.