Reputation: 49
I am a newbie to cython, so pardon me if I am missing something obvious here. I am trying to build c extensions to be used in python for enhanced performance. I have fc.py module with a bunch of function and trying to generate a .dll through cython using dsutils and running on win64:
c:\python26\python c:\cythontest\setup.py build_ext --inplace
I have the dsutils.cfg in C:\Python26\Lib\distutils. As required the disutils.cfg has the following config settings:
[build]
compiler = mingw32
My startup.py looks like this:
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [Extension('fc', [r'C:\cythonTest\fc.pyx'])]
setup(
name = 'FC Extensions',
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules
)
This is what the command line outputs looks like :
C:\python26\python C:\cythontest\setup.py build_ext --inplace
running build_ext
cythoning C:\cythonTest\fc.pyx to C:\cythonTest\fc.c
building 'FC' extension
C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -Ic:\python26\include -Ic:\pytho
n26\PC -c C:\cythonTest\fc.c -o c:\cythontest\fc.o
I have latest version mingw for target/host amdwin64 type builds. I have the latest version of cython for python26 for win64. Cython does give me an fc.c without errors, only a few warning for type conversions, which I will handle once I have it right. Further it produces fc.def an fc.o files Instead of giving a .dll. I get no errors. I find on threads that it will create the .so or .dll automatically as required, which is not happening.
Upvotes: 1
Views: 1516
Reputation: 48330
Did you try to compile it with
python setup.py build --compiler=mingw32
?
Upvotes: 0
Reputation: 49
Finally, I was able to build extension for win64. Apparently, if you have VC 2010 express, you can tweak the disuilts to use msvc9compiler for compiling the module. The details can be found here. Many thanks to the guys at nukeitdotorg for putting up this, and also to J.F. Sebastian for his tips.
Upvotes: 1