Unless you are using a Windows or a Unix system with pre-built package manager support (Debian GNU/Linux 2.0, Redhat 5.2, Solaris 2.5), 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. If you are using a Unix system with binary package manager support, please read the manual appropriate to the manager. Respectively, these are `dpkg', `rpm', and `pkgadd'. Swarm uses quite a few libraries and is intended to run under all major flavors of Unix. This presents the unpleasant but largely unavoidable side-effect of making Swarm hard to install. Ideally, you should get the sys-admin for your site to do the job. In any event, the new online Swarm FAQ where we've tried to compile some of the common obstacles to installation, may be useful.
|
Unix. 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, Solaris, libc5- and glibc- based GNU/Linux systems, HPUX 9 and 11, IRIX 5.3 and 6.4, and MachTen/68k. Significant potential obstacles to getting Swarm running on a new Unix platform are 1) poor support for GCC Objective C and 2) portability problems with libffi or ffcall.
Windows NT. We have also ported Swarm to work on Windows NT. The following discussion largely pertains to installing Swarm under Linux/Unix systems. In the case of Windows NT, the installation of the `Prerequisite Programs' is replaced by installing the Cygnus Win32 environment, and a Swarm "Install Shield" has been created to install Swarm on Windows NT (also replacing the job of installing the `Prerequisite Libraries'). Please see the Swarm release page, for more details.
See the Platform News web page for the most up-to-date information.
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/.
gcc 2.7.x / gcc 2.8.x / egcs 1.x. gcc is the FSF's C, C++, and Objective C compiler. You need gcc 2.7.2 or greater installed on your system, including the Objective C support, libobjc.a. The latest version is available from ftp://ftp.gnu.org/pub/gnu/. Note: Swarm will not work with versions of gcc before 2.7.2.
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 is available from 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 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 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.
XPM Library. The XPM library adds pixmap (coloured bitmap) support to X11. XPM 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.
BLT. BLT is an add-on to Tk that provides more widgets. BLT 2.4g is the current version. Another version, BLT 8.0-unoff (SFI) is needed for use with Windows.
ffcall / libffi. Either ffcall or libffi can be used in Swarm to provide the underlying support for message probing. Both libraries provide a portable, high level programming interface to various platform calling conventions. This allows a programmer to call any function specified by a call interface description at run time. ffi stands for Foreign Function Interface. A foreign function interface is the popular name for the interface that allows code written in one language to call code written in another language.
The latest version of ffcall is 1.5
The latest version of libffi is: 1.20
libpng. Swarm requires support for pixmap images - `png' provides that support.
The current version is 1.0.2
zlib. png requires data compression which zlib, a general data compression library, provides.
The current version is 1.1.3.
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).
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.
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 |
SWARMHOME=<path to where Swarm is installed> |
SWARMHOME=/usr/local/swarm-<version_number> |
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, 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.