bugGNU Octave - Bugs: bug #56416, Incorrect octave.bat - missing...

 
 

bug #56416: Incorrect octave.bat - missing MSYSTEM, usr\bin, qt graphics

Submitter:  None
Submitted:  Thu 30 May 2019 12:06:07 AM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Benjamin Szőke Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 5.1.0
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 18 Mar 2022 10:30:34 AM UTC, comment #15: 

Using Octave 7.0.90 on Windows, the exemplary commands in comment #13 no longer return before Octave has finished no matter whether `octave-gui.exe`, `octave-cli.exe` or `octave.exe` is called.

IIUC, that is the expected behavior.

The .bat and .vbs files are still bundled with the (MXE) installer but they are no longer used by default.

IIUC, no changes are needed for this report. (Please, answer here if this is not the case.)

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Sun 30 Jan 2022 01:53:40 PM UTC, comment #14: 

The `octave-cli` executable is not linked with Qt. So, there it's not possible to use the "qt" graphics toolkit when Octave was started with `octave-cli`.

If you are interested in starting Octave without GUI (i.e., just the command line interface) while still being able to use the "qt" graphics toolkit, consider starting Octave with `octave-gui --no-gui`.

Like explained earlier, that won't do the right thing for all use cases. But if you are just interested in starting an Octave CLI for interactive use, it should be working.

Some changes to how Octave starts itself on Windows were done for Octave 7. The behavior might be different now.
You could check with the release candidate for Octave 7:
https://alpha.gnu.org/gnu/octave/?C=M;O=D

Markus Mützel <mmuetzel>
Group administrator
Sun 30 Jan 2022 01:12:01 PM UTC, comment #13: 

comment #12:

> For example, running from command line:
>
>
> running:
>
> octave-cli --no-gui --norc --eval "pause(10); a=1"
>
> runs the command and then returns, so something like X=`octave-cli --no-gui --norc --eval "pause(10); a=1"` would work.
>
> Running:
>
> octave-gui --no-gui --norc --eval "pause(10); a=1"
>
>
> Returns straight away, so something like X=`octave-gui --no-gui --norc --eval "pause(10); a=1"` would NOT work.
>


What would be the correct way to be able to use QT graphics plotting in octave-cli.exe using?

Benjamin Szőke <livius>
Thu 18 Jul 2019 11:59:16 AM UTC, comment #12: 

For example, running from command line:


running:

octave-cli --no-gui --norc --eval "pause(10); a=1"

runs the command and then returns, so something like X=`octave-cli --no-gui --norc --eval "pause(10); a=1"` would work.

Running:

octave-gui --no-gui --norc --eval "pause(10); a=1"


Returns straight away, so something like X=`octave-gui --no-gui --norc --eval "pause(10); a=1"` would NOT work.

John Donoghue <lostbard>
Group Member
Wed 17 Jul 2019 11:20:33 PM UTC, comment #11: 

The gui does not wait and commands running to get out fail.

The .vbs file is designed to run from the shortcut where it doesnt matter that the script exits.

The bat file is expected to allow piping of data and only exits when octave exits.

John Donoghue <lostbard>
Group Member
Wed 17 Jul 2019 08:01:43 PM UTC, comment #10: 

What do you mean in pkg isntall in windows version of Octave?
Octave.vbs start script uses tha octave-gui.exe in no-gui mode well, too. I do not understand that it is why different in ocatve.bat despite of it is doing the same start-scripting.

Benjamin Szőke <livius>
Wed 17 Jul 2019 12:02:55 AM UTC, comment #9: 

It may have worked in your use, but it does not work currently when being called during pkg install, on packages that use it in thier configure

See Bug #53938

John Donoghue <lostbard>
Group Member
Tue 16 Jul 2019 10:28:35 PM UTC, comment #8: 

Pls, replace octave-cli.exe with octave-gui.exe in -no-gui mode, too! I replaced it in my own .bat file, and it is works well. I can use QT graphics nicely in no-gui mode also in this way.

