根据 Boost 创建 Python 包

问题描述

我想分发一个依赖于 Boost Python 的 Python 包,但我不确定如何配置设置。

在当前状态下,setup 需要手动设置Boost .so 的路径,然后才能运行setup 脚本(旁边注释了Ubuntu 上的Python3.7 示例)

module = setuptools.Extension(
    # ... 
    include_dirs=['path/to/python/version'],# /usr/include/python3.7/
    libraries=['boost-so-filename'],# boost_python-py37
    library_dirs=['directory/containing/boost/so/'],# /usr/lib/x86_64-linux-gnu/
    # ...
)

setup(
    # ...,ext_modules=[module]
    # ...,)

如何配置设置以支持任何 Python 版本 >=3.7,知道 Boost 在哪里,并链接到其 Python 版本的相应 Boost 版本?

Python packaging: Boost library as dependency 建议使用二进制轮,但我认为这不一定适用于支持多个版本,无论哪种方式我都不完全确定如何处理它

How to package shared objects that python modules depend on? 中的评论提到了有关使用构建脚本处理此问题的内容,但并未详细说明。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)