Editing Building on Ubuntu Virtual Machine

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
This page contains instructions on how to build Octave in an Ubuntu virtual machine in a Windows Host. There are multiple approaches to this.
This page contains instructions on how to build Octave in an Ubuntu virtual machine in a Windows Host.
 
In addition to the VirtualBox approach described below, it is possible to use the Windows Subsystem for Linux [https://docs.microsoft.com/en-us/windows/wsl/about]. On windows 10 wsl2 can be used, which for graphical output requires installing an X11 or VNC client on windows, and setting up a virtual X11 display on the virtual linux system. On windows 11 wslg is available with comes with an integrated X11 client and ready to use X11 display. Wsl and wsl2 have near native unix performance. Ubuntu is one of the available OS-es to install for wsl2/wslg, and once that is installed the instructions as for the Ubuntu installed with VirtualBox apply.


This page is both concise and self-contained to allow beginners to quickly develop code for Octave. The libraries and instructions have been tested in Ubuntu 20.04.
This page is both concise and self-contained to allow beginners to quickly develop code for Octave. The libraries and instructions have been tested in Ubuntu 20.04.
Line 46: Line 44:
     $ ./run-octave --gui
     $ ./run-octave --gui
     >> system (sprintf ("gnome-terminal --command 'gdb -p %d'", getpid ()), "async");
     >> system (sprintf ("gnome-terminal --command 'gdb -p %d'", getpid ()), "async");
In the new terminal window that appears: First set pagination off, then apply a breakpoint at the function edit_variable (which will be hit in another thread from the current one, so apply breakpoint for all threads), then type 'c' to continue.
Apply a breakpoint at the function edit_variable (which will be hit in another thread from the current one, so apply breakpoint for all threads).
    (gdb) set pagination off
     (gdb) thread apply all break variable-editor.cc:1154
     (gdb) thread apply all break variable_editor::edit_variable
Continue.
    (gdb) c
In Octave's command line:
     >> a = [1 2]
     >> a = [1 2]
Still in Octave, locate the Workspace widget (which lists all the current variables). Double-click on the variable ‘a’. Nothing happens in Octave, but if you switch to gdb, you can see that the program stopped at the breakpoint. Now backtrace 10 to show the calling information:
In Octave, double click on the variable ‘a’. Now gdb should be at the breakpoint. Now backtrace 10 to show the calling information:
     (gdb) backtrace 10
     (gdb) backtrace 10
To disable breakpoints and continue running the program:
Apply a breakpoint at the function variable_editor_model::create (which will be hit in another thread from the current one, so apply breakpoint for all threads).
    (gdb) disable breakpoints
     (gdb) thread apply all break variable-editor-model.cc:928
     (gdb) c
= Save and Patch =
= Save and Patch =
: 8. Save your work and send patch.
: 8. Save your work and send patch.
Please note that all contributions to Octave may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)