Benjamin Szőke <livius>
Mon 03 Jun 2019 01:29:09 PM UTC, comment #7: 
John Donoghue <lostbard>
Group Member
Fri 31 May 2019 11:35:56 AM UTC, comment #6: 

For now, I'll add the msys2 path and the msystem var to the bat file

John Donoghue <lostbard>
Group Member
Thu 30 May 2019 10:02:57 PM UTC, comment #5: 

Octave.vbs use the "octave-gui.exe --no-gui" and it is working well thanks to that correct path and any other declared variables.

But, i can not use octave.vbs when i want to execute it from an own C program as a childprocess with pipe interface. Octave.vbs will start octave-gui.exe as a background process in a new cmd window (then exit), so that my own C program does not have any pipe connection to the octave-gui.exe.

If i use the "octave.bat --no-gui" it is better because the bat file will run octave-gui.exe in the same cmd and it will be the same childprocess. In this case the pipe connection is fine and works well.

In the past i never used any plots and figure printing and the octave-cli.exe was enough for my tasks. But now i need a correct qt graphics for plots in command-line octave, too.

I think in the future a fixed octave.bat (with using octave-gui.exe --no-gui) should be better to a general executing method in MS Windows than the octave.vbs script.

Benjamin Szőke <livius>
Thu 30 May 2019 12:26:24 PM UTC, comment #4: 

One of the reasons for using octave-cli was that in windows, octave-gui detaches itself when run, so any scripts - ie: configure of a package calling octave, will fail as it tehn doesnt get anything from any commands tnat may run via eval etc


John Donoghue <lostbard>
Group Member
Thu 30 May 2019 11:52:41 AM UTC, comment #3: 

I dont believe vbs will run via command line in msys2, and mkoctfile etc doesnt look for it


I beleieve the changes for the bat file etc where done on https://savannah.gnu.org/bugs/?53938

John Donoghue <lostbard>
Group Member
Thu 30 May 2019 09:28:31 AM UTC, comment #2: 

Why do we need vbs and bat versions of the wrapper script?  Isn't one sufficient?

John W. Eaton <jwe>
Group administrator
Thu 30 May 2019 12:31:41 AM UTC, comment #1: 

Thank you for the bug report. I do not personally have access to Windows to test any of this, but it was my understanding that 'octave-gui --no-gui' did not work reliably on Windows. If it does work reliably now, that is news to me, and possibly to others who do use Octave on Windows all the time.

If this is reliable, then maybe the defaults should be changed so that 'octave' does run the 'octave-gui' executable with either of the '--gui' or '--no-gui' options. And maybe a new 'octave-cli.bat' script should be added to call 'octave-cli' with the necessary environment variables.

This probably needs confirmation and investigation by those who care about Octave on Windows.

Mike Miller <mtmiller>
Group Member
Thu 30 May 2019 12:06:07 AM UTC, original submission:  

In a first look, it seems to me that octave.bat and octave.vbs script is different. Pls compare it and fix octave.bat!

When i want to use octave.vbs --no-gui, everything is fine, qt graphics is working well, and all of executable files from usr/bin example: cat, ssh ... are working in octave.

But when i want to use the octave.bat --no-gui, qt graphics is missing and all contents from usr/bin are missing, too.

Pls fix it as soon as possible. I fixed that bugs in the octave.bat for my own usage, but it is in the attached files feel free to use it. I have been set usr/bin into path, i declared the correct MSYSTEM variable (MINGW64 or MINGW32) and i am using now octave-gui.exe --no-gui instead of ocatve-cli.exe and now it works well.

It is important to me that i could use qt graphics in command-line mode also. (Octave.vbs use the same way with usage of octave-gui.exe --no-gui)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #47002:  octave_fixed.bat added by None (2KiB - application/octet-stream - Fixed octave.bat)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by livius (Posted a comment)
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-03-18 mmuetzel StatusNone Fixed
        Open/ClosedOpen Closed
    2019-05-30 mtmiller CategoryLibraries Configuration and Build System
        Item GroupSegfault, Bus Error, etc. Incorrect Result
    2019-05-30 None Attached File- Added octave_fixed.bat, #47002

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code