calling 64 bit routines from 32 bit matlab on Mac OS X

Philip Semanchuk philip at semanchuk.com
Tue Mar 15 15:54:40 EDT 2011


On Mar 15, 2011, at 11:58 AM, Danny Shevitz wrote:

> Howdy,
> 
> I have run into an issue that I am not sure how to deal with, and would
> appreciate any insight anyone could offer.
> 
> I am running on Mac OS X 10.5 and have a reasonably large tool chain including
> python, PyQt, Numpy... If I do a "which python", I get "Mach-O executable i386".
> 
> I need to call some commercial 3rd party C extension code that is 64 bit. Am I
> just out of luck or is there something that I can do?

Depends on how desperate you are. You could install 64-bit Python alongside the 32-bit version, call with the 64-bit C DLL from 64-bit Python using ctypes, and then communicate between the 32- and 64-bit Pythons via pickled objects sent over an interprocess pipe. 

That solution has a Rube Goldberg-esque charm but not much else to recommend it. I hope you can find something better.

Cheers
Philip


More information about the Python-list mailing list