[Numpy-discussion] OT: request help building pymex win64

David Cournapeau cournape@gmail....
Fri Jul 2 11:47:50 CDT 2010

On Sat, Jul 3, 2010 at 1:37 AM, Robin <robince@gmail.com> wrote:
> Hi,
> Sorry for the offtopic post but I wondered if any Windows experts who
> are familiar with topics like linking python on windows and visual
> studio runtimes etc. might be able to help.
> I'm on a bit of a mission to get pymex built for 64 bit windows. Pymex
> ( http://github.com/kw/pymex ) is a matlab package that embeds the
> Python interpreter in a mex file and provides a very elegant interface
> for manipulating python objects from matlab, as well as converting
> between data times when necessary. It builds easily on mac, linux and
> win32 with mingw, but I really need it also for 64 bit windows. (It
> works very well with numpy as well so not completely OT).
> I have looked at trying to get a 64bit mingw  working to build mex
> files, but that seemed quite difficult, so instead I am trying to
> build with VS 2008 Express Edition + Windows 7 SDK (for 64 bit
> support). As far as I can tell this is installed OK as I can build the
> example mex64 files OK.
> I have made some modifications to pymex to get it to build under vs
> 2008 ( http://github.com/robince/pymex/tree/win64 ).
> And I can get it to build and link (I believe using the implicit dll
> method of linking against C:\Python26\libs\python26.lib of the amd64
> python.org python) without errors, but when I run it seems to
> segfaults whenever a pointer is passed between the mex side and
> python26.dll.
> I asked this stackoverflow question which has some more details (build log)
> http://stackoverflow.com/questions/3167134/trying-to-embed-python-into-matlab-mex-win64
> Anyway I'm completely in the dark but wondered if some of the experts
> on here would be able to spot something (perhaps to do with
> incompatible C runtimes - I am not sure what runtime Python is built
> with but I thought it was VS 2008).

The problem may be that matlab is built with one runtime, and Python
with another.... Unless your matlab is very recent, it is actually
quite likely to be compiled with VS 2005, which means you should use
python 2.5 instead (or built python2.6 with VS 2005, but I am not sure
it is even possible without herculean efforts).


More information about the NumPy-Discussion mailing list