![]() |
Intro to Scientific Computing |
You can download Cygwin for free from the link below :
Download Cygwin setup.exe for windows
2. To install Cygwin click on setup.exe and Remember to Run setup as "Administrator" and with XP compatibility mode.
You will see Cygwin version that you are installing
3. Click next in Cygwin setup and select the root
directory where you want to install Cygwin (C:\cygwin).
In Vista you need
to select the install option: Just Me
The main cygwin site is: www.cygwin.com

Unless you have good reasons for choosing otherwise, leave it as C:\cygwin.
Also, take the defaults All Users and Unix File Types.

So again, just click Next.



The Default Packages are already chosen.

Notice that each package group (Accessibility, Admin, Archive, Audio, etc.)
has a little [+] beside it.
You want to install the following additional Packages, which you do by clicking
the [+] sign before the Application Category, then
click the word Skip in front of each Package listed below.
When chosen, the word Skip will change to a number, which is
the version of the particular package to be installed. In addition there
will be a little box with an [x] in it.
Note that you can stretch this window to make it bigger (and the packages more easily readable, by grabbing the corner with your mouse and click/dragging it.
In each package group below, check these packages for installation::
[+] Devel
->gcc-C
->gcc-C++
[+] Editors
->emacs
->emacs-X11
->emacs-el
->vim
[+] Graphics
->ImageMagic
->ghostscript
->ghostscript-base
->ghostscript-X11
->gv
->jpeg
->libpng
[+] Math
->gnuplot
->lapack
->octave
[+] Net
->Openssh
[+] Perl
->perl
[+] Publishing
->tetex
[+] Shells
->tcsh
[+] Utils
->units
[+] Web
->wget
[+] X11
->xorg-base
->xfig
|
Please note sometimes you may get a download incomplete and the setup
application will return to step 8. Simply select another server and
continue the installation process.
Installation may take several (tens of) minutes, depending on the speed of your computer and the connection to the cygwin mirror.
Once you have installed the cygwin packages, we will configure your environment for use by following these steps.


Type in everything as shown above, except change my username (jhetrick) to your username.
Your username is the name of your account, when you login to Windows. Hopefully it has no spaces in it
(such as "John Smith").
Save these two to your Desktop
g
A
Store this one in the folder C:\cygwin\home\YOURUSERNAME
If the folder C:\cygwin\home\YOURUSERNAME doesn't exist, save the file to your Desktop; we will make the folder later.
(you can save these directly by right-clicking on the file, then chosing "Save Link As".))
With this last file, .login, browsers seem to have a hard time. In Firefox, do the following:
Save the file by right-clicking on the link. This will bring up the Save File dialog box:
You need to change the following items
to these: Change login.htm to .login and change Firefox Document to All Files
Make sure the place you are saving to is your Home directory, as described above, then click Save.
Before we use these files, let's review some terms introduced above.
X provides the basic framework, or primitives, for building GUI environments: drawing and moving windows on the screen and interacting with a mouse and/or keyboard. X does not mandate the user interface individual client programs handle this. As such, the visual styling of X-based environments varies greatly; different programs may present radically different interfaces. X is not an integral part of the operating system; instead, it is built as an additional application layer on top of the operating system kernel.
Unlike previous display protocols, X was specifically designed to be used over network connections rather than on an integral or attached display device. X features network transparency: the machine where an application program (the client application) runs can differ from the user's local machine (the display server).
X originated at MIT in 1984. The current protocol version, X11, appeared in September 1987. The X.Org Foundation leads the X project, with the current reference implementation, X.org Server, available as free software under the MIT License and similar permissive licenses.[1]
A Terminal was just one connection into a large "Main Frame" computer, and many people at the
site, lab, or company, had terminals on their desks. An xterm is a window which pops up on the
screen, initializes itself, and gives you a prompt, meaning that it is awaiting commands from you.
You can open many xterms on your desktop which giving you several terminals in which to issue
commands.
Under Windows, you have only one choice of shell: the DOS shell.
Under Unix, there are several shells, and unix users often come to like one shell over another. The reason is that
each shell has strengths and limitations.
All unix shells, however, recognize the basic unix commands such as (we'll learn more about these soon):
Examples of commonly used shells are
We will be using the tcsh since it is quite powerful and is the default shell on the SunRay system at Pacific.
Click Start->Run on your computer, and in the box that pops up, type: command, and hit enter.
A window should appear on your screen. This is an example of a DOS shell.
The "prompt" is the string of characters ending with a" >"
and a flashing "_" (underline).
The DOS prompt has the
current disk (C:) and folder, ending with the ">", like this:
C:\Documents and Settings\jhetrick>
The prompt is where you type commands to the DOS shell.
At the prompt, type dir.
This gives a directory (or folder) listing of the current folder.
In a unix shell, this command is ls.
To see other DOS commands, type "help".
You should have stored put the two .bat files on your Desktop.
To start the X-Windows server and open an xterm, double click on mystartxwin.bat
This should pop up a small DOS shell for a very short time, followed by a bigger window with a black background and an aquamarine text font, as shown below. This is a unix tcsh shell running in an xterm. Congratulations!
The prompt in the xterm you just opened looks like this:
XPS[~]|>
(I have a Dell XPS laptop--your prompt should say something about your machine).
The current folder (directory) is in this prompt as well; the "~" is shorthand
for "your home directory. At the end is a pointer I've added: "|>".
At this prompt, type
You should see some files (several beginning with a ".") listed.
Notice that in your taskbar, in the lower right corner, there is a
small X.
This means that the X-Windows server is running and unix applications can now open GUI (graphical user interface, i.e. mouse driven) windows on your desktop.
Often you will want to have several xterms open on your desktop, doing
something different in each one.
To launch subsequent xterms,
double click launchsxterm.bat.
You DO NOT want to click mystartxwin.bat again,
since this script starts the X server,
which is only done once.
Once the X-Windows server is running you can open as many xterms as you need.
You do this by repeatedly clicking launchxterm.bat
To illustrate this, close ALL of your xterms. You can do this either by killing the window it's in, or by typing exit at the prompt.
Notice however, the X in your Task Bar indicating that the X-Windows server is still running. Closing your xterms doesn't shut this down. In fact, with the X server running, all you have to do to get a new xterm is double click launchxterm.bat. Try it.
Now, if you click mystartxwin.bat while you have an already running X server, you will encur an error, even though the xterm does eventually pop up.
To kill the X server, RIGHT-Click on the little X on your Task Bar, choose Exit, and click Exit again in the popup window.
Now you should not see the little X in your Task Bar.
Since you now don't have the X server running, launching an xterm
should fail. You can verify this by
clicking launchxterm.bat
A DOS shell will popup momentarily, but then disappear.
In order to get an xterm again, you have to restart the X server using
mystartxwin.bat.