Running octave scrips from julia

604 views
Skip to first unread message

astromono

unread,
Feb 6, 2015, 2:03:23 PM2/6/15
to julia...@googlegroups.com


Hi all,
         I am getting to julia in recent months. I have hundreds (thousands, perhaps) of functions and scrips in octave (many years working with matlab/octave). I'm linux user (LMDE).
The fact is that from
python I use oct2py module to run octave functions with reasonably good results.
But in julia, using PyCall, this fails.
To begin "@pyimport oct2py.octave as oc" leaves locked the command until you cancel it:

julia>pyimport oct2py.octave as oc


^ CERROR: function is not yet c-callable
  in pyinitialize at /home/rober/.julia/v0.4/PyCall/src/pyinit.jl:245
  in pyinitialize at /home/rober/.julia/v0.4/PyCall/src/pyinit.jl:305
  in pyimport at /home/rober/.julia/v0.4/PyCall/src/PyCall.jl:111

Is there any way to run
octave commands and functions from julia?

thank you in advance

Hugs,
Rober

Viral Shah

unread,
Feb 6, 2015, 2:29:19 PM2/6/15
to julia...@googlegroups.com
I really think that for something like this to work reliably, we probably want a way to call octave directly from Julia, but that requires some effort. Sorry - I don't have anything useful to add for the PyCall route. I guess that even though convoluted, it would be nice if it worked.

-viral

Steven G. Johnson

unread,
Feb 6, 2015, 4:40:17 PM2/6/15
to julia...@googlegroups.com


On Friday, February 6, 2015 at 2:03:23 PM UTC-5, astromono wrote:
         I am getting to julia in recent months. I have hundreds (thousands, perhaps) of functions and scrips in octave (many years working with matlab/octave). I'm linux user (LMDE).
The fact is that from
python I use oct2py module to run octave functions with reasonably good results.
But in julia, using PyCall, this fails.
To begin "@pyimport oct2py.octave as oc" leaves locked the command until you cancel it:

julia>pyimport oct2py.octave as oc

 Can you file a PyCall issue?  I'm not sure what is going on, as I don't have the oct2py module installed at the moment and can't try it out quickly, but it should be possible to get any Python module working from Julia.

Roberto López López

unread,
Feb 6, 2015, 6:59:27 PM2/6/15
to julia...@googlegroups.com
I can run many pyton modules from julia, such as mayavi for example, that it is complicated but oct2py break at first.

Rober

El 06/02/15 a las 21:40, Steven G. Johnson escribió:

Páll Haraldsson

unread,
Feb 10, 2015, 5:39:48 AM2/10/15
to julia...@googlegroups.com

Since it should be possible to call any Python module, I'm not sure there is much benefit to be able to call Octave directly. Except maybe:

There is a way to call MATLAB directly (and back) that doesn't involve Python (I think). I haven't looked too much into it as I do not have to do this personally (but a friend could use this). Those wrappers are probably specific to call MATLAB. How hard would it be to make them generic? Or should there be a third module for that (an abstract interface)? [And I'm thinking along similar lines for my Decimal package that uses Python and then another implementation that wraps C.]

It seems it would be unfortunate if the MATLAB wrapper's interface looks different from the oct2py interface - is that inevitable? People who already know that interface from Python expect that one (or do we not need that compatibility?)? In Julia, things could be slightly different, but in the end, you just want to call some MATLAB/Octave functions, right? Couldn't most stuff at least be the same?

-- 
Palli.

Roberto López López

unread,
Feb 12, 2015, 5:22:45 AM2/12/15
to julia...@googlegroups.com
Hi!
    Of course! The point is to call m-octave functions, more or less similar to matlab functions. I understand that matlab.jl package could be a good solution if it opened the octave engine instead of opening the matlab.

    But in this case, matlab.jl uses calls to C-libraries of Matlab (MxArray, mxClassID, mxComplexity, MSession, etc) which are not equivalent in Octave.

Now, I am trying to find why oct2py doesn't work from Julia as other modules what do.

I'll send an message if I can solve it.

Thanks folks,
Rober


El 10/02/15 a las 10:39, Páll Haraldsson escribió:

Steven G. Johnson

unread,
Sep 9, 2016, 7:32:56 AM9/9/16
to julia-users, rllo...@gmail.com


On Friday, February 6, 2015 at 2:03:23 PM UTC-5, astromono wrote:
  in pyinitialize at /home/rober/.julia/v0.4/PyCall/src/pyinit.jl:245

 I think you must have pinned PyCall at some ancient version, because the current pyinit.jl file only has 115 lines.

Chris Rackauckas

unread,
Sep 9, 2016, 6:22:06 PM9/9/16
to julia-users, rllo...@gmail.com
You accidentally revived a >1 year old thread.

Chris Rackauckas

unread,
Sep 9, 2016, 6:22:44 PM9/9/16
to julia-users, rllo...@gmail.com
I guess not >1 year, but getting close to a year.


On Friday, September 9, 2016 at 4:32:56 AM UTC-7, Steven G. Johnson wrote:

Waldir Pimenta

unread,
Sep 18, 2016, 6:58:09 AM9/18/16
to julia-users, rllo...@gmail.com
Sorry, that was on me: https://github.com/JuliaPy/PyCall.jl/issues/320

Still, since this thread wasn't resolved, it may be a good thing if this gets exposed to more eyes, since other people may have (or have had) the same problem, and could comment confirming its resolution, or that it still occurs.
Reply all
Reply to author
Forward
0 new messages