Essentially it allows you to call python within octave / matlab.
The author only mentions how to get it working with matlab
(under Linux and Windows). Unfortunately getting it to run in Ubuntu
12.04 with Matlab 2012a ended up being a nightmare. I'm trying to see if
octave, being better integrated with distros can avoid the problems
that I had with Matlab.
The main problem I'm having with octave is that I need to
use mkoctfile to process the file py.cpp by adding the -Xlinker and
-export-dynamic flags to LDFLAGS.
This doesn't seem to work in octave at all. Mainly I have problems with Xlinker. I tried the following:
mkoctfile --mex -lpython2.7 -ldl "-Wl,-Xlinker,-export-dynamic" py.cpp
But I get this error:
/usr/bin/ld: cannot find -linker
collect2: error: ld returned 1 exit status
I also tried using the setenv command as:
setenv('LDFLAGS','-Wl -z relro -Xlinker -export-dynamic')
or
setenv('LDFLAGS','-Wl,-z,relro,-Xlinker,-export-dynamic')
and then
mkoctfile --mex -lpython2.7 -ldl py.cpp
But
neither of these really seem to work. The mkoctfile command works, but
then I can't do anything with python within octave because I get this
error:
ImportError: /usr/lib/pymodules/python2.7/numpy/core/multiarray.so: undefined symbol: PyExc_SystemError
Which is the one that is supposed to be fixed by passing Xlinker and export-dynamic to g++
Is that true? mkoctfile is completely unable to change LDFLAGS?
Thanks in advance
Andres Cimmarusti
PS: Please reply directly to my email, as I normally don't check the list so much