We have installed GNU Octave on our clusters. From their website:
“GNU Octave is a high-level interpreted language, primarily intended for numerical computations. It provides capabilities for the numerical solution of linear and nonlinear problems, and for performing other numerical experiments. It also provides extensive graphics capabilities for data visualization and manipulation. Octave is normally used through its interactive command line interface, but it can also be used to write non-interactive programs. The Octave language is quite similar to Matlab so that most programs are easily portable.”
It seems to work well and we have managed to get the latest version, 4.0.0, to compile with all the relevant mathematical libraries, FFTW3, ARPACK, AMD, CHOLMOD etc. However the really nice thing about it is that it’s free. While one can cut and paste Matlab scripts directly into Octave you may need to edit them slightly, for example it appears that unlike Matlab you need to predefine your variables. To launch Octave just run the binary:
In the example above you will note the X11 DISPLAY error. Setting the DISPLAY environment variable allows one to export the graphical user interface (GUI) back to your desktop. So submitting a cluster job with the commands:
export DISPLAY=my.ip.addr:0.0 /home/exp_soft/octave-4.0.0/bin/octave --force-gui
Will launch a job on a worker node and provide a GUI on your desktop. Below is an example of a user launching Octave with Slurm and creating some simple functions and graphs:
Note: Octave is highly sensitive to the compiler selection that it was installed with. On Hex we used gcc-4.9.2 as the native gcc version is not compliant with several Octave packages. To use octave do the following:
module add compilers/gcc492 software/octave-4.0.0 qsub -I -V octave
To install packages run Octave and add the packages directly from SourceForge to your local folder. For example to load the image package:
pkg install -verbose -local -forge image pkg load image