[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: embedding octave twice causes warning: duplicate binary operator
From: |
Soeren Sonnenburg |
Subject: |
Re: embedding octave twice causes warning: duplicate binary operator |
Date: |
Wed, 04 Mar 2009 21:02:07 +0100 |
On Wed, 2009-03-04 at 12:40 -0500, John W. Eaton wrote:
> On 4-Mar-2009, Soeren Sonnenburg wrote:
Dear John,
> | I've embedded octave following the embed example on the wiki (that
> | successfully resulted in a run octave code from R or python and vice
> | versa).
> |
> | Running the code
> |
> | octave_main(argc,argv,1);
> | <code>
> | do_octave_atexit();
> |
> | multiple times gives me many warnings like
> |
> | warning: duplicate binary operator `>' for types `uint32 scalar' and
> `uint32 scalar'
> [...]
> | So I am now wondering how to properly cleanup octave such that they
> | don't occur.
>
> The do_octave_atexit function doesn't uninitialize Octave. It just
> runs the list of functions that have been registered with "atexit".
>
> I don't think there is a way to unregister operators (Octave itself
> doesn''t need functionality like that).
I see. Also that functionality is probably not what 99.99% of the users
need. Anyway things work now (for strings of arbitrary type, matrices of
arbitrary type, vectors and scalars). I am happy to say that I got
matplotlib to plot from within octave, ohh well and octave can now run
embedded from matlab too. In case there is interest I can create a
snapshot of shogun that demonstrates this.
> I would suggest only embedding and initializing it once in your
> application. If you need to do something different, then you'll need
> to do some work to implement functions that properly shutdown and
> cleanup the Octave interpreter so that it may be initialized again.
> But since Octave is not reentrant/thread safe, even if you do that,
> you will likely only be able to initialize one copy of Octave at a
> time.
I had this crazy(?) idea of running python from octave which then again
embeds octave to do something. As this crashed (but first printed the
above warnings) I was under the impression that I could get this to run.
Hmmhh, I guess I should embed R too.
> | Ahh and how would it be possible to muten octave when it is running
> | embedded (not print the copyright notice all the time?)
>
> Pass "-q" in argv?
Thanks, that just works fine.
Soeren.