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

Ken Watford kwatford+scipy@gmail....
Fri Jul 2 12:00:53 CDT 2010

That's an excellent point.
I've noticed on my (Linux) workstation that pymex works fine, but
PyCUDA fails to import properly, because PyCUDA is a Boost::Python
project and expects a different libstdc++ than the one that MATLAB
jams into its LD_LIBRARY_PATH. (I got around this using an evil
LD_PRELOAD, but that's another story)

So yeah. Robin has been converting my C99isms C++-isms to get the
Visual Studio compiler to accept it - and in the process, I suppose,
adding a libstdc++ dependency that wasn't there to begin with that
MATLAB doesn't like.

Anyone know if there's a switch somewhere to get VS 2008 to accept
some semblance of C99 source? Otherwise you might need to convert
those bits into valid C89. I really need to convert this thing into
Cython some day.

On Fri, Jul 2, 2010 at 12:47 PM, David Cournapeau <cournape@gmail.com> wrote:
> 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).
> David
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion

More information about the NumPy-Discussion mailing list