[Pyrex] Mingw usage so simple?

Phillip J. Eby pje at telecommunity.com
Wed Oct 6 23:32:34 CEST 2004


At 07:29 PM 10/6/04 +0000, John J Smith wrote:

>Various web pages indicated that a long dance involving
>dlltool and such utilities would be required.

That dance is primarily to set your system up to allow compiling *any* 
distutils-based C extension (assuming it's usable on Windows), without 
having to do any manual steps.


>However, this simple procedure seems to work for me:
>
>   gcc -mno-cygwin -O3 -c func.c -o func.o
>
>   pyrexc -o pyfunc.c pyfunc.pyx
>
>   gcc -mno-cygwin -Ic:/python23/include -O3 -c \
>       pyfunc.c -o pyfunc.o
>
>   gcc -mno-cygwin -O3 -shared func.o pyfunc.o \
>       c:/windows/system/python23.dll -o pyfunc.pyd
>
>Importing pyfunc and calling pyfunc.pf() from Python
>give the expected results.
>
>Is it supposed to be so straightforward?  Is this
>procedure reliable?  Will it work for more complex
>functions?  Will the resulting .pyd file work on other
>MS Windows versions?

Probably, to all of the above.  Of course, you have to perform those steps 
manually.  Doing the "full dance" allows the above to be done with a short 
'setup.py' file that doesn't need to know anything about the specific paths 
involved.





More information about the Pyrex mailing list