cross-compiling -- creating .pyd under linux

1,320 views
Skip to first unread message

Yoav Goldberg

unread,
Feb 14, 2011, 3:17:44 PM2/14/11
to cython...@googlegroups.com
Hi,
While not a cython question per-se, I do need it primarily for cython.

I have a few cython modules which I would like to use both on linux
and windows. I develop mainly under linux, compiling with gcc. I
would like to build the windows modules (.pyd) directly under linux,
if possible. In fact, it would be best if I could just issue one
script that will build the executables for both platforms (adding in
the possiblity for osx will be a welcome addition as well). Is that
possible in any way?

thanks,
Yoav

Robert Bradshaw

unread,
Feb 14, 2011, 3:37:43 PM2/14/11
to cython...@googlegroups.com

I have no idea--you're probably better off asking on the distutils
list. Perhaps you could do something with wine (I'd imagine you'd need
Win32 headers and libraries to link against at least)?

- Robert

Matthew Brett

unread,
Feb 14, 2011, 3:49:03 PM2/14/11
to cython...@googlegroups.com
Hi,

I've just built some cython windows binary distributions on OSX using wine:

http://matthew-brett.github.com/pydagogue/develop_mac.html#building-windows-release-files-with-wine

- stealing the idea from the Numpy instructions. I installed the
latest mingw into wine and built that way. I guess it will be
possible in linux too, I should check. If you get anywhere, will you
mail the list so we can follow your footsteps?

Thanks a lot,

Matthew

Yoav Goldberg

unread,
Feb 14, 2011, 4:10:34 PM2/14/11
to cython...@googlegroups.com
Thanks,
I will have a look at your suggestion, though I am not very
enthusiastic about wine.. was hoping gcc could do it natively with a
suitable back-end. I will ofcourse update if I make any progress.

Stefan Behnel

unread,
Feb 14, 2011, 4:15:21 PM2/14/11
to cython...@googlegroups.com
Yoav Goldberg, 14.02.2011 22:10:
> On Mon, Feb 14, 2011 at 10:49 PM, Matthew Brett wrote:
>> On Mon, Feb 14, 2011 at 12:37 PM, Robert Bradshaw wrote:

>>> On Mon, Feb 14, 2011 at 12:17 PM, Yoav Goldberg wrote:
>>>> While not a cython question per-se, I do need it primarily for cython.
>>>>
>>>> I have a few cython modules which I would like to use both on linux
>>>> and windows. I develop mainly under linux, compiling with gcc. I
>>>> would like to build the windows modules (.pyd) directly under linux,
>>>> if possible. In fact, it would be best if I could just issue one
>>>> script that will build the executables for both platforms (adding in
>>>> the possiblity for osx will be a welcome addition as well). Is that
>>>> possible in any way?
>>>
>>> I have no idea--you're probably better off asking on the distutils
>>> list. Perhaps you could do something with wine (I'd imagine you'd need
>>> Win32 headers and libraries to link against at least)?
>>
>> I've just built some cython windows binary distributions on OSX using wine:
>>
>> http://matthew-brett.github.com/pydagogue/develop_mac.html#building-windows-release-files-with-wine
>>
>> - stealing the idea from the Numpy instructions. I installed the
>> latest mingw into wine and built that way. I guess it will be
>> possible in linux too, I should check. If you get anywhere, will you
>> mail the list so we can follow your footsteps?
>
> I will have a look at your suggestion, though I am not very
> enthusiastic about wine.. was hoping gcc could do it natively with a
> suitable back-end. I will ofcourse update if I make any progress.

I bet you'll have it a lot easier with wine than trying to get all
dependencies (Python, header files, etc.) properly built and set up for
cross compilation.

Stefan

Matthew Brett

unread,
Feb 14, 2011, 4:19:38 PM2/14/11
to cython...@googlegroups.com
Hi,

Yes, I agree - I suspect it would be a huge amount of unhappy work to
get cross-compilation to work with the distutils build machinery.

Best,

Matthew

Reply all
Reply to author
Forward
0 new messages