Installing Swarm
Installing Swarm will take some time: various external libraries need
to be acquired, compiled, and installed, and then Swarm itself needs
to be compiled. Please report any problems during installation back so
that we can try to fix them in the future.
Our intention is that Swarm will run on any modern Unix system.
Ideally, Swarm itself should be 100% portable. Swarm is currently
known to be running on SunOS 4.1.3, Linux, HP/UX, SGI Irix,
MachTen/68k, and Solaris 2.4. We anticipate a few minor problems on
systems where the native word size is not 32 bits (DEC Alphas). Some
of the software Swarm uses might not be entirely portable; these
problems are largely out of our hands. The major difficulty so far is
the tricks the GNU Objective C runtime uses do not work properly on
AIX and MachTen/PPC, so Swarm does not work on those systems. Fixing
this is a longterm project; if you absolutely must use Swarm on AIX or
MachTen/PPC, contact us.
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
required-software/.
- gcc 2.7.x
- gcc is the FSF's C, C++, and Objective C compiler.
You need gcc 2.7.x installed on your system, including the Objective C
support, libobjc.a. gcc 2.7.2 is the latest version at this
moment, and is available as
ftp://prep.ai.mit.edu/pub/gnu/gcc-2.7.2.tar.gz.
Note: Swarm will not work with versions of gcc before 2.7.
- GNU make
- Make is used to automate building programs: every OS ships their
own version of make with some random set of features. The Swarm
makefiles currently use features that are not supported by all
makes: GNU make is the only one guaranteed to work. Linux systems
probably use GNU make already. The latest version
of GNU make (3.74 right now) should be available on
ftp://prep.ai.mit.edu/pub/gnu/
- gdb
- gdb is the GNU debugger: Swarm doesn't require this, but
you will probably want gdb on your system to
debug programs. Gdb is available on
ftp://prep.ai.mit.edu/pub/gnu/
Swarm uses a variety of freely available software libraries. All of
these libraries need to be configured and installed independently of
Swarm. When you have installed them all, modify Makefile.conf
in the Swarm library package to tell the compiler and linker where to
find them. Note: it pays to spend the extra time to build shared
library versions of these things.
- libXpm
- libXpm adds pixmap (coloured bitmap) support to X11. libXpm is
a common X library, many systems already have it installed. A
reasonably modern version is needed: we've used version 3.4f. If you
get complaints about "Object" being multiply defined, your
version of libXpm is too old. The library is available from ftp://ftp.x.org/contrib/libraries/xpm-3.4h.tar.gz.
- tk4.0 and tcl7.4
- More common libraries: a scripting language and a GUI
toolkit. You need exactly tk4.0 and tcl7.4 (with their patches)
- older or newer versions do not currently work with swarm (we
plan to upgrade to tk4.1 and
tcl7.5 before version 1.0 release). These libraries are
available from
ftp://ftp.smli.com/pub/tcl/
- BLT-2.1
- BLT is an add-on to Tk that provides more widgets. BLT is
available from
ftp://ftp.neosoft.com/pub/tcl/NEW/
(note - ftp.neosoft.com is about to reorganize the archive, so
the path might change.)
- libtclobjc-1.1b3
- Glue between TCL and Objective C. This version of the library is
currently only
available from the Swarm authors, and is distributed in the same
place as 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 zcat swarm-96xxxx.tar.gz | tar xf -).
All configuration of Swarm compilation is localized to the file
Makefile.conf. You should change the lines OTHERINCDIRS and
OTHERLIBDIRS to point to the directories where the libraries you
installed are, and set OTHERLIBS to link in other OS-dependent libraries
that might be required on your system. In addition, if your OS doesn't
have ranlib, then configure the RANLIB=
line to
just execute /bin/true
.
All of the procedures run by make are defined in the three top level
makefiles Makefile.conf, Makefile.lib, and
Makefile.appl. If you run into problems, you might need to
look at the Makefile code in there.
You've done the hard part, now type "make" and watch the fun! Make
will recursively run make in subdirectories, building libraries,
installing header files in include and libraries in
lib. If running "make" in the root Swarm directory does
nothing, you probably aren't running GNU Make.
Swarm is set up so that you can run make in subdirectories and expect
it to work. If a particular directory doesn't seem to make correctly,
try to cd into that directory and run "make" from there to better see
what the problem is.
Swarm applications are distributed separately: you will need to
download and unpack applications independently. The apps are set up to
be unpacked in a sibling directory to the Swarm libraries: if you
unpack an application elsewhere, you will need to change the
definition of SWARMHOME
in the Makefile. No other
configuration should be necessary. All you need to do to compile an
application is type "make", and it will compile and link.
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!
After you've tried out the Swarm libraries for awhile you may want to
clean up the intermediate .o files. Swarm is set up so that the only
files that you need after compile are
$(SWARMHOME)/Makefile.appl,
$(SWARMHOME)/Makefile.lib,
$(SWARMHOME)/Makefile.conf,
and the contents of
$(SWARMHOME)/lib and
$(SWARMHOME)/include.
If you run make clean
in $(SWARMHOME), it will
throw away all the .o files in the source directories. You can even
copy out the Makefiles, lib, and include to
someplace else on your system: no paths are compiled in. Just remember
to set $(SWARMHOME) to the right directory in your
application's makefile.
For debugging purposes it's easiest if your Swarm libraries are
compiled with OPTFLAGS=-g
and you leave the sources
around. However, your applications will run faster if you compile with
optimization, OPTFLAGS=-O3 -g
. This will make
debugging inside the Swarm libraries strange, but gives noticeable
performance improvement. Users of Sparc based machines should also see
the notes about -mv8 in Makefile.conf.
Nelson Minar <nelson@santafe.edu>
Last modified: Sun May 12 15:13:32 MDT 1996