Installing Swarm

1. Supported Systems

See the Platform News web page for the most up-to-date information.

2. Prerequisite Programs

We assume you already have Unix and X Windows on your system: the rest of this software is freely available. Expect to spend some time compiling and installing these packages. URLs on this page are to the home distribution site: as a convenience, the Swarm ftp site ftp://ftp.santafe.edu/pub/swarm/ contains copies of the necessary packages in needed-software/.

3. Prerequisite Libraries

Swarm uses a variety of freely available software libraries. All of these libraries need to be configured and installed independently of Swarm. When you configure Swarm itself, take a look at the output of "configure --help" to see what "--with-*dir" options are available for locating the installations of these libraries.

4. Configuring and Installing Swarm

Once you have all of the above software installed, the next step is to configure Swarm. First unpack the Swarm .tar.gz file into a convenient place (via gzip -dc swarm-xx.yy.zz.tar.gz | tar xf -).

As of the Swarm 1.2 release, the compilation and installation of Swarm is handled by a GNU configure script. This removes a large burden from the user, as configure has some intelligence which automatically sets many common options.

You first need to read the file INSTALL with the release of Swarm, in the top-level source directory, to determine the appropriate and recent options to give to the configure script (this is analogous to what you needed to do when editing the *INCDIR macros in the obsolete Makefile.conf in earlier releases).

5. Compiling Swarm Libraries -- (not required for binary distributions)

You've done the hard part, now type make, as in earlier releases from the top of the source directory, and watch the fun! If running make in the root Swarm directory does nothing, you probably aren't running GNU Make.

There is now an explicit "installation" step to install Swarm -- make install so that binaries and libraries can be installed cleanly to a specified location. On many Unix systems this likely to somewhere like /usr/local/.

The Makefiles included by user-created libraries, and user-created applications are Makefile.lib, and Makefile.appl, respectively. These distributed with earlier versions are now generated by configure . If you run into problems, the right thing to do is to re-run configure, and re-install Swarm, tinkering with these generated Makefiles directly is not recommended.

6. Compiling and Running Swarm Applications

Swarm applications are distributed separately: you will need to download and unpack applications independently. After the application is unpacked, you will have to change the SWARMHOME variable in the Makefile. It is setup, by default to point to "../swarm", as if the Swarm libraries were in a sibling directory called "swarm". Just edit that string to point to where you installed the Swarm libraries. No other configuration should be necessary. For example in the Makefile for your Swarm application, change:
SWARMHOME=../swarm
to the following format:
SWARMHOME=<path to where Swarm is installed>
For example, a typical place a system admin might install Swarm is:
SWARMHOME=/usr/local/swarm-<version_number>
All you need to do now, to compile an application is type make.

Once the application is compiled, just run it out of its own directory. A control panel and a couple of parameter windows should pop up; press the "Go" button to watch it run. Congratulations!

7. Post-compile cleanup

After you've tried out the Swarm libraries for awhile you may want to clean up the intermediate .o files, and other generated files, in the original source directory. Once you have done the make install you can remove the entire source directory, or if you might want to re-install later with different option, just type make clean to clean-up all files generated by the original make. See your the file INSTALL in the Swarm distribution, for more details.

Just remember to set $(SWARMHOME) to the right directory in your application's makefile. If you have installed Swarm, but for some reason, need to recompile the library and want to start from a completely clean source directory, you can run make uninstall and then make clean- see INSTALL file again here.

For debugging purposes, you should pass the -g option to configure, to whit: CFLAGS=-g ./configure <the rest of your options> and leave the sources in the build or source tree. However, your applications will run faster if you compile with optimization, CFLAGS=-O3 -g. This will make debugging inside the Swarm libraries strange, but gives noticeable performance improvement.