mlc-z3-static
Native Z3 development artifacts (headers, a static library, and CMake
metadata) packaged as Python wheels for build systems. It does not provide Z3
Python bindings. The pinned Z3 release is recorded in
version.py and exposed at runtime as
mlc_z3_static.Z3_VERSION, mlc_z3_static.Z3_TAG, and
mlc_z3_static.Z3_COMMIT.
The wheel contains:
- Z3 C and C++ headers.
- A position-independent static
libz3(libz3.aon Unix-like platforms,.libon Windows). - Relocatable CMake and pkg-config metadata under
mlc_z3_static/static/lib/cmake/z3andmlc_z3_static/static/lib/pkgconfig.
Prebuilt wheels are published to PyPI for common platforms; elsewhere pip builds from the sdist (see Build from source).
Usage
python -m pip install mlc-z3-static
Build systems can locate the packaged artifacts from Python:
import mlc_z3_static
print(mlc_z3_static.get_cmake_dir("static"))
print(mlc_z3_static.get_cmake_prefix_path())
print(mlc_z3_static.get_static_library_path())
Or from a build script through the configuration CLI:
python -m mlc_z3_static.config --cmake-dir
python -m mlc_z3_static.config --prefix
CMake
Install the wheel into the Python environment used by the downstream build, then point CMake at the packaged static Z3 and use Z3's exported target:
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DZ3_DIR="$(python -m mlc_z3_static.config --cmake-dir)"
cmake_minimum_required(VERSION 3.20)
project(my_z3_consumer LANGUAGES C CXX)
find_package(Z3 CONFIG REQUIRED)
add_executable(my_z3_consumer main.cpp)
target_link_libraries(my_z3_consumer PRIVATE z3::libz3)
target_compile_features(my_z3_consumer PRIVATE cxx_std_20)
Or resolve the directory from inside CMake:
find_package(Python3 COMPONENTS Interpreter REQUIRED)
execute_process(
COMMAND "${Python3_EXECUTABLE}" -m mlc_z3_static.config --cmake-dir
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE Z3_DIR
)
find_package(Z3 CONFIG REQUIRED)
Z3 is implemented in C++, so even C-only consumers should enable CXX in the
CMake project and let CMake link through a C++ linker when using the static
archive. No shared Z3 library or DLL is bundled. See
example_project/ for a complete uv-managed consumer.
Build from source
The package is built with scikit-build-core: building a wheel runs
scripts/prepare_z3.py, which downloads the pinned Z3 source archive, verifies
its SHA-256 digest, and builds the static library.
This needs a C++20 compiler with <format> support (Z3 5.x requires it; e.g.
GCC >= 13, Clang >= 17, Visual Studio 2022), Python, and network access to
download the source archive. CMake (>= 3.26) and Ninja are pulled in as build
requirements. A static Z3 build takes a while; set CMAKE_BUILD_PARALLEL_LEVEL
to use more cores:
CMAKE_BUILD_PARALLEL_LEVEL=8 python -m pip install --no-binary mlc-z3-static mlc-z3-static
Build a wheel from a checkout:
python -m build --wheel
Use an existing Z3 checkout instead of downloading the pinned archive:
MLC_Z3_STATIC_SOURCE_DIR=/path/to/z3 python -m build --wheel
Release wheels
The Publish mlc-z3-static wheels workflow
(mlc_z3_static_wheel.yml)
builds py3-none wheels for manylinux_2_28
(x86_64, aarch64), macOS (arm64, x86_64), and Windows (AMD64,
ARM64). On Windows the inner Z3 build uses the same Visual Studio platform
(-A x64 or -A ARM64) as the wheel being built. GNU and Clang builds on
non-Apple platforms use -ffunction-sections -fdata-sections; MSVC builds use
/Gy /Gw to package functions and global data in individual COMDATs, together
with /Zc:inline to omit unused inline COMDATs. Mach-O already provides
function/data granularity for dead stripping. These settings preserve the
static linking interface and let consumers discard unused code and data when
they enable linker garbage collection, such as --gc-sections, /OPT:REF, or
-dead_strip on the corresponding platform. The package does not impose
consumer link options, and section granularity can increase archive size even
when it reduces the linked binary. See the
root README for when it runs and how to
publish.
To build release wheels locally, from this directory:
scripts/wheel_manylinux_2_28.sh
scripts/wheel_macos.sh
scripts\wheel_windows.ps1
The scripts use uv for host-side Python tooling, so Debian/Ubuntu system
Python restrictions such as PEP 668 and missing ensurepip do not affect the
host CIBW runner. They run cibuildwheel==3.3.1, which tests each wheel in a
clean virtual environment with the pytest suite (see Tests). The
manylinux script retags Linux wheels as manylinux_2_28. Wheels are written
to wheelhouse/.
The manylinux script defaults to the host architecture. Set
MLC_Z3_STATIC_ARCH=x86_64 or MLC_Z3_STATIC_ARCH=aarch64 to choose explicitly.
On macOS, local CIBW builds require an official python.org CPython installation.
The script defaults to the newest installed python.org CPython only as the build
interpreter. The output wheel is still Python-agnostic and tagged
py3-none-<platform>. Override CIBW_BUILD to force a specific installed build
interpreter, for example CIBW_BUILD=cp313-macosx_arm64.
Tests
The pytest suite under tests/python/ exercises the installed package. It
checks the version metadata, artifact paths, and the config CLI, and builds,
links, and runs a small CMake consumer against z3::libz3, checking that it
does not link a dynamic libz3 (this needs a C++ compiler). From this
directory:
python -m pip install ".[test]" # or: python -m pip install <wheel> pytest
pytest
Run pytest against an installed wheel; the tests import the installed
package, not python/. cibuildwheel runs the same suite on every built wheel.
License
This package is distributed under the MIT License, the license of the Z3
artifacts it bundles. LICENSE is a verbatim copy of Z3's upstream
LICENSE.txt, so this directory and its sdist are self-contained. The wheel
also carries the license copied during packaging from the SHA-256-verified
upstream source archive as mlc_z3_static/licenses/LICENSE-Z3.txt; the build
fails if that file is missing.
Bumping the version
version.py is the single version source. To move to a new Z3
release, edit only that file:
-
Z3_VERSION: the upstream release (the Git tag is derived asz3-<Z3_VERSION>). -
__version__: the Python package version; it must equalZ3_VERSION, orZ3_VERSIONplus a PEP 440 suffix such as.post1. -
Z3_COMMIT: the commit the release tag points to:gh api repos/Z3Prover/z3/commits/z3-<Z3_VERSION> --jq .sha
-
Z3_ARCHIVE_SHA256: the SHA-256 of the archivescripts/prepare_z3.pydownloads:curl -fsSL https://github.com/Z3Prover/z3/archive/<Z3_COMMIT>.tar.gz | sha256sum
Package metadata, the build scripts, the default build directory, and the
generated runtime module mlc_z3_static/_version.py all read these values.
The publishing workflow's version_suffix input runs
scripts/stamp_version.py --suffix <suffix>, which rewrites __version__ in
the build checkout and rejects versions not based on Z3_VERSION.
Metadata
Release files for mlc-z3-static 5.3.1.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mlc_z3_static-5.3.1.post1.tar.gz | 20.4 kB | With provenance | Details for mlc_z3_static-5.3.1.post1.tar.gz |
Built distributions (wheels)
Total release size: 247.8 MB
Release files / mlc_z3_static-5.3.1.post1.tar.gz
| Download URL | mlc_z3_static-5.3.1.post1.tar.gz |
|---|---|
| Size | 20.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95ae6b3641cf79d755bc2239506b101ac8d38feb07ed6c38b3d35bee2a965ed1
|
|
BLAKE2b-256 checksum How to use checksums |
f5bf03613b0a97802831db5e1addc01483a1838c950ba535c605798d61775ba8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logRelease files / mlc_z3_static-5.3.1.post1-py3-none-win_arm64.whl
| Download URL | mlc_z3_static-5.3.1.post1-py3-none-win_arm64.whl |
|---|---|
| Size | 65.0 MB |
| Tags | Python 3 Windows ARM64 |
|
SHA-256 checksum How to use checksums |
cdaecef13649cd07e66c625c502399e32572e20d8703098404d73829b328b64b
|
|
BLAKE2b-256 checksum How to use checksums |
20b5dfd913c84dcf32c4bd2c8e680edd9f734da68c2884c0fbc66957ce4d9082
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logRelease files / mlc_z3_static-5.3.1.post1-py3-none-win_amd64.whl
| Download URL | mlc_z3_static-5.3.1.post1-py3-none-win_amd64.whl |
|---|---|
| Size | 58.5 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
d5ec831ff8d4315fa0efb449aec039f4a258590eed8bdcd45ae6a30541247194
|
|
BLAKE2b-256 checksum How to use checksums |
946394903fbed070bf65dc1c3d31d78a97c6436dfbc823bb6b3f0cf5d1940600
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logRelease files / mlc_z3_static-5.3.1.post1-py3-none-manylinux_2_28_x86_64.whl
| Download URL | mlc_z3_static-5.3.1.post1-py3-none-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 34.7 MB |
| Tags | Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
8f941c765adcecc1ba725e5164bee5e66b45adfa39d154806a3a13a6e61420c0
|
|
BLAKE2b-256 checksum How to use checksums |
b06fd7f5639fd703f5447f281a863368fad90d3064db1ffcfffe9b664e59b8c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logRelease files / mlc_z3_static-5.3.1.post1-py3-none-manylinux_2_28_aarch64.whl
| Download URL | mlc_z3_static-5.3.1.post1-py3-none-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 34.1 MB |
| Tags | Linux glibc 2.28+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
e4f5f4ed51eca8078bdbe3ed3825a3b4b6942d5c8117dcfbc7899e35d5954e26
|
|
BLAKE2b-256 checksum How to use checksums |
0fce384eee0b137e0e2e39822a7a1608a8dad1cedac53ceb9cd6a77d9b11b982
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logRelease files / mlc_z3_static-5.3.1.post1-py3-none-macosx_11_0_arm64.whl
| Download URL | mlc_z3_static-5.3.1.post1-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 28.6 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
54ecc28ceb50102726294948b5479cb14bafc3bb6bd6b8e8484c5536362cf85c
|
|
BLAKE2b-256 checksum How to use checksums |
62809ae043ba341985d70975d0c55241086d906880c90a2d6aca543238cc1567
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logRelease files / mlc_z3_static-5.3.1.post1-py3-none-macosx_10_9_x86_64.whl
| Download URL | mlc_z3_static-5.3.1.post1-py3-none-macosx_10_9_x86_64.whl |
|---|---|
| Size | 27.0 MB |
| Tags | Python 3 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
40e393819694c2431a487cab5e7d710fdba0fb6b028abb6db83c3c5044e93849
|
|
BLAKE2b-256 checksum How to use checksums |
0f12105b8e60420a068d44d7d0d403cc7d5af52e8f30e5be20cc5f127bccb774
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logSecurity for mlc-z3-static 5.3.1.post1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 7 files in this release have been uploaded with provenance metadata.
Attestation for mlc_z3_static-5.3.1.post1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.