Archspec is a Python library designed to provide a standard set of human-understandable labels for system architectures, primarily focusing on CPU microarchitectures. It offers APIs to detect, query, and compare different CPU types. The project originated from Spack and is under active development. The current version is 0.2.5. While it does not follow a strict release cadence, its update history, including a significant release in October 2024, indicates ongoing maintenance and development.
pip install archspecVerified import paths — ran on the pinned version, not inferred.
This quickstart code snippet demonstrates how to detect the host CPU microarchitecture using `archspec.cpu.detect.host()` and print its name. It also includes basic error handling for unsupported architectures.
Update references to Graviton microarchitectures to use the new naming scheme (e.g., 'cortex_a72' instead of 'graviton').
Ensure your environment uses Python 3.6 or newer.
For development, install Poetry (e.g., `curl -sSL https://install.python-poetry.org | python3 -`) then clone the repository and run `poetry install`. For general use, `pip install archspec` is sufficient.
This often occurs on newer or less common architectures. Check the `archspec.cpu.detect.why_not()` function for a more detailed reason. You might need to update Archspec to a newer version or contribute your architecture's data.
Ensure that compiler versions are provided as dot-separated digits (e.g., '10.0.0' for GCC 10.0.0).
No dependency data recorded yet.