Re: Second time's a charm
Sebastien Loisel <[email protected]> Thu, 16 Feb 2006 18:47:54 +0100
| Newsgroups | gmane.comp.gnu.octave.maintainers,gmane.comp.gnu.octave.graphics |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_7424_32399475.1140112074207
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
David,
Only in windows could this happen. It appears that the cout and cerr that m=
y
Octave GUI program sees are *not the same* as the cout and cerr that
liboctave sees. I have absolutely no idea why this is. I've linked a
"console version" of Octave GUI to see if it would help, no go. I'm able to
grab the octave_stdout, but when I grab cerr and cout, it's only grabbed
inside my code, and not inside liboctave. Ergo, they're different symbols.
I can't fix this without help. If you don't know how to fix it, I'll go
trolling on Windows C++ forums somewhere.
While we could rename cerr to octave_stderr everywhere, maybe this function
would solve the problem too:
ostream &get_liboctave_cerr() { return cerr; }
(making sure of course it's not inline otherwise I'll get the wrong symbol.=
)
In fact, would you mind testing that last idea?
Cheers,
S=E9bastien Loisel
On 2/16/06, David Bateman <[email protected]> wrote:
>
> Sebastien,
>
> Ok, I took a really quick look at this.
>
> * Firstly have you tried starting octave-gui.exe in an rxvt? The output
> you are trying to capture is echoed in the rxvt terminal rather than
> your application.
> * Commands such as "ls" that use a system call open a cmd.exe window
> briefly when they probably shouldn't. This will happen for many commands
> including most notably "help" as it makes a system call to texinfo..
> * The readline line completion in octave allows you to start typing then
> do upper-arrow to get the previous commands that started with the same
> characters.
> * You don't appear to be using the octave history file, this is
> important as it allows use of the history between sessions. To address
> this and the above point, why not use the function
> std::string gnu_readline (const std::string&, bool) from src/input.cc in
> octave. You might also be able to use other parts of the command_editor
> class to get the output right, though you might need to set
> command_editor::terminal_cols correctly. Check liboctave/cmd-edit.h
> * You don't respect the PS1 variable for the prompt in the GUI.
>
> I still haven't looked at the bug with octave_init yet, so the above is
> just first impressions.. Looks good and extremely rapid progress..
>
> Cheers
> David
>
> Sebastien Loisel wrote:
>
> > David,
> >
> > Ok, now I've autoconfiscated octave-gui and you should be able to
> > build it. If you have QT4.1 problems though, you're going to have to
> > sort those out... :-/ Over here, everything compiles and the
> > mainwindow comes up so it's now at the same state as it was
> > pre-autoconfiscation (octave still doesn't init right.)
> >
> > The tarball is here:
> > http://www.math.mcgill.ca/loisel/octave-gui-beta.tar.gz
> >
> > I strongly advise everyone but David to stay away from this.
> >
> > Building is standard, but it's in maintainer mode. Here's what I do.
> >
> > 1) Fire up an appropriate shell. I've got "shell.bat" and
> > "shell-x64.bat" (for Windows XP x64) in that directory for that
> > purpose. It's basically the setup from your octave.bat, then it starts
> > sh.exe from mingw.
> >
> > 2) cd to the octave-gui-0.4 directory.
> >
> > 3)
> > $ aclocal
> > $ autoconf
> > $ automake
> > $ ./configure
> > $ make
> >
> > 4) ./octave-gui
> >
> > After a 5 second pause (or so), a window will pop up.
> >
> > I haven't tested, but I don't think stdout/stderr work. So if you're
> > going to debug, you have to use some other way. To help you out, I've
> > declared the following global variable:
> >
> > string david_output;
> >
> > If you stick anything in there, it'll appear in the mainwindow when
> > the mainwindow first appears. Otherwise I think you can open files and
> > stuff. Right now, as an example, it prints the return code of
> > octave_main, which is 1.
> >
> > Cheers,
> >
> > Sebastien Loisel
> >
>
>
> --
> David Bateman [email protected]
> Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
> Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
> 91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
>
> The information contained in this communication has been classified as:
>
> [x] General Business Information
> [ ] Motorola Internal Use Only
> [ ] Motorola Confidential Proprietary
>
>
------=_Part_7424_32399475.1140112074207
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
David,<br><br>Only in windows could this happen. It appears that the cout a=
nd cerr that my Octave GUI program sees are *not the same* as the cout and =
cerr that liboctave sees. I have absolutely no idea why this is. I've linke=
d a "console version" of Octave GUI to see if it would help, no g=
o. I'm able to grab the octave_stdout, but when I grab cerr and cout, it's =
only grabbed inside my code, and not inside liboctave. Ergo, they're differ=
ent symbols.
<br><br>I can't fix this without help. If you don't know how to fix it, I'l=
l go trolling on Windows C++ forums somewhere.<br><br>While we could rename=
cerr to octave_stderr everywhere, maybe this function would solve the prob=
lem too:
<br><br>ostream &get_liboctave_cerr() { return cerr; }<br><br>(making s=
ure of course it's not inline otherwise I'll get the wrong symbol.)<br><br>=
In fact, would you mind testing that last idea?<br><br>Cheers,<br><br>S=E9b=
astien Loisel
<br><br><div><span class=3D"gmail_quote">On 2/16/06, <b class=3D"gmail_send=
ername">David Bateman</b> <<a href=3D"mailto:[email protected]"=
>[email protected]</a>> wrote:</span><blockquote class=3D"gmail=
_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt=
0pt 0.8ex; padding-left: 1ex;">
Sebastien,<br><br>Ok, I took a really quick look at this.<br><br>* Firstly =
have you tried starting octave-gui.exe in an rxvt? The output<br=
>you are trying to capture is echoed in the rxvt terminal rather than<br>yo=
ur application.
<br>* Commands such as "ls" that use a system call open a cmd.exe=
window<br>briefly when they probably shouldn't. This will happen for many =
commands<br>including most notably "help" as it makes a system ca=
ll to texinfo..
<br>* The readline line completion in octave allows you to start typing the=
n<br>do upper-arrow to get the previous commands that started with the same=
<br>characters.<br>* You don't appear to be using the octave history file, =
this is
<br>important as it allows use of the history between sessions. To address<=
br>this and the above point, why not use the function<br>std::string gnu_re=
adline (const std::string&, bool) from src/input.cc in<br>octave. You m=
ight also be able to use other parts of the command_editor
<br>class to get the output right, though you might need to set<br>command_=
editor::terminal_cols correctly. Check liboctave/cmd-edit.h<br>* You don't =
respect the PS1 variable for the prompt in the GUI.<br><br>I still haven't =
looked at the bug with octave_init yet, so the above is
<br>just first impressions.. Looks good and extremely rapid progress..<br><=
br>Cheers<br>David<br><br>Sebastien Loisel wrote:<br><br>> David,<br>>=
;<br>> Ok, now I've autoconfiscated octave-gui and you should be able to
<br>> build it. If you have QT4.1 problems though, you're going to have =
to<br>> sort those out... :-/ Over here, everything compiles and the<br>=
> mainwindow comes up so it's now at the same state as it was<br>> pr=
e-autoconfiscation (octave still doesn't init right.)
<br>><br>> The tarball is here:<br>> <a href=3D"http://www.math.mc=
gill.ca/loisel/octave-gui-beta.tar.gz">http://www.math.mcgill.ca/loisel/oct=
ave-gui-beta.tar.gz</a><br>><br>> I strongly advise everyone but Davi=
d to stay away from this.
<br>><br>> Building is standard, but it's in maintainer mode. Here's =
what I do.<br>><br>> 1) Fire up an appropriate shell. I've got "=
shell.bat" and<br>> "shell-x64.bat" (for Windows XP x64) =
in that directory for that
<br>> purpose. It's basically the setup from your octave.bat, then it st=
arts<br>> sh.exe from mingw.<br>><br>> 2) cd to the octave-gui-0.4=
directory.<br>><br>> 3)<br>> $ aclocal<br>> $ autoconf<br>
> $ automake<br>> $ ./configure<br>> $ make<br>><br>> 4) ./o=
ctave-gui<br>><br>> After a 5 second pause (or so), a window will pop=
up.<br>><br>> I haven't tested, but I don't think stdout/stderr work=
. So if you're
<br>> going to debug, you have to use some other way. To help you out, I=
've<br>> declared the following global variable:<br>><br>> string =
david_output;<br>><br>> If you stick anything in there, it'll appear =
in the mainwindow when
<br>> the mainwindow first appears. Otherwise I think you can open files=
and<br>> stuff. Right now, as an example, it prints the return code of<=
br>> octave_main, which is 1.<br>><br>> Cheers,<br>><br>> Se=
bastien Loisel
<br>><br><br><br>--<br>David Bateman =
&nb=
sp; =
<a href=3D"mailto:[email protected]">David.Bateman@motorola.=
com</a><br>Motorola Labs - Paris &=
nbsp; &nbs=
p; +33 1 69 35 48 04 (Ph)<br>Parc Les Algorithmes, C=
ommune de St Aubin +33 6 72 01 06 33 (Mob)
<br>91193 Gif-Sur-Yvette FRANCE &n=
bsp; +33 1 69 35=
77 01 (Fax)<br><br>The information contained in this communication has bee=
n classified as:<br><br>[x] General Business Information<br>[ ] Motorola In=
ternal Use Only
<br>[ ] Motorola Confidential Proprietary<br><br></blockquote></div><br>
------=_Part_7424_32399475.1140112074207--