草庐IT

cython_bbox

全部标签

python - 用 Cython 包装 C++ 库

我是Cython的新手,我正在尝试使用Cython来包装C/C++静态库。我做了一个简单的例子如下。Test.h:#ifndefTEST_H#defineTEST_Hintadd(inta,intb);intmultipy(inta,intb);#endifTest.cpp#include"test.h"intadd(inta,intb){returna+b;}intmultipy(inta,intb){returna*b;}然后我用g++编译构建它。g++-ctest.cpp-olibtest.oarrcslibtest.alibtest.o所以现在我得到了一个名为libtest.a

python - 用 Cython 包装 C++ 库

我是Cython的新手,我正在尝试使用Cython来包装C/C++静态库。我做了一个简单的例子如下。Test.h:#ifndefTEST_H#defineTEST_Hintadd(inta,intb);intmultipy(inta,intb);#endifTest.cpp#include"test.h"intadd(inta,intb){returna+b;}intmultipy(inta,intb){returna*b;}然后我用g++编译构建它。g++-ctest.cpp-olibtest.oarrcslibtest.alibtest.o所以现在我得到了一个名为libtest.a

python - 如何使用 gcc 从 Cython 编译 .c 代码

现在我已经在Windows7上成功安装了Cython,我尝试使用Cython编译一些Cython代码,但gcc让我的生活变得艰难。cdefvoidsay_hello(name):print"Hello%s"%name使用gcc编译代码会抛出几十个undefinedreferenceto-erros,我很确定libpython.a是可用的(正如安装教程所说,undefinedreferenceto-如果此文件丢失,则会引发错误)。$cythonctest.pyx$gccctest.c-I"C:\Python27\include"C:\Users\niklas\AppData\Local\

python - 如何使用 gcc 从 Cython 编译 .c 代码

现在我已经在Windows7上成功安装了Cython,我尝试使用Cython编译一些Cython代码,但gcc让我的生活变得艰难。cdefvoidsay_hello(name):print"Hello%s"%name使用gcc编译代码会抛出几十个undefinedreferenceto-erros,我很确定libpython.a是可用的(正如安装教程所说,undefinedreferenceto-如果此文件丢失,则会引发错误)。$cythonctest.pyx$gccctest.c-I"C:\Python27\include"C:\Users\niklas\AppData\Local\

python - Fortran - Cython 工作流程

我想设置一个工作流,以便在Windows机器上使用Cython从Python访问fortran例程经过一番搜索,我发现:http://www.fortran90.org/src/best-practices.html#interfacing-with-c和https://stackoverflow.com/tags/fortran-iso-c-binding/info还有一些代码图片:Fortran端:pygfunc.h:voidc_gfunc(doublex,intn,intm,double*a,double*b,double*c);pygfunc.f90modulegfunc1_i

python - Fortran - Cython 工作流程

我想设置一个工作流,以便在Windows机器上使用Cython从Python访问fortran例程经过一番搜索,我发现:http://www.fortran90.org/src/best-practices.html#interfacing-with-c和https://stackoverflow.com/tags/fortran-iso-c-binding/info还有一些代码图片:Fortran端:pygfunc.h:voidc_gfunc(doublex,intn,intm,double*a,double*b,double*c);pygfunc.f90modulegfunc1_i

python - Cython 中是否有任何类型的函数?

有没有办法告诉Cython编译器param是函数。类似的东西cpdeffloatcalc_class_re(listdata,funccallback) 最佳答案 应该是不言自明的......?:)#Defineanewtypeforafunction-typethatacceptsanintegerand#astring,returninganinteger.ctypedefint(*f_type)(int,str)#Externafunctionofthattypefromfoo.hcdefexternfrom"foo.h":i

python - Cython 中是否有任何类型的函数?

有没有办法告诉Cython编译器param是函数。类似的东西cpdeffloatcalc_class_re(listdata,funccallback) 最佳答案 应该是不言自明的......?:)#Defineanewtypeforafunction-typethatacceptsanintegerand#astring,returninganinteger.ctypedefint(*f_type)(int,str)#Externafunctionofthattypefromfoo.hcdefexternfrom"foo.h":i

python - Noob-Ready Cython 教程

已结束。此问题不符合StackOverflowguidelines.它目前不接受答案。要求我们推荐或查找工具、库或最喜欢的非现场资源的问题对于StackOverflow来说是无关紧要的,因为它们往往会吸引固执己见的答案和垃圾邮件。相反,describetheproblem以及到目前为止为解决这个问题所做的工作。关闭9年前。Improvethisquestion我知道一堆脚本语言(python、ruby、lua、php),但我不知道任何编译语言,如C/C++,我想尝试使用cython加速一些python代码,这本质上是一个python->C编译器,旨在为python创建C扩展。基本上,您

python - Noob-Ready Cython 教程

已结束。此问题不符合StackOverflowguidelines.它目前不接受答案。要求我们推荐或查找工具、库或最喜欢的非现场资源的问题对于StackOverflow来说是无关紧要的,因为它们往往会吸引固执己见的答案和垃圾邮件。相反,describetheproblem以及到目前为止为解决这个问题所做的工作。关闭9年前。Improvethisquestion我知道一堆脚本语言(python、ruby、lua、php),但我不知道任何编译语言,如C/C++,我想尝试使用cython加速一些python代码,这本质上是一个python->C编译器,旨在为python创建C扩展。基本上,您