Hi,
I'm trying to embed Python in a MATLAB mex file. I've been coming
under some pressure to make my Python code available to my MATLAB
colleagues so I am trying to come up with a relatively general way of
calling numerical python code from Matlab.
I am making some progress - but get a reliable
I forgot to add it doesn't happen if Py_Finalize isn't called - if I
take that out and just let the OS/matlab unload the mex function then
I can run it many times without the error, but it does leak a bit of
memory each time.
Cheers
Robin
On Fri, Nov 13, 2009 at 5:23 PM, Robin robi...@gmail.com
I'm trying to embed Python in a MATLAB mex file. I've been coming
under some pressure to make my Python code available to my MATLAB
colleagues so I am trying to come up with a relatively general way of
calling numerical python code from Matlab.
I get a similar but different error trying to do
On Nov 13, 2009, at 11:23 AM, Robin wrote:
Hi,
I'm trying to embed Python in a MATLAB mex file. I've been coming
under some pressure to make my Python code available to my MATLAB
colleagues so I am trying to come up with a relatively general way of
calling numerical python code from
On Fri, Nov 13, 2009 at 12:05, Travis Oliphant oliph...@enthought.com wrote:
On Nov 13, 2009, at 11:23 AM, Robin wrote:
Hi,
I'm trying to embed Python in a MATLAB mex file. I've been coming
under some pressure to make my Python code available to my MATLAB
colleagues so I am trying to come
On Fri, Nov 13, 2009 at 6:13 PM, Robert Kern robert.k...@gmail.com wrote:
On Fri, Nov 13, 2009 at 12:05, Travis Oliphant oliph...@enthought.com wrote:
I wonder if this is related to the fact that you can't unload a
dynamically linked module (like NumPy has). So, when you call
Py_Finalize you
Fri, 13 Nov 2009 17:23:19 +, Robin wrote:
I'm trying to embed Python in a MATLAB mex file. I've been coming under
some pressure to make my Python code available to my MATLAB colleagues
so I am trying to come up with a relatively general way of calling
numerical python code from Matlab.
On Fri, Nov 13, 2009 at 6:50 PM, Pauli Virtanen pav...@iki.fi wrote:
Fri, 13 Nov 2009 17:23:19 +, Robin wrote:
I'm trying to embed Python in a MATLAB mex file. I've been coming under
some pressure to make my Python code available to my MATLAB colleagues
so I am trying to come up with a
Fri, 13 Nov 2009 19:12:26 +, Robin wrote:
[clip]
How does the RTLD_GLOBAL thing manifest itself? So far I have only a
very basic start which basically consists of:
cmd = mxArrayToString(prhs[0]);
PyRun_SimpleString(cmd);
but I haven't noticed anything not working - I can run numpy
Robin skrev:
I had assumed when matlab unloads the mex function it would also
unload python - but it looks like other dynamic libs pulled in from
the mex function (in this case python and in turn numpy) aren't
unloaded...
Matlab MEX functions are DLLs, Python interpreter is a DLL, NumPy
Robin skrev:
So far the only remotely tricky thing I did was redirect sys.stdout
and sys.stderr to a wrapper that uses mexPrintf so output goes to the
matlab console.
Be careful when you are using file handles. You have to be sure that
Matlab, Python and NumPy are all linked against the
On Fri, Nov 13, 2009 at 7:48 PM, Sturla Molden stu...@molden.no wrote:
Robin skrev:
I had assumed when matlab unloads the mex function it would also
unload python - but it looks like other dynamic libs pulled in from
the mex function (in this case python and in turn numpy) aren't
unloaded...
Robin skrev:
Ah, I hadn't realised it was an OS constraint - I thought it was
possible to unload dlls - and that was why matlab provides the clear
function. mex automatically clears a function when you rebuild it - I
thought that was how you can rebuild and reload mex functions without
pe, 2009-11-13 kello 22:36 +0100, Sturla Molden kirjoitti:
[clip]
I was aware of this - I thought I would be OK on the mac - at least
Python and Numpy and my mex function are built with apple gcc although
I'm not sure about Matlab. I guess Windows will be more difficult...
But in any case
14 matches
Mail list logo