compiling cython on windows

126 views
Skip to first unread message

Denis Akhiyarov

unread,
Apr 18, 2016, 10:53:27 PM4/18/16
to mingwpy
Hi mingwpy developers,

I have been following mingwpy project for quite a while now to supplement MSVC compilers when restricted on installations.

Is the information available on this wiki considered accurate for C/C++/Fortran code in CPython extensions?


If yes, then how does mingwpy project fit into this?

Towards the end of the wiki article a lot of pitfalls using GCC toolchains are mentioned. 

What does mingwpy have to add to this or even update this information?

Finally how are libpython & mingw packages from (Ana)conda differ with mingwpy?

Thanks,
Denis

Nathaniel Smith

unread,
Apr 18, 2016, 11:24:25 PM4/18/16
to mingwpy
On Mon, Apr 18, 2016 at 7:53 PM, Denis Akhiyarov
<denis.a...@gmail.com> wrote:
>
> Hi mingwpy developers,
>
> I have been following mingwpy project for quite a while now to supplement MSVC compilers when restricted on installations.
>
> Is the information available on this wiki considered accurate for C/C++/Fortran code in CPython extensions?
>
> https://github.com/cython/cython/wiki/CythonExtensionsOnWindows
>
> If yes, then how does mingwpy project fit into this?
>
> Towards the end of the wiki article a lot of pitfalls using GCC toolchains are mentioned.
>
> What does mingwpy have to add to this or even update this information?

Mingwpy is still in development, so there may be bugs and so forth.
But other than that, everything that wiki page says about mingw-w64
there is wrong/outdated/doesn't apply to mingwpy. Mingwpy compiled
code uses the MSVC C runtime, its C++ library uses the MSVC C runtime,
it can use the python27.lib that ships with Python (you don't need
libpython27.a), etc. If compiling a Python extension with mingwpy
doesn't produce an extension module that works with Windows Python,
then that's a bug in mingwpy.

(Unfortunately there do remain some incompatibilities between mingwpy
and MSVC, but these should not matter for ordinary Python extensions.
In particular you can't use MSVC to debug code compiled with mingwpy,
and you can't call C++ APIs between code compiled with MSVC and code
compiled with mingwpy. But Python's API is all C, not C++, so 99% of
the time this isn't a problem.)

> Finally how are libpython & mingw packages from (Ana)conda differ with mingwpy?

The libpython package in Anaconda is just part of Python, and
necessary for all Python C extensions. ...Is this different from their
python package? Surely on Windows python.exe itself requires
libpython?

I'm not sure what the mingw package in Anaconda is exactly -- maybe
TDM-GCC? -- but as far as I know it's not mingwpy and the comments on
the Cython wiki apply to it.

-n

--
Nathaniel J. Smith -- https://vorpus.org

carlkl

unread,
Apr 21, 2016, 2:29:55 PM4/21/16
to mingwpy
mingwpy and its predecessor mingw-static is part of the winpython portable distribution for more than one year and used without major problems.

Once mingwpy has updated and tested it makes sense to draw wider attention to the community.

Carl

Denis Akhiyarov

unread,
Apr 21, 2016, 11:48:00 PM4/21/16
to min...@googlegroups.com
In mingwpy is it possible to use cygdb to debug cython, and to use gdb to debug c-extensions, e.g. in winpython?

I plan to return to Nathaniel's questions later.
--
You received this message because you are subscribed to a topic in the Google Groups "mingwpy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mingwpy/DtPdX_V6U0w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mingwpy+u...@googlegroups.com.
To post to this group, send email to min...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mingwpy/971ed394-d17b-403b-9405-4ebb48b3e037%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

carlkl

unread,
Apr 22, 2016, 12:03:08 PM4/22/16
to mingwpy
I haven't used cygdb right now, so I can't give a helpful comment on that topic.

gdb isn't included in mingwpy at the moment, as gdb with pretty printing support needs to provide its own python version. I may add in future gdb without pretty printing support in mingwpy (size matters).

I know that gdb and insight can be installed via pacman in msys2. You can download another prebuild portable insight/gbd distro here:
If you experience problems|sucess with cygdb and prebuild gdb versions please tell.

Carl
To unsubscribe from this group and all its topics, send an email to mingwpy+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages