Building on Ubuntu Virtual Machine: Difference between revisions

Jump to navigation Jump to search
m
Added descriptions.
m (Added more description.)
m (Added descriptions.)
Line 1: Line 1:
This page contains instructions on how to build Octave in an Ubuntu virtual machine in a Windows Host.
This page contains instructions on how to build Octave in an Ubuntu virtual machine in a Windows Host.


This page is both concise and self-contained to allow beginners to quickly get up and running with developing code for Octave.
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.
 
= Virtualbox =
# Download Virtualbox from [https://www.virtualbox.org/ virtualbox.org], install.
# Download Virtualbox from [https://www.virtualbox.org/ virtualbox.org], install.
# Download Ubuntu Desktop iso from [https://ubuntu.com/download/desktop ubuntu.com].
# Download Ubuntu Desktop iso from [https://ubuntu.com/download/desktop ubuntu.com].
Line 10: Line 10:
## Back to Oracle VM VirtualBox Manager, select OctaveDev, click on Settings. In System, select Processor tab. Adjust the number of CPUs to half of what is available, since this will speed up the compilation and response of the VM. For example, if you have 8 cores, select 4. Click OK. In Storage, under 'Controller: IDE', select Empty. Under Attributes, click on the disk icon. Browse and select the iso file previously downloaded. Click OK.
## Back to Oracle VM VirtualBox Manager, select OctaveDev, click on Settings. In System, select Processor tab. Adjust the number of CPUs to half of what is available, since this will speed up the compilation and response of the VM. For example, if you have 8 cores, select 4. Click OK. In Storage, under 'Controller: IDE', select Empty. Under Attributes, click on the disk icon. Browse and select the iso file previously downloaded. Click OK.
## Double click the newly created VM to start it. Follow the prompts to install the operating system. Don't forget to add a username and a password. This tutorial has the username as 'ubuntuuser'.
## Double click the newly created VM to start it. Follow the prompts to install the operating system. Don't forget to add a username and a password. This tutorial has the username as 'ubuntuuser'.
# Install dependencies.
= Dependencies =
: 4. Install dependencies.
## In the Ubuntu system, open a terminal by pressing {{key press|Ctrl|Alt|t}}. Issue the following commands (tested only on Ubuntu 20.04):
## In the Ubuntu system, open a terminal by pressing {{key press|Ctrl|Alt|t}}. Issue the following commands (tested only on Ubuntu 20.04):
     $sudo apt-get update
     $sudo apt-get update
Line 16: Line 17:
: 5. Mercurial
: 5. Mercurial
From the page [[Mercurial]], follow the steps under the section 'Example Mercurial configuration'.
From the page [[Mercurial]], follow the steps under the section 'Example Mercurial configuration'.
: 6. Build directory
= Build directory =
: 6. Setup build directory
     $ mkdir -p /home/ubuntuuser/projects/octave_src
     $ mkdir -p /home/ubuntuuser/projects/octave_src
     $ cd /home/ubuntuuser/projects/octave_src
     $ cd /home/ubuntuuser/projects/octave_src
Line 29: Line 31:
: 8. Make:
: 8. Make:
     $ date; make -j -l2  V=1 >& make.out; date; paplay /usr/share/sounds/gnome/default/alerts/glass.ogg
     $ date; make -j -l2  V=1 >& make.out; date; paplay /usr/share/sounds/gnome/default/alerts/glass.ogg
= Debug =
: 9. Debugging
: 9. Debugging
Note: The option ‘--enable-address-sanitizer-flags’ breaks the build, so it can be removed.
Note: The option ‘--enable-address-sanitizer-flags’ breaks the build, so it can be removed.
Line 47: Line 50:
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).
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) thread apply all break variable-editor-model.cc:928
     (gdb) thread apply all break variable-editor-model.cc:928
: 10. Save and send patch
= Save and Patch
: 10. Save your work and send patch
To save your changes to a single file:
To save your changes to a single file:
     $ cd /home/ubuntuuser/projects/octave_src/octave
     $ cd /home/ubuntuuser/projects/octave_src/octave
13

edits

Navigation menu