Building on Microsoft Windows: Difference between revisions
m (Siko1056 moved page Building on Windows to Building on Microsoft Windows) |
m (Category:Building better suited.) |
||
Line 80: | Line 80: | ||
[[Category:Microsoft Windows]] | [[Category:Microsoft Windows]] | ||
[[Category: | [[Category:Building]] |
Revision as of 02:47, 10 June 2020
This page is directed towards new developers that are interested in contributing to Octave. There should be little requirements to follow these steps.
Contributing to Octave
Octave development is done mainly on Linux. But if you are running Windows, you can contribute to Octave nevertheless.
The easiest way to contribute (not only from Windows) is probably by changing or adding .m files.
If you found something you'd like to fix or improve, check out the bug tracker. It might have already been fixed in the development or (unreleased) stable version.
Octave is version controlled in a Mercurial repository. There are several Mercurial clients for Windows. One that nicely integrates with the Windows Explorer and that offers an easy to learn user interface is TortoiseHg. It is also quite easy to create Mercurial patches with that software. Those are the preferred way of contributing to Octave.
Building Octave
If you want to contribute changes to C++ files or are interested in testing the latest development or (unreleased) stable release, you can build Octave from source.
There is currently no maintained way to build Octave on Windows directly. But it still possible to build Octave on Windows machines using virtual machines or Microsoft's Windows Subsystem for Linux.
Virtual Machine
Most of Octave's developers are running Ubuntu (citation needed). So this is probably the Linux distribution for which you are most likely to get help if you should run into issues.
The VMWare Player is free (as in no costs) for non-commercial use.
There are several sources for free complete Linux VM images on the web. One of them is osboxes.org. You can download an Ubuntu image for VMWare Player from there: Download
You also need a .vmx file to be able to start the Virtual Machine with VMWare Player. Open a text editor and save the following to a file called "Ubuntu.vmx" next to the VM image you downloaded:
.encoding = "windows-1252"
config.version = "8"
virtualHW.version = "8"
scsi0.present = "TRUE"
scsi0.virtualDev = "lsilogic"
memsize = "2048"
scsi0:0.present = "TRUE"
scsi0:0.fileName = "Ubuntu.vmdk"
ethernet0.present = "TRUE"
ethernet0.virtualDev = "e1000"
displayName = "Ubuntu"
guestOS = "ubuntu-64"
virtualHW.productCompatibility = "hosted"
Change the line with "Ubuntu.vmdk" to the actual file name of the Ubuntu image you just downloaded.
You can start the VM by double-clicking on the .vmx file you just created.
Change the amount of memory or the number of processors you want to assign to the VM in the Virtual Machine settings in VMWare Player.
The login data for VMs downloaded from osboxes is: username: osboxes password: osboxes.org
Once you started the VM and logged in, continue as if you would run Ubuntu natively: Octave_for_Debian_systems#The_right_way Octave for Ubuntu
Windows Subsystem for Linux
The Windows Subsystem for Linux (WSL) was not very interesting for serious development in its first version. Many of the shortcomings have been fixed in WSL2 which was released together with Windows 10 Update 2004. To install WSL2 on Windows, follow the instructions by Microsoft: [1]
WSL2 is basically a virtual machine running the Linux kernel that is more closely integrated into Windows. But it also has some limitations (see below).
Again it is possible to choose from several different Linux distribution. But for reasons already mentioned, you should choose Ubuntu.
WSL (or WSL2) does not contain an X server. The X server on Linux is necessary to present program windows to the users. So by default, WSL is only a command line interface. You can start that command line interface with the "Ubuntu" shortcut in the start menu.
If you want to run the Octave GUI, you can install an X server. There are several you can choose from. One of them is VcXsrv. When you start VcXsrv, choose "Multiple Windows", "Start no client", deselect "Native opengl", and select "Disable access control" to be able to use the X server from WSL. Additionally, append the following lines to your .bashrc file in the home directory on the WSL Ubuntu:
export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0
export LIBGL_ALWAYS_INDIRECT=1
You can access that file via the share "\\wsl$\Ubuntu\home\username\.bashrc" (where "Ubuntu" is the name of the distribution you installed and "username" is your username on that distribution.
Because of the basic lack of a graphical user interface (even if somewhat mitigated with the X server), using WSL(2) is not recommended for beginners.