如何将多个Cython pyx文件合并到一个链接的库中? [英] How can I merge multiple Cython pyx files into a single linked library?

查看:212
本文介绍了如何将多个Cython pyx文件合并到一个链接的库中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有多个.pyx文件,是否可以将它们导入到一个pyx文件中,然后将该文件编译到共享库中,而不必编译15个独立的模块?

I have multiple .pyx files, is there a way to import them into a single pyx file and compile that file into a shared library, instead of having to compile 15 independent modules?

推荐答案

目前,看来唯一的方法是创建使用<$ c的主 .pyx 文件$ c> include 指令创建一个整体式.C文件。

At the moment, it seems the only way is to create a master .pyx file that uses include directives to create a monolithic .C file.

请参见将cython中的许多c ++类包装到单个共享库的项目结构

这篇关于如何将多个Cython pyx文件合并到一个链接的库中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