Using Swarm on Mainline
Spring, 1998

[to be revised]

Note: it would make more sense initially for students just to run the programs in ~ccongdon/Public/Swarm... there's no reason for them to make their own copies of the sources unless/until they are going to start writing Swarm programs. But they will still need to set their environment variables. Here's what should likely happen initially (for example):

cd ~ccongdon/Public/Swarm
setpaths
cd mousetrap
mousetrap
I'll leave the rest for now, since I may have forgotten something, and it may come in handy down the road.

Other demos currently installed are:

heatbugs
hello-world	(three different versions)
market

______________________________________________________________________

To run Swarm, there are a couple of things you need to do:

  1. Make your own copy of the starter files
  2. Set Unix environment variables correctly
  3. Run Swarm
Swarm opens many additional windows, so you will not be able to run it over a telnet session.

Warning: Every step of this process will tax your understanding of Unix.

Get your own copy of the starter files

  1. Login to your home directory

  2. Copy the standard initial Swarm applications to your home directory:
            cp ~ccongdon/Public/Swarm.tar.gz ~/
            
  3. That's what's called a "tarred and compressed file":
    • tar is short for "tape archive". Computer system backups are usually done onto tapes (similar to VCR or audio cassettes). The Unix tar utility makes it easy to take a whole directory and save it as a single file.
    • compressed means that the file is rewritten to use less disk space.

  4. Uncompress the file:
            gunzip Swarm.tar.gz
            
  5. Untar the file:
            tar -xf Swarm.tar
            
  6. Delete the tar file (it's wasting disk space):
            rm Swarm.tar
            
  7. You should now have a new directory called Swarm. This contains Swarm source files for several projects, a tutorial, and a script for setting your environment variables (see the next section for an explanation).

    This does not contain "Swarm itself", which is really just a bunch of libraries and utilities for making these kinds of programs.

    This might be a good time for you to read more about the Swarm project

Set your environment variables

Environment variables are how Unix keeps track of certain things that are true when you (in particular) are logged on. For example, what your home directory is, where software you usually run is located on mainline, and what terminal you're logged in from right now.

To have a peek at these, type

        env
at the Unix prompt right now. Yow.

You need to set a couple more variables so that your Swarm projects can find the libraries, etc., that they need.

There are two ways to do this:

  1. cd to the Swarm directory you just created above, and type
            setpaths
            
    This runs a miniprogram (called a shell script) that should set the variables for you. You'll have to remember to do this every time you want to run Swarm.

  2. Edit your .cshrc file to do the same thing:
    1. Look at ~ccongdon/.cshrc
    2. Change the LD_LIBRARY_PATH line to include /usr/local/lib

      Note: that's all one long line. Make sure it's still one line when you're done.

    3. Add the TCL_LIBRARY and TK_LIBRARY lines
    4. Force Unix to re-read your .cshrc file:
      	        source ~/.cshrc
                      
  3. Compromise: Edit your .cshrc file to run the setpaths script. Add the following line at the end of your .cshrc:
            ~/Swarm/setpaths
            
    and force Unix to re-read your .cshrc file:
    		source ~/.cshrc
                    
If any of that didn't seem to work right, stop and get help. You won't be able to run Swarm unless your environment variables are set correctly.

Run Swarm

Or rather, run one of the Swarm demo applications. Some of these are not yet compiled, so they involve an extra step.
  1. Change to the appropriate directory, e.g.
    	cd ~/Swarm/heatbugs
    	
  2. Compile the application, if necessary, e.g.,
    	gmake heatbugs
    	
  3. Run the application:
    	heatbugs
    	
Note to people who are familiar with Unix and make: you have to use gmake, and not make. (gmake is the Gnu version of make, and is more powerful.)

______________________________________________________________________
Maintained by:

Clare Bates Congdon (ccongdon@brynmawr.edu)
Paul Grobstein (pgrobste@brynmawr.edu)
______________________________________________________________________