跳转到主要内容

SuiteSparse:GraphBLAS Python绑定。

项目描述

python-suitesparse-graphblas

Version License Build Status Code style

Python CFFI 绑定,基于 SuiteSparse:GraphBLAS

这是一个仅公开低级别 CFFI API 绑定和符号的基础包。此包与语法绑定 pygraphblaspython-graphblas 共享。

从预构建轮安装

从 PyPI 和 conda 提供了常见平台的预构建轮。这些包含了 SuiteSparse:GraphBLAS 的编译副本。

pip install suitesparse-graphblas

conda install -c conda-forge python-suitesparse-graphblas

从源码安装

如果您希望链接到自己的 SuiteSparse:GraphBLAS 复制,可以从源码构建。

GraphBLAS_ROOT 环境变量中指定您的 SuiteSparse:GraphBLAS 安装位置,然后使用标准的 pip 从源码构建机制。此位置必须包含 include/GraphBLAS.hlib/

export GraphBLAS_ROOT="/path/to/graphblas"
pip install suitesparse-graphblas-*.tar.gz

您可能还需要适当地设置 LD_LIBRARY_PATH 以在运行时找到 libgraphblas

例如,在 macOS 上使用 Homebrew 的 SuiteSparse:GraphBLAS,从 PyPI 的 sdist,以及所有依赖项使用 wheels

GraphBLAS_ROOT="$(brew --prefix suitesparse)" pip install --no-binary suitesparse-graphblas suitesparse-graphblas

支持者