Thursday, October 2, 2014

Best practices to run GNU Octave in a Windows box

GNU Octave is a very interesting software to run math computations on your desktop. It's an open-source high-level interpreted language, primarily intended for numerical computations equivalent to Wolphram's MatLab
So, usually you will run this on a Linux box but if you're like me, who has a preference for Windows desktops, you may have a few issues running it. So here is a small recipe that may help:
Install Cygwin (you have to install this lovely piece of software even if you don't want to run Octave)
Choose at lease the following packages:
  • octave (and all the packages that you think you will want to use)
  • xorg-server
  • xinit
  • xterm

and let Cygwin setup to select all the dependencies for you.
After you've installed this you can open a Cygwin terminal and then run:

# X   
# export DISPLAY=:0.0  
# xterm 
# octave (inside xterm)
# sombrero(51) (inside octave)
This previous commands will:

  • Run the XServer
  • Let every X application to run on the local XServer that you've just started, you can add this into your ~/.bash_profile
  • Open a new terminal inside this XServer
  • Start Octave
  • Execute a beauty graph inside the XServer window

Enjoy you maths!

No comments: