03 March 2013

352. Installing coreutils and sed, gawk on Windows (without cygwin)

My third Windows XP post. Only a few more to go...

You can also set up all these tools via cygwin: http://verahill.blogspot.com.au/2013/03/353-cygwin-with-octave-and-gnuplot-on.html

1. coreutils
coreutils covers a fair number of the basic linux file tools. In particular cat, paste and join are of interest with respect to data processing.

A. Go to http://sourceforge.net/projects/gnuwin32/files/coreutils/5.3.0/coreutils-5.3.0.exe/download?use_mirror=waix&download= and download coreutils-5.3.0.exe. Run the file.

B. Make sure to add C:\Program Files\GnuWin32\bin to the PATH:
* Right-click on my computer, select properties, Advanced.
* Click on Environment variables
* In the second box, 'system variables', highlight 'Path' and click on 'Edit'. In the variable value box, add ';C:\Program Files\GnuWin32\bin'

C. Go to the start meny, click on Run..., and type in 'cmd'
In the (fake) DOS window, type e.g. ls -lah to see if everything works.

2. gawk
Go to http://gnuwin32.sourceforge.net/packages/gawk.htm and open http://downloads.sourceforge.net/project/gnuwin32/gawk/3.1.6-1/gawk-3.1.6-1-setup.exe

Run the .exe and use the default installation location (which is the same as the coreutils above -- so you don't have to add a separate path). Run cmd and do e.g.

cat ntuser.ini|gawk "{print $2}"
S e t t i n g s ; T e m p o r a r y
3. sed
Sed is installed like gawk -- go to http://gnuwin32.sourceforge.net/packages/sed.htm and go to http://gnuwin32.sourceforge.net/downlinks/sed.php

Run the .exe file and install in the default location. Try e.g.

cat ntuser.ini|sed "s/e/E/g"

351. Installing gnuplot on Windows XP

Here's my second Win XP post.

Here's how to set up gnuplot on windows XP. You can also set it up using cygwin: http://verahill.blogspot.com.au/2013/03/353-cygwin-with-octave-and-gnuplot-on.html

1. Download
Go to http://www.tatsuromatsuoka.com/gnuplot/Eng/winbin/ and download http://www.tatsuromatsuoka.com/gnuplot/Eng/winbin/gp470-20120916-win32-mingw-setup.zip

You'll need e.g. 7zip to extract the file.

2. Install and set up
Extract the  gp470-20120916-mingw.exe file to some temporary place, and then launch the installation by double-clicking on it. Most installation steps are straight-forward. Set windows as the default terminal, and make sure to check the box to add the application directory to PATH.

3. Usage
Launch gnuplot from the windows start menu as any other program if you want it to run interactively.

Alternatively, create a script and launch it using "gnuplot scriptname" from cmd as you would under linux.

350. Installing GNU Octave on Windows XP

This is a Windows XP post (my first?), so right-thinking linux people can move on. Nothing to see here.

For the rest of you:
Since I can't force my students to switch to Linux -- but I can force the to use Octave and Gnuplot -- I need to make sure that there are some easy, step-by-step (recipe-based) guides available that describe how to install the tools that they are required to use on their platform of choice. OS X has many flaws, but has macports. Windows has cygwin, in addition to native builds of most GNU tools. I'll cover cygwin in a separate post.

Here's a pretty straightforward approach to installing GNU Octave and I've tested it on Windows XP. It suffers from a fatal weakness: it takes well over a minute (!) to actually start Octave this way -- each timeUse the cygwin approach insteadhttp://verahill.blogspot.com.au/2013/03/353-cygwin-with-octave-and-gnuplot-on.html -- this way it's about as fast as on Linux.

0. 7zip and notepad++
You'll need 7zip: http://www.7-zip.org/ and http://notepad-plus-plus.org/. Download and install.

1.  Download Octave
Go to http://wiki.octave.org/Octave_for_Windows
The most current version is 3.6.2 ("Octave-3.6.2-mingw + octaveforge pkgs"), which takes you here: http://downloads.sourceforge.net/project/octave/Octave%20Windows%20binaries/Octave%203.6.2%20for%20Windows%20MinGW%20installer/Octave3.6.2_gcc4.6.2_20120609.7z

2. Set up
The downloaded file is 169 Mb but extracts to 700 Mb(!) so even the extraction process takes a little while. Extract with 7zip by right-clicking the downloaded file, selecting 7zip, and extract to "Octave...".

Create C:\octave, and put the Octave3.6.2_gcc4.6.2 folder in it.

Right click on C:\octave\Octave3.6.2_gcc4.6.2\bin\octave.exe and select create shortcut. Copy the shortcut to e.g. your desktop. Edit it and click on change icon -- select "C:\Octave\Octave3.6.2_gcc4.6.2\share\octave\3.6.2\imagelib\octave-logo.ico".

3. Running
Simply double-click on the shortcut.
Here's the bad news: it takes 1 m 20 s to start, which is unacceptable.

4. Packages
To install packages without having a full build environment, download from
http://downloads.sourceforge.net/project/octave/Octave%20Windows%20binaries/Octave%203.6.2%20for%20Windows%20MinGW%20installer/Octave3.6.2_gcc4.6.2_pkgs_20120613.7z

Extract the file, and copy the bin, include, lib, share folders to c:\octave\Octave3.6.2_gcc4.6.2\ so that the folders merge with those from step 2.

Start octave and run
pkg rebuild -noauto nan

This way all packages (except nan) will auto-load next time you start octave.