16
edits
m (Removed unnecessary commands) |
m (Fix Octave command) |
||
(4 intermediate revisions by 2 users not shown) | |||
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. There are multiple approaches to this. | ||
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 14: | Line 16: | ||
= Dependencies = | = Dependencies = | ||
: 2. Install dependencies. | : 2. Install dependencies. | ||
In the Ubuntu system, open a terminal by pressing {{key press|Ctrl|Alt|t}}. Issue the following commands (tested only on Ubuntu | In the Ubuntu system, open a terminal by pressing {{key press|Ctrl|Alt|t}}. Issue the following commands (tested only on Ubuntu 24.04): | ||
$ sudo apt-get update | $ sudo apt-get update | ||
$ sudo apt-get install build-essential mercurial gcc g++ gfortran make libblas-dev liblapack-dev epstool transfig libglpk-dev | $ sudo apt-get install build-essential mercurial gcc g++ gfortran make libblas-dev liblapack-dev epstool transfig libglpk-dev libreadline-dev llvm-dev lpr texinfo pstoedit libqhull-dev libqrupdate-dev libsuitesparse-dev texlive libxft-dev autoconf automake bison flex gperf gzip icoutils libtool perl rsync tar libpcre3-dev libarpack2-dev libcurl4-openssl-dev libfftw3-dev libfltk1.3-dev libfontconfig1-dev libfreetype-dev libgl2ps-dev gnuplot-x11 libgraphicsmagick++1-dev libhdf5-dev libsndfile1-dev libgl1-mesa-dev libosmesa6-dev portaudio19-dev zlib1g-dev libegl1-mesa-dev libgles2-mesa-dev libwayland-dev openjdk-21-jdk openjdk-21-jre openjdk-21-jre-headless openjdk-21-jdk-headless qttools5-dev-tools qtbase5-dev qtbase5-dev-tools qttools5-dev libqscintilla2-qt5-dev libqt5opengl5-dev git rapidjson-dev libsundials-dev doxygen texlive-latex-extra graphviz librsvg2-bin | ||
: 3. Mercurial. | : 3. 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'. | ||
Line 28: | Line 30: | ||
$ mkdir -p bld_dir; cd bld_dir; | $ mkdir -p bld_dir; cd bld_dir; | ||
: 5. Configure. | : 5. Configure. | ||
$ cd /home/ubuntuuser/projects/octave_src/octave/bld_dir | |||
$ rm * -r -f; ../configure -v --prefix=/home/ubuntuuser/projects/octave_src/octave_install >& configure.out; | $ rm * -r -f; ../configure -v --prefix=/home/ubuntuuser/projects/octave_src/octave_install >& configure.out; | ||
To check if any library has not been found by the configure script: | To check if any library has not been found by the configure script: | ||
Line 43: | Line 46: | ||
$ echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope | $ echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope | ||
$ ./run-octave --gui | $ ./run-octave --gui | ||
>> system (sprintf ("gnome-terminal --command 'gdb -p %d'", getpid ()), "async"); | Then run the following command in Octave command line: | ||
>> system (sprintf ("gnome-terminal --command 'gdb -p %d'", getpid ()), 0, "async"); | |||
(gdb) thread apply all break | 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. | ||
(gdb) set pagination off | |||
(gdb) thread apply all break variable_editor::edit_variable | |||
(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: | |||
(gdb) backtrace 10 | (gdb) backtrace 10 | ||
To disable breakpoints and continue running the program: | |||
(gdb) | (gdb) disable breakpoints | ||
(gdb) c | |||
= Save and Patch = | = Save and Patch = | ||
: 8. Save your work and send patch. | : 8. Save your work and send patch. |
edits