<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.swarm.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=SwarmWikiSysop</id>
		<title>Swarm - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://www.swarm.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=SwarmWikiSysop"/>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/wiki/Special:Contributions/SwarmWikiSysop"/>
		<updated>2026-05-02T15:03:57Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.0</generator>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2187</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2187"/>
				<updated>2016-05-16T16:47:37Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* WWW.SWARM.ORG is back! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
=WWW.SWARM.ORG is back!=&lt;br /&gt;
We have restored the Swarm Development Group wiki following a major server crash several years ago. The wiki's emphasis is now on supporting Swarm software and SDG's annual SwarmFest. We will no longer attempt to provide current information on agent-based modeling in general, or on modeling software other than Swarm.&lt;br /&gt;
&lt;br /&gt;
=News=&lt;br /&gt;
==Swarmfest 2016: University of Vermont, July 31 – August 3==&lt;br /&gt;
&lt;br /&gt;
Swamfest is the annual meeting of the Swarm Development Group (SDG), and one of the oldest communities involved in the development and propagation of agent-based modeling.  Swarmfest has traditionally involved a mix of both tool-users and tool-developers, drawn from many domains of expertise. These have included, in the past, computer scientists, software engineers, biomedical researchers, ecologists, economists, political scientists, social scientists, resource management specialists and evolutionary biologists.  Swarmfest represents a low-key environment for researchers to explore new ideas and approaches, and benefit from a multi-disciplinary environment.&lt;br /&gt;
&lt;br /&gt;
SwarmFest 2016 will be at the University of Vermont in Burlington, Vermont, USA. Abstracts are now being accepted. For information [http://www.swarmfest2016.org/ click here.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==New version of Objective-C Swarm for Windows==&lt;br /&gt;
There is a new binary (and source) release of Swarm that works with MinGW, a compiler that produces Windows executables. Advantages of this new way to use Swarm in Windows:&lt;br /&gt;
* Windows executables can be launched directly from Windows, without needing to launch from inside a Unix-like environment.&lt;br /&gt;
* Swarm models can be distributed for use on any Windows computer, without requiring Swarm or MinGW to be installed.&lt;br /&gt;
* Faster execution than Cygwin Swarm.&lt;br /&gt;
See [[Swarm_and_MinGW]]&lt;br /&gt;
&lt;br /&gt;
=Swarm Software for Agent-based Modeling=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm_main_page|The main Swarm page]]''' for Swarm software, documentation, and applications&lt;br /&gt;
&lt;br /&gt;
*''New release of Objective-C for Windows'' produces Windows-native executables! See [[Swarm_and_MinGW|Using Swarm on Windows with MinGW]]&lt;br /&gt;
&lt;br /&gt;
*''[[Swarm:_Mailing_lists|Email lists for support and modeling]]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Agent- and Individual-based Modeling Resources=&lt;br /&gt;
&lt;br /&gt;
'''[[ABM_Resources|Resources for agent-based modeling]]'''. This area of the wiki is for information on agent-based modeling in general. '''This area is no longer maintained and we refer interested people to more up-to-date sites such as [http://www.openabm.org/ www.OpenABM.org]'''&lt;br /&gt;
&lt;br /&gt;
There is still information on:&lt;br /&gt;
*Agent-based modeling community resources&lt;br /&gt;
*Software (information on alternative platforms; learning materials; template models; integrated development environments)&lt;br /&gt;
*&amp;amp;quot;How and why to do agent-based modeling&amp;amp;quot;: techniques and theory&lt;br /&gt;
*Resources specific to different scientific domains&lt;br /&gt;
&lt;br /&gt;
=Swarm Development Group=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm Development Group]] (SDG)'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG contact|Contact information]]'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG_membership|Information on SDG membership]]'''&lt;br /&gt;
&lt;br /&gt;
*An old list of [https://www.ku.edu/~pauljohn/sdg/member_pages/ SDG Members]&lt;br /&gt;
&lt;br /&gt;
=Help=&lt;br /&gt;
* Who can contribute to this wiki? How do you use it? How can you register to edit or add pages? See the [[SwarmWiki:FAQ|FAQ about this wiki]]&lt;br /&gt;
* [[SwarmWiki:Objectives_and_organization|Objectives and organization of this wiki]]: what can you find on this wiki, and what is appropriate to add to it, where?&lt;br /&gt;
* For general wiki help, see: http://www.wikipedia.org/wiki/Wikipedia:Help&lt;br /&gt;
* For help editing the wiki, start with: http://www.wikipedia.org/wiki/Help:Editing&lt;br /&gt;
* To ''experiment with editing'' the wiki without worrying about messing up articles, try the [[Wiki sandbox]]&lt;br /&gt;
* [[SwarmWiki:Help]] Help page for wiki administrators.&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2186</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2186"/>
				<updated>2016-05-16T16:45:54Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* News */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
=WWW.SWARM.ORG is back!=&lt;br /&gt;
We have just restored the Swarm Development Group wiki (October 2015), following a major server crash several years ago. We will be gradually cleaning up the site. Its emphasis will be on supporting Swarm software and SDG's annual SwarmFest. We will no longer attempt to provide current information on agent-based modeling in general, or on modeling software other than Swarm.&lt;br /&gt;
&lt;br /&gt;
=News=&lt;br /&gt;
==Swarmfest 2016: University of Vermont, July 31 – August 3==&lt;br /&gt;
&lt;br /&gt;
Swamfest is the annual meeting of the Swarm Development Group (SDG), and one of the oldest communities involved in the development and propagation of agent-based modeling.  Swarmfest has traditionally involved a mix of both tool-users and tool-developers, drawn from many domains of expertise. These have included, in the past, computer scientists, software engineers, biomedical researchers, ecologists, economists, political scientists, social scientists, resource management specialists and evolutionary biologists.  Swarmfest represents a low-key environment for researchers to explore new ideas and approaches, and benefit from a multi-disciplinary environment.&lt;br /&gt;
&lt;br /&gt;
SwarmFest 2016 will be at the University of Vermont in Burlington, Vermont, USA. Abstracts are now being accepted. For information [http://www.swarmfest2016.org/ click here.]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==New version of Objective-C Swarm for Windows==&lt;br /&gt;
There is a new binary (and source) release of Swarm that works with MinGW, a compiler that produces Windows executables. Advantages of this new way to use Swarm in Windows:&lt;br /&gt;
* Windows executables can be launched directly from Windows, without needing to launch from inside a Unix-like environment.&lt;br /&gt;
* Swarm models can be distributed for use on any Windows computer, without requiring Swarm or MinGW to be installed.&lt;br /&gt;
* Faster execution than Cygwin Swarm.&lt;br /&gt;
See [[Swarm_and_MinGW]]&lt;br /&gt;
&lt;br /&gt;
=Swarm Software for Agent-based Modeling=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm_main_page|The main Swarm page]]''' for Swarm software, documentation, and applications&lt;br /&gt;
&lt;br /&gt;
*''New release of Objective-C for Windows'' produces Windows-native executables! See [[Swarm_and_MinGW|Using Swarm on Windows with MinGW]]&lt;br /&gt;
&lt;br /&gt;
*''[[Swarm:_Mailing_lists|Email lists for support and modeling]]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Agent- and Individual-based Modeling Resources=&lt;br /&gt;
&lt;br /&gt;
'''[[ABM_Resources|Resources for agent-based modeling]]'''. This area of the wiki is for information on agent-based modeling in general. '''This area is no longer maintained and we refer interested people to more up-to-date sites such as [http://www.openabm.org/ www.OpenABM.org]'''&lt;br /&gt;
&lt;br /&gt;
There is still information on:&lt;br /&gt;
*Agent-based modeling community resources&lt;br /&gt;
*Software (information on alternative platforms; learning materials; template models; integrated development environments)&lt;br /&gt;
*&amp;amp;quot;How and why to do agent-based modeling&amp;amp;quot;: techniques and theory&lt;br /&gt;
*Resources specific to different scientific domains&lt;br /&gt;
&lt;br /&gt;
=Swarm Development Group=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm Development Group]] (SDG)'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG contact|Contact information]]'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG_membership|Information on SDG membership]]'''&lt;br /&gt;
&lt;br /&gt;
*An old list of [https://www.ku.edu/~pauljohn/sdg/member_pages/ SDG Members]&lt;br /&gt;
&lt;br /&gt;
=Help=&lt;br /&gt;
* Who can contribute to this wiki? How do you use it? How can you register to edit or add pages? See the [[SwarmWiki:FAQ|FAQ about this wiki]]&lt;br /&gt;
* [[SwarmWiki:Objectives_and_organization|Objectives and organization of this wiki]]: what can you find on this wiki, and what is appropriate to add to it, where?&lt;br /&gt;
* For general wiki help, see: http://www.wikipedia.org/wiki/Wikipedia:Help&lt;br /&gt;
* For help editing the wiki, start with: http://www.wikipedia.org/wiki/Help:Editing&lt;br /&gt;
* To ''experiment with editing'' the wiki without worrying about messing up articles, try the [[Wiki sandbox]]&lt;br /&gt;
* [[SwarmWiki:Help]] Help page for wiki administrators.&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2185</id>
		<title>Swarm:Stable release</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2185"/>
				<updated>2015-12-05T01:19:17Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Swarm source (2.4) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Stable release: Swarm 2.2==&lt;br /&gt;
&lt;br /&gt;
 The following text is partially obsolete: The last stable release of Swarm is 2.4.1, but it was not packaged for Windows using Cygwin. The current Windows package uses MinGW instead of Cygwin.&lt;br /&gt;
&lt;br /&gt;
As of February, 2005, Swarm 2.2 is the new stable release. This release is the culmination of the numerous development snapshots since the previous release (Swarm 2.1.1, which was released in April, 2000). &lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 adds a few new capabilities to Swarm. These include improved support for HDF5 and Lisp archiving of data, with support for serialization; a variety of data summary options added to EZGraph and Averager; and binomial and Poisson random number distributions. Several components have been optimized for efficiency, including the random number generators.&lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 also works reliably in Windows XP, fixes a number of bugs, works around drag-and-drop problems with Tcl/Tk in Windows, and includes a number of changes to speed up model execution.&lt;br /&gt;
&lt;br /&gt;
The documentation set has been updated for Swarm 2.2; it is available from the [[Swarm: documentation|Swarm documentation]] page.&lt;br /&gt;
&lt;br /&gt;
NEWS (user-visible changes)&lt;br /&gt;
&lt;br /&gt;
 * '''See the list of known bugs''', below!&lt;br /&gt;
 * Release Notes for Swarm 2.2&lt;br /&gt;
 ** Numerous bugs have been fixed since 2.1.1&lt;br /&gt;
 ** MacOS X is now supported&lt;br /&gt;
 ** The Windows binaries for java Swarm now use the MingW compiler.&lt;br /&gt;
 ** Two new probability distributions (binomial, Poisson) have been added &lt;br /&gt;
    to the Random library.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
*If downloading a binary from within your web browser, you should do it in such a way that the browser never displays the file on the screen. If you save a file after viewing it, many browsers corrupt it. In Netscape, shift-clicking the url will save it directly to disk.&lt;br /&gt;
*The needed-software directory only applies to building Swarm from source. If you are installing one of the binary distributions, you will not be required to build any packages from source, all relevant packages will either be bundled with your distribution (such as Red Hat and Debian) and/or we provide the appropriate packages in on the ftp site, under the subdirectory relevant for that distribution (list below).&lt;br /&gt;
&lt;br /&gt;
==Packaged (binary) distributions (2.2)==&lt;br /&gt;
The packaged (binary) distributions provide an environment against which user applications can be compiled and linked, without building the Swarm kernel from source.&lt;br /&gt;
&lt;br /&gt;
===Windows binaries===&lt;br /&gt;
 The following text describes the Cygwin distribution of Swarm for Windows. We now strongly recommend instead the MinGW release. See [[Swarm_and_MinGW]].&lt;br /&gt;
&lt;br /&gt;
'''Windows users should see the MinGW package for Swarm here:''' [[Swarm_and_MinGW]] instead of using the following obsolete information, unless they really want to...&lt;br /&gt;
&lt;br /&gt;
'''Windows binaries are different from previous versions!''' In Swarm 2.1.1 and earlier versions, Swarm Windows binaries were distributed as an executable file that installed Cygwin and Swarm on your computer. Swarm 2.2 is distributed by providing a special version of Cygwin that includes Swarm; this version is installed using a special version of the Cygwin setup program. Additional information and instructions are included in the [[Windows binary notes]]. &lt;br /&gt;
&lt;br /&gt;
The Windows binaries are installed via a setup program at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/cygwin/setup.exe&lt;br /&gt;
&lt;br /&gt;
This program downloads and installs Cygwin and Swarm from the internet; you will need a high-speed internet connection. (Alternatives for computers without high-speed access are discussed in [[Windows binary notes]].)&lt;br /&gt;
&lt;br /&gt;
Java binaries for Swarm 2.2 now use the MingW compiler (http://www.mingw.org ) instead of Sun JDK. This means they can be run outside of Cygwin. [http://www.swarm.org/swarmdocs-2.2/set/swarm.installbook.install.article.html Notes for installing Java Swarm] are in the Swarm documentation set. Java binaries for Windows are at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.tar.gz&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.zip&lt;br /&gt;
&lt;br /&gt;
For the latest information you should check out Paul Johnson's [http://www.ku.edu/~pauljohn/SwarmFaq/SwarmOnlineFaq.html online FAQ] or consult the [[Swarm: Mailing lists]] archives.&lt;br /&gt;
&lt;br /&gt;
===GNU/Linux binaries===&lt;br /&gt;
&lt;br /&gt;
Paul Johnson is maintaining [http://pj.freefaculty.org/Swarm/Swarm-Packages/ RPMs and other packages] of Swarm for several Linux distributions.&lt;br /&gt;
&lt;br /&gt;
Charlie Sharpsteen built a [https://launchpad.net/~sdg-team/+archive/ubuntu/stable Swarm site on Launchpad] which provides Swarm as a Ubuntu package. As of February 2015, Swarm can be installed (at least in Ubuntu 12.04) via: &lt;br /&gt;
&lt;br /&gt;
 sudo apt-add-repository ppa:sdg-team/stable&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install libswarm2-dev gobjc-4.5&lt;br /&gt;
&lt;br /&gt;
You may need to edit /usr/etc/swarm/Makefile.common to use gcc-4.5 for CC and OBJC. Ubuntu 12.04 was a long-term support (LTS) release that should be supported until in April 2017.&lt;br /&gt;
&lt;br /&gt;
===MacOS X binaries===&lt;br /&gt;
&lt;br /&gt;
Bill Northcott has produced binaries for MacOS X; see details at [[Swarm: MacOS X binaries]]  These packages include everything other than standard Apple software needed to build and run Swarm models on Panther. Tiger (MacOS X 10.4) is the preferred operating system but older binaries for Panther are available.  There are several versions of the gcc compiler provided, including bleeding edge versions built from the latest code in Apple's opensource cvs. This compiler includes Fortran, libffi and the GNU Objective-C runtime library.&lt;br /&gt;
&lt;br /&gt;
===Other platforms===&lt;br /&gt;
Binaries for other platforms have not been developed. If you develop binaries for another platform, please let us know so they can be shared.&lt;br /&gt;
&lt;br /&gt;
===Binaries of previous versions===&lt;br /&gt;
Legacy binaries (unmaintained) are available here:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/old/&lt;br /&gt;
&lt;br /&gt;
==Swarm source (2.4)==&lt;br /&gt;
The Swarm source distribution includes a complete set of swarm kernel sources and can be found at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/src/swarm/swarm-2.4.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
The user must first install (or verify the availability of) appropriate versions of the needed software in order to provide a proper compilation and execution environment for Swarm. We no longer maintain an up-to-date archive of the packages needed by Swarm, as they are readily found on the web. The list of packages needed by Swarm 2.4 is:&lt;br /&gt;
* Tcl/Tk -- either built from source or using -devel binary packages on your favorite distribution&lt;br /&gt;
* BLT 2.4z, not 3.0&lt;br /&gt;
* libpng 1.2.5&lt;br /&gt;
* zlib 1.2.2&lt;br /&gt;
* xpm-4.2 (or the xpm-nox package for Cygwin)&lt;br /&gt;
* X11R6 on Linux and MacOS X (with SDK)&lt;br /&gt;
* Optionally, HDF5 1.6.2&lt;br /&gt;
* Optionally, Java SDK 1.4.2&lt;br /&gt;
* GCC 3.4.4 with Objective C (gcc-4.0 is preferable particularly on non-x86 platforms such as PowerPC, Alpha etc..)&lt;br /&gt;
* GNU Make&lt;br /&gt;
&lt;br /&gt;
These packages and information on installing them for Swarm are at: [[Swarm_and_MinGW]]&lt;br /&gt;
&lt;br /&gt;
Once the environment has been set up, and the source downloaded and de-tarred into an appropriate directory, the user should consult the &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;INSTALL&amp;lt;/tt&amp;gt; file to learn what options should be specified to the configure script that configures Swarm to the local system. Compilation and linking are done using &amp;lt;tt&amp;gt;make&amp;lt;/tt&amp;gt; as usual, after this step. &lt;br /&gt;
&lt;br /&gt;
You also need an explicit &amp;lt;tt&amp;gt;make install&amp;lt;/tt&amp;gt; step, after the initial &amp;lt;tt&amp;gt;make build&amp;lt;/tt&amp;gt; to cleanly install Swarm to an appropriate location (for example &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt;). This is explained futher in the &amp;lt;tt&amp;gt;README&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;INSTALL&amp;lt;/tt&amp;gt; files contained in the distribution.&lt;br /&gt;
&lt;br /&gt;
After compilation and installation of Swarm a set of program libraries and header files against which Swarm applications can be compiled and linked is available.&lt;br /&gt;
&lt;br /&gt;
==Known bugs and fixes==&lt;br /&gt;
This section describes bugs that are known to exist in the release of version 2.2 and what you can do about them.&lt;br /&gt;
&lt;br /&gt;
===Error in &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; minimum, maximum values===&lt;br /&gt;
Swarm's &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; class (in the Analysis library) calculates statistics over values selected from a collection of objects. The '''&amp;amp;lt;tt&amp;amp;gt;getMin&amp;amp;lt;/tt&amp;amp;gt;''' and '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' methods do not work, and will report values that should easily (if checked) be detected as incorrect. (Note that the Reference Guide does not mention the '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' method but it does exist.) Bug reported here 21 April 2005.&lt;br /&gt;
&lt;br /&gt;
Fixes:&lt;br /&gt;
&lt;br /&gt;
''Windows users'' can download new DLL files with this bug fixed. These are (thanks to Marcus Daniels):&lt;br /&gt;
&lt;br /&gt;
  http://www.santafe.edu/~mgd/javaswarm.dll&lt;br /&gt;
  http://www.santafe.edu/~mgd/cygswarm-0.dll&lt;br /&gt;
&lt;br /&gt;
These would overwrite the equivalent files in the Java/Swarm binary distribution.&lt;br /&gt;
The &amp;amp;lt;tt&amp;amp;gt;cygswarm-0.dll&amp;amp;lt;/tt&amp;amp;gt; goes in &amp;amp;lt;tt&amp;amp;gt;Cygwin/bin&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''RPMs for Redhat Linux'' are available from Paul Johnson; see the link above on this page.&lt;br /&gt;
&lt;br /&gt;
''Builds from source code'' can check out the most recent source code at Swarm's Savannah site (see [[Swarm:_development_snapshot#CVS|CVS]]),  or simply fix the offending line of code:&lt;br /&gt;
&lt;br /&gt;
In &amp;amp;lt;tt&amp;amp;gt;Averager.m&amp;amp;lt;/tt&amp;amp;gt;, change line 106 from &lt;br /&gt;
  '''if (totalCount == 0)''' &lt;br /&gt;
to &lt;br /&gt;
 '''if (totalCount == 0 || count == 0)'''&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2184</id>
		<title>Swarm:Stable release</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2184"/>
				<updated>2015-12-05T01:15:28Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Stable release: Swarm 2.2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Stable release: Swarm 2.2==&lt;br /&gt;
&lt;br /&gt;
 The following text is partially obsolete: The last stable release of Swarm is 2.4.1, but it was not packaged for Windows using Cygwin. The current Windows package uses MinGW instead of Cygwin.&lt;br /&gt;
&lt;br /&gt;
As of February, 2005, Swarm 2.2 is the new stable release. This release is the culmination of the numerous development snapshots since the previous release (Swarm 2.1.1, which was released in April, 2000). &lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 adds a few new capabilities to Swarm. These include improved support for HDF5 and Lisp archiving of data, with support for serialization; a variety of data summary options added to EZGraph and Averager; and binomial and Poisson random number distributions. Several components have been optimized for efficiency, including the random number generators.&lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 also works reliably in Windows XP, fixes a number of bugs, works around drag-and-drop problems with Tcl/Tk in Windows, and includes a number of changes to speed up model execution.&lt;br /&gt;
&lt;br /&gt;
The documentation set has been updated for Swarm 2.2; it is available from the [[Swarm: documentation|Swarm documentation]] page.&lt;br /&gt;
&lt;br /&gt;
NEWS (user-visible changes)&lt;br /&gt;
&lt;br /&gt;
 * '''See the list of known bugs''', below!&lt;br /&gt;
 * Release Notes for Swarm 2.2&lt;br /&gt;
 ** Numerous bugs have been fixed since 2.1.1&lt;br /&gt;
 ** MacOS X is now supported&lt;br /&gt;
 ** The Windows binaries for java Swarm now use the MingW compiler.&lt;br /&gt;
 ** Two new probability distributions (binomial, Poisson) have been added &lt;br /&gt;
    to the Random library.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
*If downloading a binary from within your web browser, you should do it in such a way that the browser never displays the file on the screen. If you save a file after viewing it, many browsers corrupt it. In Netscape, shift-clicking the url will save it directly to disk.&lt;br /&gt;
*The needed-software directory only applies to building Swarm from source. If you are installing one of the binary distributions, you will not be required to build any packages from source, all relevant packages will either be bundled with your distribution (such as Red Hat and Debian) and/or we provide the appropriate packages in on the ftp site, under the subdirectory relevant for that distribution (list below).&lt;br /&gt;
&lt;br /&gt;
==Packaged (binary) distributions (2.2)==&lt;br /&gt;
The packaged (binary) distributions provide an environment against which user applications can be compiled and linked, without building the Swarm kernel from source.&lt;br /&gt;
&lt;br /&gt;
===Windows binaries===&lt;br /&gt;
 The following text describes the Cygwin distribution of Swarm for Windows. We now strongly recommend instead the MinGW release. See [[Swarm_and_MinGW]].&lt;br /&gt;
&lt;br /&gt;
'''Windows users should see the MinGW package for Swarm here:''' [[Swarm_and_MinGW]] instead of using the following obsolete information, unless they really want to...&lt;br /&gt;
&lt;br /&gt;
'''Windows binaries are different from previous versions!''' In Swarm 2.1.1 and earlier versions, Swarm Windows binaries were distributed as an executable file that installed Cygwin and Swarm on your computer. Swarm 2.2 is distributed by providing a special version of Cygwin that includes Swarm; this version is installed using a special version of the Cygwin setup program. Additional information and instructions are included in the [[Windows binary notes]]. &lt;br /&gt;
&lt;br /&gt;
The Windows binaries are installed via a setup program at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/cygwin/setup.exe&lt;br /&gt;
&lt;br /&gt;
This program downloads and installs Cygwin and Swarm from the internet; you will need a high-speed internet connection. (Alternatives for computers without high-speed access are discussed in [[Windows binary notes]].)&lt;br /&gt;
&lt;br /&gt;
Java binaries for Swarm 2.2 now use the MingW compiler (http://www.mingw.org ) instead of Sun JDK. This means they can be run outside of Cygwin. [http://www.swarm.org/swarmdocs-2.2/set/swarm.installbook.install.article.html Notes for installing Java Swarm] are in the Swarm documentation set. Java binaries for Windows are at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.tar.gz&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.zip&lt;br /&gt;
&lt;br /&gt;
For the latest information you should check out Paul Johnson's [http://www.ku.edu/~pauljohn/SwarmFaq/SwarmOnlineFaq.html online FAQ] or consult the [[Swarm: Mailing lists]] archives.&lt;br /&gt;
&lt;br /&gt;
===GNU/Linux binaries===&lt;br /&gt;
&lt;br /&gt;
Paul Johnson is maintaining [http://pj.freefaculty.org/Swarm/Swarm-Packages/ RPMs and other packages] of Swarm for several Linux distributions.&lt;br /&gt;
&lt;br /&gt;
Charlie Sharpsteen built a [https://launchpad.net/~sdg-team/+archive/ubuntu/stable Swarm site on Launchpad] which provides Swarm as a Ubuntu package. As of February 2015, Swarm can be installed (at least in Ubuntu 12.04) via: &lt;br /&gt;
&lt;br /&gt;
 sudo apt-add-repository ppa:sdg-team/stable&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install libswarm2-dev gobjc-4.5&lt;br /&gt;
&lt;br /&gt;
You may need to edit /usr/etc/swarm/Makefile.common to use gcc-4.5 for CC and OBJC. Ubuntu 12.04 was a long-term support (LTS) release that should be supported until in April 2017.&lt;br /&gt;
&lt;br /&gt;
===MacOS X binaries===&lt;br /&gt;
&lt;br /&gt;
Bill Northcott has produced binaries for MacOS X; see details at [[Swarm: MacOS X binaries]]  These packages include everything other than standard Apple software needed to build and run Swarm models on Panther. Tiger (MacOS X 10.4) is the preferred operating system but older binaries for Panther are available.  There are several versions of the gcc compiler provided, including bleeding edge versions built from the latest code in Apple's opensource cvs. This compiler includes Fortran, libffi and the GNU Objective-C runtime library.&lt;br /&gt;
&lt;br /&gt;
===Other platforms===&lt;br /&gt;
Binaries for other platforms have not been developed. If you develop binaries for another platform, please let us know so they can be shared.&lt;br /&gt;
&lt;br /&gt;
===Binaries of previous versions===&lt;br /&gt;
Legacy binaries (unmaintained) are available here:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/old/&lt;br /&gt;
&lt;br /&gt;
==Swarm source (2.4)==&lt;br /&gt;
The Swarm source distribution includes a complete set of swarm kernel sources and can be found at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/src/swarm/swarm-2.4.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
The user must first install (or verify the availability of) appropriate versions of the needed software in order to provide a proper compilation and execution environment for Swarm. We no longer maintain an up-to-date archive of the packages needed by Swarm, as they are readily found on the web. The list of packages needed by Swarm 2.4 is:&lt;br /&gt;
* Tcl/Tk -- either built from source or using -devel binary packages on your favorite distribution&lt;br /&gt;
* BLT 2.4z, not 3.0&lt;br /&gt;
* libpng 1.2.5&lt;br /&gt;
* zlib 1.2.2&lt;br /&gt;
* xpm-4.2 (or the xpm-nox package for Cygwin)&lt;br /&gt;
* X11R6 on Linux and MacOS X (with SDK)&lt;br /&gt;
* Optionally, HDF5 1.6.2&lt;br /&gt;
* Optionally, Java SDK 1.4.2&lt;br /&gt;
* GCC 3.4.4 with Objective C (gcc-4.0 is preferable particularly on non-x86 platforms such as PowerPC, Alpha etc..)&lt;br /&gt;
* GNU Make&lt;br /&gt;
&lt;br /&gt;
Once the environment has been set up, and the source downloaded and de-tarred into an appropriate directory, the user should consult the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; file to learn what options should be specified to the configure script that configures Swarm to the local system. Compilation and linking are done using &amp;amp;lt;tt&amp;amp;gt;make&amp;amp;lt;/tt&amp;amp;gt; as usual, after this step. &lt;br /&gt;
&lt;br /&gt;
You also need an explicit &amp;amp;lt;tt&amp;amp;gt;make install&amp;amp;lt;/tt&amp;amp;gt; step, after the initial &amp;amp;lt;tt&amp;amp;gt;make build&amp;amp;lt;/tt&amp;amp;gt; to cleanly install Swarm to an appropriate location (for example &amp;amp;lt;tt&amp;amp;gt;/usr/local&amp;amp;lt;/tt&amp;amp;gt;). This is explained futher in the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; files contained in the distribution.&lt;br /&gt;
&lt;br /&gt;
After compilation and installation of Swarm a set of program libraries and header files against which Swarm applications can be compiled and linked is available.&lt;br /&gt;
&lt;br /&gt;
==Known bugs and fixes==&lt;br /&gt;
This section describes bugs that are known to exist in the release of version 2.2 and what you can do about them.&lt;br /&gt;
&lt;br /&gt;
===Error in &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; minimum, maximum values===&lt;br /&gt;
Swarm's &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; class (in the Analysis library) calculates statistics over values selected from a collection of objects. The '''&amp;amp;lt;tt&amp;amp;gt;getMin&amp;amp;lt;/tt&amp;amp;gt;''' and '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' methods do not work, and will report values that should easily (if checked) be detected as incorrect. (Note that the Reference Guide does not mention the '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' method but it does exist.) Bug reported here 21 April 2005.&lt;br /&gt;
&lt;br /&gt;
Fixes:&lt;br /&gt;
&lt;br /&gt;
''Windows users'' can download new DLL files with this bug fixed. These are (thanks to Marcus Daniels):&lt;br /&gt;
&lt;br /&gt;
  http://www.santafe.edu/~mgd/javaswarm.dll&lt;br /&gt;
  http://www.santafe.edu/~mgd/cygswarm-0.dll&lt;br /&gt;
&lt;br /&gt;
These would overwrite the equivalent files in the Java/Swarm binary distribution.&lt;br /&gt;
The &amp;amp;lt;tt&amp;amp;gt;cygswarm-0.dll&amp;amp;lt;/tt&amp;amp;gt; goes in &amp;amp;lt;tt&amp;amp;gt;Cygwin/bin&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''RPMs for Redhat Linux'' are available from Paul Johnson; see the link above on this page.&lt;br /&gt;
&lt;br /&gt;
''Builds from source code'' can check out the most recent source code at Swarm's Savannah site (see [[Swarm:_development_snapshot#CVS|CVS]]),  or simply fix the offending line of code:&lt;br /&gt;
&lt;br /&gt;
In &amp;amp;lt;tt&amp;amp;gt;Averager.m&amp;amp;lt;/tt&amp;amp;gt;, change line 106 from &lt;br /&gt;
  '''if (totalCount == 0)''' &lt;br /&gt;
to &lt;br /&gt;
 '''if (totalCount == 0 || count == 0)'''&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2183</id>
		<title>Swarm:Stable release</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2183"/>
				<updated>2015-12-05T01:13:01Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Swarm source (2.2) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Stable release: Swarm 2.2==&lt;br /&gt;
&lt;br /&gt;
As of February, 2005, Swarm 2.2 is the new stable release. This release is the culmination of the numerous development snapshots since the previous release (Swarm 2.1.1, which was released in April, 2000). &lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 adds a few new capabilities to Swarm. These include improved support for HDF5 and Lisp archiving of data, with support for serialization; a variety of data summary options added to EZGraph and Averager; and binomial and Poisson random number distributions. Several components have been optimized for efficiency, including the random number generators.&lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 also works reliably in Windows XP, fixes a number of bugs, works around drag-and-drop problems with Tcl/Tk in Windows, and includes a number of changes to speed up model execution.&lt;br /&gt;
&lt;br /&gt;
The documentation set has been updated for Swarm 2.2; it is available from the [[Swarm: documentation|Swarm documentation]] page.&lt;br /&gt;
&lt;br /&gt;
NEWS (user-visible changes)&lt;br /&gt;
&lt;br /&gt;
 * '''See the list of known bugs''', below!&lt;br /&gt;
 * Release Notes for Swarm 2.2&lt;br /&gt;
 ** Numerous bugs have been fixed since 2.1.1&lt;br /&gt;
 ** MacOS X is now supported&lt;br /&gt;
 ** The Windows binaries for java Swarm now use the MingW compiler.&lt;br /&gt;
 ** Two new probability distributions (binomial, Poisson) have been added &lt;br /&gt;
    to the Random library.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
*If downloading a binary from within your web browser, you should do it in such a way that the browser never displays the file on the screen. If you save a file after viewing it, many browsers corrupt it. In Netscape, shift-clicking the url will save it directly to disk.&lt;br /&gt;
*The needed-software directory only applies to building Swarm from source. If you are installing one of the binary distributions, you will not be required to build any packages from source, all relevant packages will either be bundled with your distribution (such as Red Hat and Debian) and/or we provide the appropriate packages in on the ftp site, under the subdirectory relevant for that distribution (list below).&lt;br /&gt;
&lt;br /&gt;
==Packaged (binary) distributions (2.2)==&lt;br /&gt;
The packaged (binary) distributions provide an environment against which user applications can be compiled and linked, without building the Swarm kernel from source.&lt;br /&gt;
&lt;br /&gt;
===Windows binaries===&lt;br /&gt;
 The following text describes the Cygwin distribution of Swarm for Windows. We now strongly recommend instead the MinGW release. See [[Swarm_and_MinGW]].&lt;br /&gt;
&lt;br /&gt;
'''Windows users should see the MinGW package for Swarm here:''' [[Swarm_and_MinGW]] instead of using the following obsolete information, unless they really want to...&lt;br /&gt;
&lt;br /&gt;
'''Windows binaries are different from previous versions!''' In Swarm 2.1.1 and earlier versions, Swarm Windows binaries were distributed as an executable file that installed Cygwin and Swarm on your computer. Swarm 2.2 is distributed by providing a special version of Cygwin that includes Swarm; this version is installed using a special version of the Cygwin setup program. Additional information and instructions are included in the [[Windows binary notes]]. &lt;br /&gt;
&lt;br /&gt;
The Windows binaries are installed via a setup program at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/cygwin/setup.exe&lt;br /&gt;
&lt;br /&gt;
This program downloads and installs Cygwin and Swarm from the internet; you will need a high-speed internet connection. (Alternatives for computers without high-speed access are discussed in [[Windows binary notes]].)&lt;br /&gt;
&lt;br /&gt;
Java binaries for Swarm 2.2 now use the MingW compiler (http://www.mingw.org ) instead of Sun JDK. This means they can be run outside of Cygwin. [http://www.swarm.org/swarmdocs-2.2/set/swarm.installbook.install.article.html Notes for installing Java Swarm] are in the Swarm documentation set. Java binaries for Windows are at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.tar.gz&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.zip&lt;br /&gt;
&lt;br /&gt;
For the latest information you should check out Paul Johnson's [http://www.ku.edu/~pauljohn/SwarmFaq/SwarmOnlineFaq.html online FAQ] or consult the [[Swarm: Mailing lists]] archives.&lt;br /&gt;
&lt;br /&gt;
===GNU/Linux binaries===&lt;br /&gt;
&lt;br /&gt;
Paul Johnson is maintaining [http://pj.freefaculty.org/Swarm/Swarm-Packages/ RPMs and other packages] of Swarm for several Linux distributions.&lt;br /&gt;
&lt;br /&gt;
Charlie Sharpsteen built a [https://launchpad.net/~sdg-team/+archive/ubuntu/stable Swarm site on Launchpad] which provides Swarm as a Ubuntu package. As of February 2015, Swarm can be installed (at least in Ubuntu 12.04) via: &lt;br /&gt;
&lt;br /&gt;
 sudo apt-add-repository ppa:sdg-team/stable&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install libswarm2-dev gobjc-4.5&lt;br /&gt;
&lt;br /&gt;
You may need to edit /usr/etc/swarm/Makefile.common to use gcc-4.5 for CC and OBJC. Ubuntu 12.04 was a long-term support (LTS) release that should be supported until in April 2017.&lt;br /&gt;
&lt;br /&gt;
===MacOS X binaries===&lt;br /&gt;
&lt;br /&gt;
Bill Northcott has produced binaries for MacOS X; see details at [[Swarm: MacOS X binaries]]  These packages include everything other than standard Apple software needed to build and run Swarm models on Panther. Tiger (MacOS X 10.4) is the preferred operating system but older binaries for Panther are available.  There are several versions of the gcc compiler provided, including bleeding edge versions built from the latest code in Apple's opensource cvs. This compiler includes Fortran, libffi and the GNU Objective-C runtime library.&lt;br /&gt;
&lt;br /&gt;
===Other platforms===&lt;br /&gt;
Binaries for other platforms have not been developed. If you develop binaries for another platform, please let us know so they can be shared.&lt;br /&gt;
&lt;br /&gt;
===Binaries of previous versions===&lt;br /&gt;
Legacy binaries (unmaintained) are available here:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/old/&lt;br /&gt;
&lt;br /&gt;
==Swarm source (2.4)==&lt;br /&gt;
The Swarm source distribution includes a complete set of swarm kernel sources and can be found at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/src/swarm/swarm-2.4.1.tar.gz&lt;br /&gt;
&lt;br /&gt;
The user must first install (or verify the availability of) appropriate versions of the needed software in order to provide a proper compilation and execution environment for Swarm. We no longer maintain an up-to-date archive of the packages needed by Swarm, as they are readily found on the web. The list of packages needed by Swarm 2.4 is:&lt;br /&gt;
* Tcl/Tk -- either built from source or using -devel binary packages on your favorite distribution&lt;br /&gt;
* BLT 2.4z, not 3.0&lt;br /&gt;
* libpng 1.2.5&lt;br /&gt;
* zlib 1.2.2&lt;br /&gt;
* xpm-4.2 (or the xpm-nox package for Cygwin)&lt;br /&gt;
* X11R6 on Linux and MacOS X (with SDK)&lt;br /&gt;
* Optionally, HDF5 1.6.2&lt;br /&gt;
* Optionally, Java SDK 1.4.2&lt;br /&gt;
* GCC 3.4.4 with Objective C (gcc-4.0 is preferable particularly on non-x86 platforms such as PowerPC, Alpha etc..)&lt;br /&gt;
* GNU Make&lt;br /&gt;
&lt;br /&gt;
Once the environment has been set up, and the source downloaded and de-tarred into an appropriate directory, the user should consult the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; file to learn what options should be specified to the configure script that configures Swarm to the local system. Compilation and linking are done using &amp;amp;lt;tt&amp;amp;gt;make&amp;amp;lt;/tt&amp;amp;gt; as usual, after this step. &lt;br /&gt;
&lt;br /&gt;
You also need an explicit &amp;amp;lt;tt&amp;amp;gt;make install&amp;amp;lt;/tt&amp;amp;gt; step, after the initial &amp;amp;lt;tt&amp;amp;gt;make build&amp;amp;lt;/tt&amp;amp;gt; to cleanly install Swarm to an appropriate location (for example &amp;amp;lt;tt&amp;amp;gt;/usr/local&amp;amp;lt;/tt&amp;amp;gt;). This is explained futher in the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; files contained in the distribution.&lt;br /&gt;
&lt;br /&gt;
After compilation and installation of Swarm a set of program libraries and header files against which Swarm applications can be compiled and linked is available.&lt;br /&gt;
&lt;br /&gt;
==Known bugs and fixes==&lt;br /&gt;
This section describes bugs that are known to exist in the release of version 2.2 and what you can do about them.&lt;br /&gt;
&lt;br /&gt;
===Error in &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; minimum, maximum values===&lt;br /&gt;
Swarm's &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; class (in the Analysis library) calculates statistics over values selected from a collection of objects. The '''&amp;amp;lt;tt&amp;amp;gt;getMin&amp;amp;lt;/tt&amp;amp;gt;''' and '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' methods do not work, and will report values that should easily (if checked) be detected as incorrect. (Note that the Reference Guide does not mention the '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' method but it does exist.) Bug reported here 21 April 2005.&lt;br /&gt;
&lt;br /&gt;
Fixes:&lt;br /&gt;
&lt;br /&gt;
''Windows users'' can download new DLL files with this bug fixed. These are (thanks to Marcus Daniels):&lt;br /&gt;
&lt;br /&gt;
  http://www.santafe.edu/~mgd/javaswarm.dll&lt;br /&gt;
  http://www.santafe.edu/~mgd/cygswarm-0.dll&lt;br /&gt;
&lt;br /&gt;
These would overwrite the equivalent files in the Java/Swarm binary distribution.&lt;br /&gt;
The &amp;amp;lt;tt&amp;amp;gt;cygswarm-0.dll&amp;amp;lt;/tt&amp;amp;gt; goes in &amp;amp;lt;tt&amp;amp;gt;Cygwin/bin&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''RPMs for Redhat Linux'' are available from Paul Johnson; see the link above on this page.&lt;br /&gt;
&lt;br /&gt;
''Builds from source code'' can check out the most recent source code at Swarm's Savannah site (see [[Swarm:_development_snapshot#CVS|CVS]]),  or simply fix the offending line of code:&lt;br /&gt;
&lt;br /&gt;
In &amp;amp;lt;tt&amp;amp;gt;Averager.m&amp;amp;lt;/tt&amp;amp;gt;, change line 106 from &lt;br /&gt;
  '''if (totalCount == 0)''' &lt;br /&gt;
to &lt;br /&gt;
 '''if (totalCount == 0 || count == 0)'''&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2182</id>
		<title>Swarm:Stable release</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2182"/>
				<updated>2015-12-05T01:10:48Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Binaries of previous versions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Stable release: Swarm 2.2==&lt;br /&gt;
&lt;br /&gt;
As of February, 2005, Swarm 2.2 is the new stable release. This release is the culmination of the numerous development snapshots since the previous release (Swarm 2.1.1, which was released in April, 2000). &lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 adds a few new capabilities to Swarm. These include improved support for HDF5 and Lisp archiving of data, with support for serialization; a variety of data summary options added to EZGraph and Averager; and binomial and Poisson random number distributions. Several components have been optimized for efficiency, including the random number generators.&lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 also works reliably in Windows XP, fixes a number of bugs, works around drag-and-drop problems with Tcl/Tk in Windows, and includes a number of changes to speed up model execution.&lt;br /&gt;
&lt;br /&gt;
The documentation set has been updated for Swarm 2.2; it is available from the [[Swarm: documentation|Swarm documentation]] page.&lt;br /&gt;
&lt;br /&gt;
NEWS (user-visible changes)&lt;br /&gt;
&lt;br /&gt;
 * '''See the list of known bugs''', below!&lt;br /&gt;
 * Release Notes for Swarm 2.2&lt;br /&gt;
 ** Numerous bugs have been fixed since 2.1.1&lt;br /&gt;
 ** MacOS X is now supported&lt;br /&gt;
 ** The Windows binaries for java Swarm now use the MingW compiler.&lt;br /&gt;
 ** Two new probability distributions (binomial, Poisson) have been added &lt;br /&gt;
    to the Random library.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
*If downloading a binary from within your web browser, you should do it in such a way that the browser never displays the file on the screen. If you save a file after viewing it, many browsers corrupt it. In Netscape, shift-clicking the url will save it directly to disk.&lt;br /&gt;
*The needed-software directory only applies to building Swarm from source. If you are installing one of the binary distributions, you will not be required to build any packages from source, all relevant packages will either be bundled with your distribution (such as Red Hat and Debian) and/or we provide the appropriate packages in on the ftp site, under the subdirectory relevant for that distribution (list below).&lt;br /&gt;
&lt;br /&gt;
==Packaged (binary) distributions (2.2)==&lt;br /&gt;
The packaged (binary) distributions provide an environment against which user applications can be compiled and linked, without building the Swarm kernel from source.&lt;br /&gt;
&lt;br /&gt;
===Windows binaries===&lt;br /&gt;
 The following text describes the Cygwin distribution of Swarm for Windows. We now strongly recommend instead the MinGW release. See [[Swarm_and_MinGW]].&lt;br /&gt;
&lt;br /&gt;
'''Windows users should see the MinGW package for Swarm here:''' [[Swarm_and_MinGW]] instead of using the following obsolete information, unless they really want to...&lt;br /&gt;
&lt;br /&gt;
'''Windows binaries are different from previous versions!''' In Swarm 2.1.1 and earlier versions, Swarm Windows binaries were distributed as an executable file that installed Cygwin and Swarm on your computer. Swarm 2.2 is distributed by providing a special version of Cygwin that includes Swarm; this version is installed using a special version of the Cygwin setup program. Additional information and instructions are included in the [[Windows binary notes]]. &lt;br /&gt;
&lt;br /&gt;
The Windows binaries are installed via a setup program at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/cygwin/setup.exe&lt;br /&gt;
&lt;br /&gt;
This program downloads and installs Cygwin and Swarm from the internet; you will need a high-speed internet connection. (Alternatives for computers without high-speed access are discussed in [[Windows binary notes]].)&lt;br /&gt;
&lt;br /&gt;
Java binaries for Swarm 2.2 now use the MingW compiler (http://www.mingw.org ) instead of Sun JDK. This means they can be run outside of Cygwin. [http://www.swarm.org/swarmdocs-2.2/set/swarm.installbook.install.article.html Notes for installing Java Swarm] are in the Swarm documentation set. Java binaries for Windows are at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.tar.gz&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.zip&lt;br /&gt;
&lt;br /&gt;
For the latest information you should check out Paul Johnson's [http://www.ku.edu/~pauljohn/SwarmFaq/SwarmOnlineFaq.html online FAQ] or consult the [[Swarm: Mailing lists]] archives.&lt;br /&gt;
&lt;br /&gt;
===GNU/Linux binaries===&lt;br /&gt;
&lt;br /&gt;
Paul Johnson is maintaining [http://pj.freefaculty.org/Swarm/Swarm-Packages/ RPMs and other packages] of Swarm for several Linux distributions.&lt;br /&gt;
&lt;br /&gt;
Charlie Sharpsteen built a [https://launchpad.net/~sdg-team/+archive/ubuntu/stable Swarm site on Launchpad] which provides Swarm as a Ubuntu package. As of February 2015, Swarm can be installed (at least in Ubuntu 12.04) via: &lt;br /&gt;
&lt;br /&gt;
 sudo apt-add-repository ppa:sdg-team/stable&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install libswarm2-dev gobjc-4.5&lt;br /&gt;
&lt;br /&gt;
You may need to edit /usr/etc/swarm/Makefile.common to use gcc-4.5 for CC and OBJC. Ubuntu 12.04 was a long-term support (LTS) release that should be supported until in April 2017.&lt;br /&gt;
&lt;br /&gt;
===MacOS X binaries===&lt;br /&gt;
&lt;br /&gt;
Bill Northcott has produced binaries for MacOS X; see details at [[Swarm: MacOS X binaries]]  These packages include everything other than standard Apple software needed to build and run Swarm models on Panther. Tiger (MacOS X 10.4) is the preferred operating system but older binaries for Panther are available.  There are several versions of the gcc compiler provided, including bleeding edge versions built from the latest code in Apple's opensource cvs. This compiler includes Fortran, libffi and the GNU Objective-C runtime library.&lt;br /&gt;
&lt;br /&gt;
===Other platforms===&lt;br /&gt;
Binaries for other platforms have not been developed. If you develop binaries for another platform, please let us know so they can be shared.&lt;br /&gt;
&lt;br /&gt;
===Binaries of previous versions===&lt;br /&gt;
Legacy binaries (unmaintained) are available here:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/old/&lt;br /&gt;
&lt;br /&gt;
==Swarm source (2.2)==&lt;br /&gt;
The Swarm source distribution includes a complete set of swarm kernel sources and can be found at:&lt;br /&gt;
*ftp://ftp.swarm.org/pub/swarm/src/swarm/swarm-2.2.tar.gz &lt;br /&gt;
&lt;br /&gt;
The user must first install (or verify the availability of) appropriate versions of the needed software in order to provide a proper compilation and execution environment for Swarm. We no longer maintain an up-to-date archive of the packages needed by Swarm, as they are readily found on the web. The list of packages needed by Swarm 2.2 is:&lt;br /&gt;
* Tcl/Tk -- either built from source or using -devel binary packages on your favorite distribution&lt;br /&gt;
* BLT 2.4z, not 3.0&lt;br /&gt;
* libpng 1.2.5&lt;br /&gt;
* zlib 1.2.2&lt;br /&gt;
* xpm-4.2 (or the xpm-nox package for Cygwin)&lt;br /&gt;
* X11R6 on Linux and MacOS X (with SDK)&lt;br /&gt;
* Optionally, HDF5 1.6.2&lt;br /&gt;
* Optionally, Java SDK 1.4.2&lt;br /&gt;
* GCC 3.4.4 with Objective C (gcc-4.0 is preferable particularly on non-x86 platforms such as PowerPC, Alpha etc..)&lt;br /&gt;
* GNU Make&lt;br /&gt;
&lt;br /&gt;
Once the environment has been set up, and the source downloaded and de-tarred into an appropriate directory, the user should consult the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; file to learn what options should be specified to the configure script that configures Swarm to the local system. Compilation and linking are done using &amp;amp;lt;tt&amp;amp;gt;make&amp;amp;lt;/tt&amp;amp;gt; as usual, after this step.&lt;br /&gt;
&lt;br /&gt;
You also need an explicit &amp;amp;lt;tt&amp;amp;gt;make install&amp;amp;lt;/tt&amp;amp;gt; step, after the initial &amp;amp;lt;tt&amp;amp;gt;make build&amp;amp;lt;/tt&amp;amp;gt; to cleanly install Swarm to an appropriate location (for example &amp;amp;lt;tt&amp;amp;gt;/usr/local&amp;amp;lt;/tt&amp;amp;gt;). This is explained futher in the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; files contained in the distribution.&lt;br /&gt;
&lt;br /&gt;
After compilation and installation of Swarm a set of program libraries and header files against which Swarm applications can be compiled and linked is available.&lt;br /&gt;
&lt;br /&gt;
==Known bugs and fixes==&lt;br /&gt;
This section describes bugs that are known to exist in the release of version 2.2 and what you can do about them.&lt;br /&gt;
&lt;br /&gt;
===Error in &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; minimum, maximum values===&lt;br /&gt;
Swarm's &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; class (in the Analysis library) calculates statistics over values selected from a collection of objects. The '''&amp;amp;lt;tt&amp;amp;gt;getMin&amp;amp;lt;/tt&amp;amp;gt;''' and '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' methods do not work, and will report values that should easily (if checked) be detected as incorrect. (Note that the Reference Guide does not mention the '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' method but it does exist.) Bug reported here 21 April 2005.&lt;br /&gt;
&lt;br /&gt;
Fixes:&lt;br /&gt;
&lt;br /&gt;
''Windows users'' can download new DLL files with this bug fixed. These are (thanks to Marcus Daniels):&lt;br /&gt;
&lt;br /&gt;
  http://www.santafe.edu/~mgd/javaswarm.dll&lt;br /&gt;
  http://www.santafe.edu/~mgd/cygswarm-0.dll&lt;br /&gt;
&lt;br /&gt;
These would overwrite the equivalent files in the Java/Swarm binary distribution.&lt;br /&gt;
The &amp;amp;lt;tt&amp;amp;gt;cygswarm-0.dll&amp;amp;lt;/tt&amp;amp;gt; goes in &amp;amp;lt;tt&amp;amp;gt;Cygwin/bin&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''RPMs for Redhat Linux'' are available from Paul Johnson; see the link above on this page.&lt;br /&gt;
&lt;br /&gt;
''Builds from source code'' can check out the most recent source code at Swarm's Savannah site (see [[Swarm:_development_snapshot#CVS|CVS]]),  or simply fix the offending line of code:&lt;br /&gt;
&lt;br /&gt;
In &amp;amp;lt;tt&amp;amp;gt;Averager.m&amp;amp;lt;/tt&amp;amp;gt;, change line 106 from &lt;br /&gt;
  '''if (totalCount == 0)''' &lt;br /&gt;
to &lt;br /&gt;
 '''if (totalCount == 0 || count == 0)'''&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2181</id>
		<title>Swarm:Stable release</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2181"/>
				<updated>2015-12-05T01:08:52Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Windows binaries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Stable release: Swarm 2.2==&lt;br /&gt;
&lt;br /&gt;
As of February, 2005, Swarm 2.2 is the new stable release. This release is the culmination of the numerous development snapshots since the previous release (Swarm 2.1.1, which was released in April, 2000). &lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 adds a few new capabilities to Swarm. These include improved support for HDF5 and Lisp archiving of data, with support for serialization; a variety of data summary options added to EZGraph and Averager; and binomial and Poisson random number distributions. Several components have been optimized for efficiency, including the random number generators.&lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 also works reliably in Windows XP, fixes a number of bugs, works around drag-and-drop problems with Tcl/Tk in Windows, and includes a number of changes to speed up model execution.&lt;br /&gt;
&lt;br /&gt;
The documentation set has been updated for Swarm 2.2; it is available from the [[Swarm: documentation|Swarm documentation]] page.&lt;br /&gt;
&lt;br /&gt;
NEWS (user-visible changes)&lt;br /&gt;
&lt;br /&gt;
 * '''See the list of known bugs''', below!&lt;br /&gt;
 * Release Notes for Swarm 2.2&lt;br /&gt;
 ** Numerous bugs have been fixed since 2.1.1&lt;br /&gt;
 ** MacOS X is now supported&lt;br /&gt;
 ** The Windows binaries for java Swarm now use the MingW compiler.&lt;br /&gt;
 ** Two new probability distributions (binomial, Poisson) have been added &lt;br /&gt;
    to the Random library.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
*If downloading a binary from within your web browser, you should do it in such a way that the browser never displays the file on the screen. If you save a file after viewing it, many browsers corrupt it. In Netscape, shift-clicking the url will save it directly to disk.&lt;br /&gt;
*The needed-software directory only applies to building Swarm from source. If you are installing one of the binary distributions, you will not be required to build any packages from source, all relevant packages will either be bundled with your distribution (such as Red Hat and Debian) and/or we provide the appropriate packages in on the ftp site, under the subdirectory relevant for that distribution (list below).&lt;br /&gt;
&lt;br /&gt;
==Packaged (binary) distributions (2.2)==&lt;br /&gt;
The packaged (binary) distributions provide an environment against which user applications can be compiled and linked, without building the Swarm kernel from source.&lt;br /&gt;
&lt;br /&gt;
===Windows binaries===&lt;br /&gt;
 The following text describes the Cygwin distribution of Swarm for Windows. We now strongly recommend instead the MinGW release. See [[Swarm_and_MinGW]].&lt;br /&gt;
&lt;br /&gt;
'''Windows users should see the MinGW package for Swarm here:''' [[Swarm_and_MinGW]] instead of using the following obsolete information, unless they really want to...&lt;br /&gt;
&lt;br /&gt;
'''Windows binaries are different from previous versions!''' In Swarm 2.1.1 and earlier versions, Swarm Windows binaries were distributed as an executable file that installed Cygwin and Swarm on your computer. Swarm 2.2 is distributed by providing a special version of Cygwin that includes Swarm; this version is installed using a special version of the Cygwin setup program. Additional information and instructions are included in the [[Windows binary notes]]. &lt;br /&gt;
&lt;br /&gt;
The Windows binaries are installed via a setup program at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/cygwin/setup.exe&lt;br /&gt;
&lt;br /&gt;
This program downloads and installs Cygwin and Swarm from the internet; you will need a high-speed internet connection. (Alternatives for computers without high-speed access are discussed in [[Windows binary notes]].)&lt;br /&gt;
&lt;br /&gt;
Java binaries for Swarm 2.2 now use the MingW compiler (http://www.mingw.org ) instead of Sun JDK. This means they can be run outside of Cygwin. [http://www.swarm.org/swarmdocs-2.2/set/swarm.installbook.install.article.html Notes for installing Java Swarm] are in the Swarm documentation set. Java binaries for Windows are at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.tar.gz&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.zip&lt;br /&gt;
&lt;br /&gt;
For the latest information you should check out Paul Johnson's [http://www.ku.edu/~pauljohn/SwarmFaq/SwarmOnlineFaq.html online FAQ] or consult the [[Swarm: Mailing lists]] archives.&lt;br /&gt;
&lt;br /&gt;
===GNU/Linux binaries===&lt;br /&gt;
&lt;br /&gt;
Paul Johnson is maintaining [http://pj.freefaculty.org/Swarm/Swarm-Packages/ RPMs and other packages] of Swarm for several Linux distributions.&lt;br /&gt;
&lt;br /&gt;
Charlie Sharpsteen built a [https://launchpad.net/~sdg-team/+archive/ubuntu/stable Swarm site on Launchpad] which provides Swarm as a Ubuntu package. As of February 2015, Swarm can be installed (at least in Ubuntu 12.04) via: &lt;br /&gt;
&lt;br /&gt;
 sudo apt-add-repository ppa:sdg-team/stable&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install libswarm2-dev gobjc-4.5&lt;br /&gt;
&lt;br /&gt;
You may need to edit /usr/etc/swarm/Makefile.common to use gcc-4.5 for CC and OBJC. Ubuntu 12.04 was a long-term support (LTS) release that should be supported until in April 2017.&lt;br /&gt;
&lt;br /&gt;
===MacOS X binaries===&lt;br /&gt;
&lt;br /&gt;
Bill Northcott has produced binaries for MacOS X; see details at [[Swarm: MacOS X binaries]]  These packages include everything other than standard Apple software needed to build and run Swarm models on Panther. Tiger (MacOS X 10.4) is the preferred operating system but older binaries for Panther are available.  There are several versions of the gcc compiler provided, including bleeding edge versions built from the latest code in Apple's opensource cvs. This compiler includes Fortran, libffi and the GNU Objective-C runtime library.&lt;br /&gt;
&lt;br /&gt;
===Other platforms===&lt;br /&gt;
Binaries for other platforms have not been developed. If you develop binaries for another platform, please let us know so they can be shared.&lt;br /&gt;
&lt;br /&gt;
===Binaries of previous versions===&lt;br /&gt;
Legacy binaries (unmaintained) are available here:&lt;br /&gt;
*http://ftp.swarm.org/pub/swarm/binaries/old/&lt;br /&gt;
&amp;amp;lt;!-- commented out obsoleted binaries &lt;br /&gt;
    * Windows 9x, Windows NT 4, or Windows 2000. &lt;br /&gt;
          o Development Kit Note: very large (50 MB), you may wish to order a CD-ROM&lt;br /&gt;
          o&lt;br /&gt;
           Demos&lt;br /&gt;
    *&lt;br /&gt;
      Debian GNU/Linux 2.2. &lt;br /&gt;
          o&lt;br /&gt;
            ix86&lt;br /&gt;
          o&lt;br /&gt;
            sparc&lt;br /&gt;
    *      Red Hat GNU/Linux. &lt;br /&gt;
          o&lt;br /&gt;
            Red Hat 6.1 / x86&lt;br /&gt;
          o&lt;br /&gt;
            Red Hat 6.1 / sparc&lt;br /&gt;
          o&lt;br /&gt;
            LinuxPPC R5 (1999)&lt;br /&gt;
    *&lt;br /&gt;
      SuSE 6.3 GNU/Linux. &lt;br /&gt;
          o&lt;br /&gt;
            x86&lt;br /&gt;
    *&lt;br /&gt;
      Solaris 2.7. &lt;br /&gt;
          o&lt;br /&gt;
            Sparc&lt;br /&gt;
--&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Swarm source (2.2)==&lt;br /&gt;
The Swarm source distribution includes a complete set of swarm kernel sources and can be found at:&lt;br /&gt;
*ftp://ftp.swarm.org/pub/swarm/src/swarm/swarm-2.2.tar.gz &lt;br /&gt;
&lt;br /&gt;
The user must first install (or verify the availability of) appropriate versions of the needed software in order to provide a proper compilation and execution environment for Swarm. We no longer maintain an up-to-date archive of the packages needed by Swarm, as they are readily found on the web. The list of packages needed by Swarm 2.2 is:&lt;br /&gt;
* Tcl/Tk -- either built from source or using -devel binary packages on your favorite distribution&lt;br /&gt;
* BLT 2.4z, not 3.0&lt;br /&gt;
* libpng 1.2.5&lt;br /&gt;
* zlib 1.2.2&lt;br /&gt;
* xpm-4.2 (or the xpm-nox package for Cygwin)&lt;br /&gt;
* X11R6 on Linux and MacOS X (with SDK)&lt;br /&gt;
* Optionally, HDF5 1.6.2&lt;br /&gt;
* Optionally, Java SDK 1.4.2&lt;br /&gt;
* GCC 3.4.4 with Objective C (gcc-4.0 is preferable particularly on non-x86 platforms such as PowerPC, Alpha etc..)&lt;br /&gt;
* GNU Make&lt;br /&gt;
&lt;br /&gt;
Once the environment has been set up, and the source downloaded and de-tarred into an appropriate directory, the user should consult the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; file to learn what options should be specified to the configure script that configures Swarm to the local system. Compilation and linking are done using &amp;amp;lt;tt&amp;amp;gt;make&amp;amp;lt;/tt&amp;amp;gt; as usual, after this step.&lt;br /&gt;
&lt;br /&gt;
You also need an explicit &amp;amp;lt;tt&amp;amp;gt;make install&amp;amp;lt;/tt&amp;amp;gt; step, after the initial &amp;amp;lt;tt&amp;amp;gt;make build&amp;amp;lt;/tt&amp;amp;gt; to cleanly install Swarm to an appropriate location (for example &amp;amp;lt;tt&amp;amp;gt;/usr/local&amp;amp;lt;/tt&amp;amp;gt;). This is explained futher in the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; files contained in the distribution.&lt;br /&gt;
&lt;br /&gt;
After compilation and installation of Swarm a set of program libraries and header files against which Swarm applications can be compiled and linked is available.&lt;br /&gt;
&lt;br /&gt;
==Known bugs and fixes==&lt;br /&gt;
This section describes bugs that are known to exist in the release of version 2.2 and what you can do about them.&lt;br /&gt;
&lt;br /&gt;
===Error in &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; minimum, maximum values===&lt;br /&gt;
Swarm's &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; class (in the Analysis library) calculates statistics over values selected from a collection of objects. The '''&amp;amp;lt;tt&amp;amp;gt;getMin&amp;amp;lt;/tt&amp;amp;gt;''' and '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' methods do not work, and will report values that should easily (if checked) be detected as incorrect. (Note that the Reference Guide does not mention the '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' method but it does exist.) Bug reported here 21 April 2005.&lt;br /&gt;
&lt;br /&gt;
Fixes:&lt;br /&gt;
&lt;br /&gt;
''Windows users'' can download new DLL files with this bug fixed. These are (thanks to Marcus Daniels):&lt;br /&gt;
&lt;br /&gt;
  http://www.santafe.edu/~mgd/javaswarm.dll&lt;br /&gt;
  http://www.santafe.edu/~mgd/cygswarm-0.dll&lt;br /&gt;
&lt;br /&gt;
These would overwrite the equivalent files in the Java/Swarm binary distribution.&lt;br /&gt;
The &amp;amp;lt;tt&amp;amp;gt;cygswarm-0.dll&amp;amp;lt;/tt&amp;amp;gt; goes in &amp;amp;lt;tt&amp;amp;gt;Cygwin/bin&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''RPMs for Redhat Linux'' are available from Paul Johnson; see the link above on this page.&lt;br /&gt;
&lt;br /&gt;
''Builds from source code'' can check out the most recent source code at Swarm's Savannah site (see [[Swarm:_development_snapshot#CVS|CVS]]),  or simply fix the offending line of code:&lt;br /&gt;
&lt;br /&gt;
In &amp;amp;lt;tt&amp;amp;gt;Averager.m&amp;amp;lt;/tt&amp;amp;gt;, change line 106 from &lt;br /&gt;
  '''if (totalCount == 0)''' &lt;br /&gt;
to &lt;br /&gt;
 '''if (totalCount == 0 || count == 0)'''&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2180</id>
		<title>Swarm:Stable release</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2180"/>
				<updated>2015-12-05T01:06:13Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Windows binaries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Stable release: Swarm 2.2==&lt;br /&gt;
&lt;br /&gt;
As of February, 2005, Swarm 2.2 is the new stable release. This release is the culmination of the numerous development snapshots since the previous release (Swarm 2.1.1, which was released in April, 2000). &lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 adds a few new capabilities to Swarm. These include improved support for HDF5 and Lisp archiving of data, with support for serialization; a variety of data summary options added to EZGraph and Averager; and binomial and Poisson random number distributions. Several components have been optimized for efficiency, including the random number generators.&lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 also works reliably in Windows XP, fixes a number of bugs, works around drag-and-drop problems with Tcl/Tk in Windows, and includes a number of changes to speed up model execution.&lt;br /&gt;
&lt;br /&gt;
The documentation set has been updated for Swarm 2.2; it is available from the [[Swarm: documentation|Swarm documentation]] page.&lt;br /&gt;
&lt;br /&gt;
NEWS (user-visible changes)&lt;br /&gt;
&lt;br /&gt;
 * '''See the list of known bugs''', below!&lt;br /&gt;
 * Release Notes for Swarm 2.2&lt;br /&gt;
 ** Numerous bugs have been fixed since 2.1.1&lt;br /&gt;
 ** MacOS X is now supported&lt;br /&gt;
 ** The Windows binaries for java Swarm now use the MingW compiler.&lt;br /&gt;
 ** Two new probability distributions (binomial, Poisson) have been added &lt;br /&gt;
    to the Random library.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
*If downloading a binary from within your web browser, you should do it in such a way that the browser never displays the file on the screen. If you save a file after viewing it, many browsers corrupt it. In Netscape, shift-clicking the url will save it directly to disk.&lt;br /&gt;
*The needed-software directory only applies to building Swarm from source. If you are installing one of the binary distributions, you will not be required to build any packages from source, all relevant packages will either be bundled with your distribution (such as Red Hat and Debian) and/or we provide the appropriate packages in on the ftp site, under the subdirectory relevant for that distribution (list below).&lt;br /&gt;
&lt;br /&gt;
==Packaged (binary) distributions (2.2)==&lt;br /&gt;
The packaged (binary) distributions provide an environment against which user applications can be compiled and linked, without building the Swarm kernel from source.&lt;br /&gt;
&lt;br /&gt;
===Windows binaries===&lt;br /&gt;
 The following text describes the Cygwin distribution of Swarm for Windows. We now strongly recommend instead the MinGW release. See [[Swarm_and_MinGW]].&lt;br /&gt;
&lt;br /&gt;
'''Windows binaries are different from previous versions!''' In Swarm 2.1.1 and earlier versions, Swarm Windows binaries were distributed as an executable file that installed Cygwin and Swarm on your computer. Swarm 2.2 is distributed by providing a special version of Cygwin that includes Swarm; this version is installed using a special version of the Cygwin setup program. Additional information and instructions are included in the [[Windows binary notes]]. &lt;br /&gt;
&lt;br /&gt;
The Windows binaries are installed via a setup program at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/cygwin/setup.exe&lt;br /&gt;
&lt;br /&gt;
This program downloads and installs Cygwin and Swarm from the internet; you will need a high-speed internet connection. (Alternatives for computers without high-speed access are discussed in [[Windows binary notes]].)&lt;br /&gt;
&lt;br /&gt;
Java binaries for Swarm 2.2 now use the MingW compiler (http://www.mingw.org ) instead of Sun JDK. This means they can be run outside of Cygwin. [http://www.swarm.org/swarmdocs-2.2/set/swarm.installbook.install.article.html Notes for installing Java Swarm] are in the Swarm documentation set. Java binaries for Windows are at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.tar.gz&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.zip&lt;br /&gt;
&lt;br /&gt;
For the latest information you should check out Paul Johnson's [http://www.ku.edu/~pauljohn/SwarmFaq/SwarmOnlineFaq.html online FAQ] or consult the [[Swarm: Mailing lists]] archives.&lt;br /&gt;
&lt;br /&gt;
===GNU/Linux binaries===&lt;br /&gt;
&lt;br /&gt;
Paul Johnson is maintaining [http://pj.freefaculty.org/Swarm/Swarm-Packages/ RPMs and other packages] of Swarm for several Linux distributions.&lt;br /&gt;
&lt;br /&gt;
Charlie Sharpsteen built a [https://launchpad.net/~sdg-team/+archive/ubuntu/stable Swarm site on Launchpad] which provides Swarm as a Ubuntu package. As of February 2015, Swarm can be installed (at least in Ubuntu 12.04) via: &lt;br /&gt;
&lt;br /&gt;
 sudo apt-add-repository ppa:sdg-team/stable&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install libswarm2-dev gobjc-4.5&lt;br /&gt;
&lt;br /&gt;
You may need to edit /usr/etc/swarm/Makefile.common to use gcc-4.5 for CC and OBJC. Ubuntu 12.04 was a long-term support (LTS) release that should be supported until in April 2017.&lt;br /&gt;
&lt;br /&gt;
===MacOS X binaries===&lt;br /&gt;
&lt;br /&gt;
Bill Northcott has produced binaries for MacOS X; see details at [[Swarm: MacOS X binaries]]  These packages include everything other than standard Apple software needed to build and run Swarm models on Panther. Tiger (MacOS X 10.4) is the preferred operating system but older binaries for Panther are available.  There are several versions of the gcc compiler provided, including bleeding edge versions built from the latest code in Apple's opensource cvs. This compiler includes Fortran, libffi and the GNU Objective-C runtime library.&lt;br /&gt;
&lt;br /&gt;
===Other platforms===&lt;br /&gt;
Binaries for other platforms have not been developed. If you develop binaries for another platform, please let us know so they can be shared.&lt;br /&gt;
&lt;br /&gt;
===Binaries of previous versions===&lt;br /&gt;
Legacy binaries (unmaintained) are available here:&lt;br /&gt;
*http://ftp.swarm.org/pub/swarm/binaries/old/&lt;br /&gt;
&amp;amp;lt;!-- commented out obsoleted binaries &lt;br /&gt;
    * Windows 9x, Windows NT 4, or Windows 2000. &lt;br /&gt;
          o Development Kit Note: very large (50 MB), you may wish to order a CD-ROM&lt;br /&gt;
          o&lt;br /&gt;
           Demos&lt;br /&gt;
    *&lt;br /&gt;
      Debian GNU/Linux 2.2. &lt;br /&gt;
          o&lt;br /&gt;
            ix86&lt;br /&gt;
          o&lt;br /&gt;
            sparc&lt;br /&gt;
    *      Red Hat GNU/Linux. &lt;br /&gt;
          o&lt;br /&gt;
            Red Hat 6.1 / x86&lt;br /&gt;
          o&lt;br /&gt;
            Red Hat 6.1 / sparc&lt;br /&gt;
          o&lt;br /&gt;
            LinuxPPC R5 (1999)&lt;br /&gt;
    *&lt;br /&gt;
      SuSE 6.3 GNU/Linux. &lt;br /&gt;
          o&lt;br /&gt;
            x86&lt;br /&gt;
    *&lt;br /&gt;
      Solaris 2.7. &lt;br /&gt;
          o&lt;br /&gt;
            Sparc&lt;br /&gt;
--&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Swarm source (2.2)==&lt;br /&gt;
The Swarm source distribution includes a complete set of swarm kernel sources and can be found at:&lt;br /&gt;
*ftp://ftp.swarm.org/pub/swarm/src/swarm/swarm-2.2.tar.gz &lt;br /&gt;
&lt;br /&gt;
The user must first install (or verify the availability of) appropriate versions of the needed software in order to provide a proper compilation and execution environment for Swarm. We no longer maintain an up-to-date archive of the packages needed by Swarm, as they are readily found on the web. The list of packages needed by Swarm 2.2 is:&lt;br /&gt;
* Tcl/Tk -- either built from source or using -devel binary packages on your favorite distribution&lt;br /&gt;
* BLT 2.4z, not 3.0&lt;br /&gt;
* libpng 1.2.5&lt;br /&gt;
* zlib 1.2.2&lt;br /&gt;
* xpm-4.2 (or the xpm-nox package for Cygwin)&lt;br /&gt;
* X11R6 on Linux and MacOS X (with SDK)&lt;br /&gt;
* Optionally, HDF5 1.6.2&lt;br /&gt;
* Optionally, Java SDK 1.4.2&lt;br /&gt;
* GCC 3.4.4 with Objective C (gcc-4.0 is preferable particularly on non-x86 platforms such as PowerPC, Alpha etc..)&lt;br /&gt;
* GNU Make&lt;br /&gt;
&lt;br /&gt;
Once the environment has been set up, and the source downloaded and de-tarred into an appropriate directory, the user should consult the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; file to learn what options should be specified to the configure script that configures Swarm to the local system. Compilation and linking are done using &amp;amp;lt;tt&amp;amp;gt;make&amp;amp;lt;/tt&amp;amp;gt; as usual, after this step.&lt;br /&gt;
&lt;br /&gt;
You also need an explicit &amp;amp;lt;tt&amp;amp;gt;make install&amp;amp;lt;/tt&amp;amp;gt; step, after the initial &amp;amp;lt;tt&amp;amp;gt;make build&amp;amp;lt;/tt&amp;amp;gt; to cleanly install Swarm to an appropriate location (for example &amp;amp;lt;tt&amp;amp;gt;/usr/local&amp;amp;lt;/tt&amp;amp;gt;). This is explained futher in the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; files contained in the distribution.&lt;br /&gt;
&lt;br /&gt;
After compilation and installation of Swarm a set of program libraries and header files against which Swarm applications can be compiled and linked is available.&lt;br /&gt;
&lt;br /&gt;
==Known bugs and fixes==&lt;br /&gt;
This section describes bugs that are known to exist in the release of version 2.2 and what you can do about them.&lt;br /&gt;
&lt;br /&gt;
===Error in &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; minimum, maximum values===&lt;br /&gt;
Swarm's &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; class (in the Analysis library) calculates statistics over values selected from a collection of objects. The '''&amp;amp;lt;tt&amp;amp;gt;getMin&amp;amp;lt;/tt&amp;amp;gt;''' and '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' methods do not work, and will report values that should easily (if checked) be detected as incorrect. (Note that the Reference Guide does not mention the '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' method but it does exist.) Bug reported here 21 April 2005.&lt;br /&gt;
&lt;br /&gt;
Fixes:&lt;br /&gt;
&lt;br /&gt;
''Windows users'' can download new DLL files with this bug fixed. These are (thanks to Marcus Daniels):&lt;br /&gt;
&lt;br /&gt;
  http://www.santafe.edu/~mgd/javaswarm.dll&lt;br /&gt;
  http://www.santafe.edu/~mgd/cygswarm-0.dll&lt;br /&gt;
&lt;br /&gt;
These would overwrite the equivalent files in the Java/Swarm binary distribution.&lt;br /&gt;
The &amp;amp;lt;tt&amp;amp;gt;cygswarm-0.dll&amp;amp;lt;/tt&amp;amp;gt; goes in &amp;amp;lt;tt&amp;amp;gt;Cygwin/bin&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''RPMs for Redhat Linux'' are available from Paul Johnson; see the link above on this page.&lt;br /&gt;
&lt;br /&gt;
''Builds from source code'' can check out the most recent source code at Swarm's Savannah site (see [[Swarm:_development_snapshot#CVS|CVS]]),  or simply fix the offending line of code:&lt;br /&gt;
&lt;br /&gt;
In &amp;amp;lt;tt&amp;amp;gt;Averager.m&amp;amp;lt;/tt&amp;amp;gt;, change line 106 from &lt;br /&gt;
  '''if (totalCount == 0)''' &lt;br /&gt;
to &lt;br /&gt;
 '''if (totalCount == 0 || count == 0)'''&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2179</id>
		<title>Swarm:Stable release</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2179"/>
				<updated>2015-12-05T01:04:17Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Windows binaries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Stable release: Swarm 2.2==&lt;br /&gt;
&lt;br /&gt;
As of February, 2005, Swarm 2.2 is the new stable release. This release is the culmination of the numerous development snapshots since the previous release (Swarm 2.1.1, which was released in April, 2000). &lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 adds a few new capabilities to Swarm. These include improved support for HDF5 and Lisp archiving of data, with support for serialization; a variety of data summary options added to EZGraph and Averager; and binomial and Poisson random number distributions. Several components have been optimized for efficiency, including the random number generators.&lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 also works reliably in Windows XP, fixes a number of bugs, works around drag-and-drop problems with Tcl/Tk in Windows, and includes a number of changes to speed up model execution.&lt;br /&gt;
&lt;br /&gt;
The documentation set has been updated for Swarm 2.2; it is available from the [[Swarm: documentation|Swarm documentation]] page.&lt;br /&gt;
&lt;br /&gt;
NEWS (user-visible changes)&lt;br /&gt;
&lt;br /&gt;
 * '''See the list of known bugs''', below!&lt;br /&gt;
 * Release Notes for Swarm 2.2&lt;br /&gt;
 ** Numerous bugs have been fixed since 2.1.1&lt;br /&gt;
 ** MacOS X is now supported&lt;br /&gt;
 ** The Windows binaries for java Swarm now use the MingW compiler.&lt;br /&gt;
 ** Two new probability distributions (binomial, Poisson) have been added &lt;br /&gt;
    to the Random library.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
*If downloading a binary from within your web browser, you should do it in such a way that the browser never displays the file on the screen. If you save a file after viewing it, many browsers corrupt it. In Netscape, shift-clicking the url will save it directly to disk.&lt;br /&gt;
*The needed-software directory only applies to building Swarm from source. If you are installing one of the binary distributions, you will not be required to build any packages from source, all relevant packages will either be bundled with your distribution (such as Red Hat and Debian) and/or we provide the appropriate packages in on the ftp site, under the subdirectory relevant for that distribution (list below).&lt;br /&gt;
&lt;br /&gt;
==Packaged (binary) distributions (2.2)==&lt;br /&gt;
The packaged (binary) distributions provide an environment against which user applications can be compiled and linked, without building the Swarm kernel from source.&lt;br /&gt;
&lt;br /&gt;
===Windows binaries===&lt;br /&gt;
 The following text describes the Cygwin distribution of Swarm for Windows. We now strongly recommend instead the MinGW release. See &lt;br /&gt;
&lt;br /&gt;
'''Windows binaries are different from previous versions!''' In Swarm 2.1.1 and earlier versions, Swarm Windows binaries were distributed as an executable file that installed Cygwin and Swarm on your computer. Swarm 2.2 is distributed by providing a special version of Cygwin that includes Swarm; this version is installed using a special version of the Cygwin setup program. Additional information and instructions are included in the [[Windows binary notes]]. &lt;br /&gt;
&lt;br /&gt;
The Windows binaries are installed via a setup program at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/cygwin/setup.exe&lt;br /&gt;
&lt;br /&gt;
This program downloads and installs Cygwin and Swarm from the internet; you will need a high-speed internet connection. (Alternatives for computers without high-speed access are discussed in [[Windows binary notes]].)&lt;br /&gt;
&lt;br /&gt;
Java binaries for Swarm 2.2 now use the MingW compiler (http://www.mingw.org ) instead of Sun JDK. This means they can be run outside of Cygwin. [http://www.swarm.org/swarmdocs-2.2/set/swarm.installbook.install.article.html Notes for installing Java Swarm] are in the Swarm documentation set. Java binaries for Windows are at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.tar.gz&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.zip&lt;br /&gt;
&lt;br /&gt;
For the latest information you should check out Paul Johnson's [http://www.ku.edu/~pauljohn/SwarmFaq/SwarmOnlineFaq.html online FAQ] or consult the [[Swarm: Mailing lists]] archives.&lt;br /&gt;
&lt;br /&gt;
===GNU/Linux binaries===&lt;br /&gt;
&lt;br /&gt;
Paul Johnson is maintaining [http://pj.freefaculty.org/Swarm/Swarm-Packages/ RPMs and other packages] of Swarm for several Linux distributions.&lt;br /&gt;
&lt;br /&gt;
Charlie Sharpsteen built a [https://launchpad.net/~sdg-team/+archive/ubuntu/stable Swarm site on Launchpad] which provides Swarm as a Ubuntu package. As of February 2015, Swarm can be installed (at least in Ubuntu 12.04) via: &lt;br /&gt;
&lt;br /&gt;
 sudo apt-add-repository ppa:sdg-team/stable&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install libswarm2-dev gobjc-4.5&lt;br /&gt;
&lt;br /&gt;
You may need to edit /usr/etc/swarm/Makefile.common to use gcc-4.5 for CC and OBJC. Ubuntu 12.04 was a long-term support (LTS) release that should be supported until in April 2017.&lt;br /&gt;
&lt;br /&gt;
===MacOS X binaries===&lt;br /&gt;
&lt;br /&gt;
Bill Northcott has produced binaries for MacOS X; see details at [[Swarm: MacOS X binaries]]  These packages include everything other than standard Apple software needed to build and run Swarm models on Panther. Tiger (MacOS X 10.4) is the preferred operating system but older binaries for Panther are available.  There are several versions of the gcc compiler provided, including bleeding edge versions built from the latest code in Apple's opensource cvs. This compiler includes Fortran, libffi and the GNU Objective-C runtime library.&lt;br /&gt;
&lt;br /&gt;
===Other platforms===&lt;br /&gt;
Binaries for other platforms have not been developed. If you develop binaries for another platform, please let us know so they can be shared.&lt;br /&gt;
&lt;br /&gt;
===Binaries of previous versions===&lt;br /&gt;
Legacy binaries (unmaintained) are available here:&lt;br /&gt;
*http://ftp.swarm.org/pub/swarm/binaries/old/&lt;br /&gt;
&amp;amp;lt;!-- commented out obsoleted binaries &lt;br /&gt;
    * Windows 9x, Windows NT 4, or Windows 2000. &lt;br /&gt;
          o Development Kit Note: very large (50 MB), you may wish to order a CD-ROM&lt;br /&gt;
          o&lt;br /&gt;
           Demos&lt;br /&gt;
    *&lt;br /&gt;
      Debian GNU/Linux 2.2. &lt;br /&gt;
          o&lt;br /&gt;
            ix86&lt;br /&gt;
          o&lt;br /&gt;
            sparc&lt;br /&gt;
    *      Red Hat GNU/Linux. &lt;br /&gt;
          o&lt;br /&gt;
            Red Hat 6.1 / x86&lt;br /&gt;
          o&lt;br /&gt;
            Red Hat 6.1 / sparc&lt;br /&gt;
          o&lt;br /&gt;
            LinuxPPC R5 (1999)&lt;br /&gt;
    *&lt;br /&gt;
      SuSE 6.3 GNU/Linux. &lt;br /&gt;
          o&lt;br /&gt;
            x86&lt;br /&gt;
    *&lt;br /&gt;
      Solaris 2.7. &lt;br /&gt;
          o&lt;br /&gt;
            Sparc&lt;br /&gt;
--&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Swarm source (2.2)==&lt;br /&gt;
The Swarm source distribution includes a complete set of swarm kernel sources and can be found at:&lt;br /&gt;
*ftp://ftp.swarm.org/pub/swarm/src/swarm/swarm-2.2.tar.gz &lt;br /&gt;
&lt;br /&gt;
The user must first install (or verify the availability of) appropriate versions of the needed software in order to provide a proper compilation and execution environment for Swarm. We no longer maintain an up-to-date archive of the packages needed by Swarm, as they are readily found on the web. The list of packages needed by Swarm 2.2 is:&lt;br /&gt;
* Tcl/Tk -- either built from source or using -devel binary packages on your favorite distribution&lt;br /&gt;
* BLT 2.4z, not 3.0&lt;br /&gt;
* libpng 1.2.5&lt;br /&gt;
* zlib 1.2.2&lt;br /&gt;
* xpm-4.2 (or the xpm-nox package for Cygwin)&lt;br /&gt;
* X11R6 on Linux and MacOS X (with SDK)&lt;br /&gt;
* Optionally, HDF5 1.6.2&lt;br /&gt;
* Optionally, Java SDK 1.4.2&lt;br /&gt;
* GCC 3.4.4 with Objective C (gcc-4.0 is preferable particularly on non-x86 platforms such as PowerPC, Alpha etc..)&lt;br /&gt;
* GNU Make&lt;br /&gt;
&lt;br /&gt;
Once the environment has been set up, and the source downloaded and de-tarred into an appropriate directory, the user should consult the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; file to learn what options should be specified to the configure script that configures Swarm to the local system. Compilation and linking are done using &amp;amp;lt;tt&amp;amp;gt;make&amp;amp;lt;/tt&amp;amp;gt; as usual, after this step.&lt;br /&gt;
&lt;br /&gt;
You also need an explicit &amp;amp;lt;tt&amp;amp;gt;make install&amp;amp;lt;/tt&amp;amp;gt; step, after the initial &amp;amp;lt;tt&amp;amp;gt;make build&amp;amp;lt;/tt&amp;amp;gt; to cleanly install Swarm to an appropriate location (for example &amp;amp;lt;tt&amp;amp;gt;/usr/local&amp;amp;lt;/tt&amp;amp;gt;). This is explained futher in the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; files contained in the distribution.&lt;br /&gt;
&lt;br /&gt;
After compilation and installation of Swarm a set of program libraries and header files against which Swarm applications can be compiled and linked is available.&lt;br /&gt;
&lt;br /&gt;
==Known bugs and fixes==&lt;br /&gt;
This section describes bugs that are known to exist in the release of version 2.2 and what you can do about them.&lt;br /&gt;
&lt;br /&gt;
===Error in &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; minimum, maximum values===&lt;br /&gt;
Swarm's &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; class (in the Analysis library) calculates statistics over values selected from a collection of objects. The '''&amp;amp;lt;tt&amp;amp;gt;getMin&amp;amp;lt;/tt&amp;amp;gt;''' and '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' methods do not work, and will report values that should easily (if checked) be detected as incorrect. (Note that the Reference Guide does not mention the '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' method but it does exist.) Bug reported here 21 April 2005.&lt;br /&gt;
&lt;br /&gt;
Fixes:&lt;br /&gt;
&lt;br /&gt;
''Windows users'' can download new DLL files with this bug fixed. These are (thanks to Marcus Daniels):&lt;br /&gt;
&lt;br /&gt;
  http://www.santafe.edu/~mgd/javaswarm.dll&lt;br /&gt;
  http://www.santafe.edu/~mgd/cygswarm-0.dll&lt;br /&gt;
&lt;br /&gt;
These would overwrite the equivalent files in the Java/Swarm binary distribution.&lt;br /&gt;
The &amp;amp;lt;tt&amp;amp;gt;cygswarm-0.dll&amp;amp;lt;/tt&amp;amp;gt; goes in &amp;amp;lt;tt&amp;amp;gt;Cygwin/bin&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''RPMs for Redhat Linux'' are available from Paul Johnson; see the link above on this page.&lt;br /&gt;
&lt;br /&gt;
''Builds from source code'' can check out the most recent source code at Swarm's Savannah site (see [[Swarm:_development_snapshot#CVS|CVS]]),  or simply fix the offending line of code:&lt;br /&gt;
&lt;br /&gt;
In &amp;amp;lt;tt&amp;amp;gt;Averager.m&amp;amp;lt;/tt&amp;amp;gt;, change line 106 from &lt;br /&gt;
  '''if (totalCount == 0)''' &lt;br /&gt;
to &lt;br /&gt;
 '''if (totalCount == 0 || count == 0)'''&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2178</id>
		<title>Swarm:Stable release</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2178"/>
				<updated>2015-12-05T00:59:49Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* GNU/Linux binaries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Stable release: Swarm 2.2==&lt;br /&gt;
&lt;br /&gt;
As of February, 2005, Swarm 2.2 is the new stable release. This release is the culmination of the numerous development snapshots since the previous release (Swarm 2.1.1, which was released in April, 2000). &lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 adds a few new capabilities to Swarm. These include improved support for HDF5 and Lisp archiving of data, with support for serialization; a variety of data summary options added to EZGraph and Averager; and binomial and Poisson random number distributions. Several components have been optimized for efficiency, including the random number generators.&lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 also works reliably in Windows XP, fixes a number of bugs, works around drag-and-drop problems with Tcl/Tk in Windows, and includes a number of changes to speed up model execution.&lt;br /&gt;
&lt;br /&gt;
The documentation set has been updated for Swarm 2.2; it is available from the [[Swarm: documentation|Swarm documentation]] page.&lt;br /&gt;
&lt;br /&gt;
NEWS (user-visible changes)&lt;br /&gt;
&lt;br /&gt;
 * '''See the list of known bugs''', below!&lt;br /&gt;
 * Release Notes for Swarm 2.2&lt;br /&gt;
 ** Numerous bugs have been fixed since 2.1.1&lt;br /&gt;
 ** MacOS X is now supported&lt;br /&gt;
 ** The Windows binaries for java Swarm now use the MingW compiler.&lt;br /&gt;
 ** Two new probability distributions (binomial, Poisson) have been added &lt;br /&gt;
    to the Random library.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
*If downloading a binary from within your web browser, you should do it in such a way that the browser never displays the file on the screen. If you save a file after viewing it, many browsers corrupt it. In Netscape, shift-clicking the url will save it directly to disk.&lt;br /&gt;
*The needed-software directory only applies to building Swarm from source. If you are installing one of the binary distributions, you will not be required to build any packages from source, all relevant packages will either be bundled with your distribution (such as Red Hat and Debian) and/or we provide the appropriate packages in on the ftp site, under the subdirectory relevant for that distribution (list below).&lt;br /&gt;
&lt;br /&gt;
==Packaged (binary) distributions (2.2)==&lt;br /&gt;
The packaged (binary) distributions provide an environment against which user applications can be compiled and linked, without building the Swarm kernel from source.&lt;br /&gt;
&lt;br /&gt;
===Windows binaries===&lt;br /&gt;
'''Windows binaries are different from previous versions!''' In Swarm 2.1.1 and earlier versions, Swarm Windows binaries were distributed as an executable file that installed Cygwin and Swarm on your computer. Swarm 2.2 is distributed by providing a special version of Cygwin that includes Swarm; this version is installed using a special version of the Cygwin setup program. Additional information and instructions are included in the [[Windows binary notes]]. &lt;br /&gt;
&lt;br /&gt;
The Windows binaries are installed via a setup program at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/cygwin/setup.exe&lt;br /&gt;
&lt;br /&gt;
This program downloads and installs Cygwin and Swarm from the internet; you will need a high-speed internet connection. (Alternatives for computers without high-speed access are discussed in [[Windows binary notes]].)&lt;br /&gt;
&lt;br /&gt;
Java binaries for Swarm 2.2 now use the MingW compiler (http://www.mingw.org ) instead of Sun JDK. This means they can be run outside of Cygwin. [http://www.swarm.org/swarmdocs-2.2/set/swarm.installbook.install.article.html Notes for installing Java Swarm] are in the Swarm documentation set. Java binaries for Windows are at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.tar.gz&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.zip&lt;br /&gt;
&lt;br /&gt;
For the latest information you should check out Paul Johnson's [http://www.ku.edu/~pauljohn/SwarmFaq/SwarmOnlineFaq.html online FAQ] or consult the [[Swarm: Mailing lists]] archives.&lt;br /&gt;
&lt;br /&gt;
===GNU/Linux binaries===&lt;br /&gt;
&lt;br /&gt;
Paul Johnson is maintaining [http://pj.freefaculty.org/Swarm/Swarm-Packages/ RPMs and other packages] of Swarm for several Linux distributions.&lt;br /&gt;
&lt;br /&gt;
Charlie Sharpsteen built a [https://launchpad.net/~sdg-team/+archive/ubuntu/stable Swarm site on Launchpad] which provides Swarm as a Ubuntu package. As of February 2015, Swarm can be installed (at least in Ubuntu 12.04) via: &lt;br /&gt;
&lt;br /&gt;
 sudo apt-add-repository ppa:sdg-team/stable&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install libswarm2-dev gobjc-4.5&lt;br /&gt;
&lt;br /&gt;
You may need to edit /usr/etc/swarm/Makefile.common to use gcc-4.5 for CC and OBJC. Ubuntu 12.04 was a long-term support (LTS) release that should be supported until in April 2017.&lt;br /&gt;
&lt;br /&gt;
===MacOS X binaries===&lt;br /&gt;
&lt;br /&gt;
Bill Northcott has produced binaries for MacOS X; see details at [[Swarm: MacOS X binaries]]  These packages include everything other than standard Apple software needed to build and run Swarm models on Panther. Tiger (MacOS X 10.4) is the preferred operating system but older binaries for Panther are available.  There are several versions of the gcc compiler provided, including bleeding edge versions built from the latest code in Apple's opensource cvs. This compiler includes Fortran, libffi and the GNU Objective-C runtime library.&lt;br /&gt;
&lt;br /&gt;
===Other platforms===&lt;br /&gt;
Binaries for other platforms have not been developed. If you develop binaries for another platform, please let us know so they can be shared.&lt;br /&gt;
&lt;br /&gt;
===Binaries of previous versions===&lt;br /&gt;
Legacy binaries (unmaintained) are available here:&lt;br /&gt;
*http://ftp.swarm.org/pub/swarm/binaries/old/&lt;br /&gt;
&amp;amp;lt;!-- commented out obsoleted binaries &lt;br /&gt;
    * Windows 9x, Windows NT 4, or Windows 2000. &lt;br /&gt;
          o Development Kit Note: very large (50 MB), you may wish to order a CD-ROM&lt;br /&gt;
          o&lt;br /&gt;
           Demos&lt;br /&gt;
    *&lt;br /&gt;
      Debian GNU/Linux 2.2. &lt;br /&gt;
          o&lt;br /&gt;
            ix86&lt;br /&gt;
          o&lt;br /&gt;
            sparc&lt;br /&gt;
    *      Red Hat GNU/Linux. &lt;br /&gt;
          o&lt;br /&gt;
            Red Hat 6.1 / x86&lt;br /&gt;
          o&lt;br /&gt;
            Red Hat 6.1 / sparc&lt;br /&gt;
          o&lt;br /&gt;
            LinuxPPC R5 (1999)&lt;br /&gt;
    *&lt;br /&gt;
      SuSE 6.3 GNU/Linux. &lt;br /&gt;
          o&lt;br /&gt;
            x86&lt;br /&gt;
    *&lt;br /&gt;
      Solaris 2.7. &lt;br /&gt;
          o&lt;br /&gt;
            Sparc&lt;br /&gt;
--&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Swarm source (2.2)==&lt;br /&gt;
The Swarm source distribution includes a complete set of swarm kernel sources and can be found at:&lt;br /&gt;
*ftp://ftp.swarm.org/pub/swarm/src/swarm/swarm-2.2.tar.gz &lt;br /&gt;
&lt;br /&gt;
The user must first install (or verify the availability of) appropriate versions of the needed software in order to provide a proper compilation and execution environment for Swarm. We no longer maintain an up-to-date archive of the packages needed by Swarm, as they are readily found on the web. The list of packages needed by Swarm 2.2 is:&lt;br /&gt;
* Tcl/Tk -- either built from source or using -devel binary packages on your favorite distribution&lt;br /&gt;
* BLT 2.4z, not 3.0&lt;br /&gt;
* libpng 1.2.5&lt;br /&gt;
* zlib 1.2.2&lt;br /&gt;
* xpm-4.2 (or the xpm-nox package for Cygwin)&lt;br /&gt;
* X11R6 on Linux and MacOS X (with SDK)&lt;br /&gt;
* Optionally, HDF5 1.6.2&lt;br /&gt;
* Optionally, Java SDK 1.4.2&lt;br /&gt;
* GCC 3.4.4 with Objective C (gcc-4.0 is preferable particularly on non-x86 platforms such as PowerPC, Alpha etc..)&lt;br /&gt;
* GNU Make&lt;br /&gt;
&lt;br /&gt;
Once the environment has been set up, and the source downloaded and de-tarred into an appropriate directory, the user should consult the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; file to learn what options should be specified to the configure script that configures Swarm to the local system. Compilation and linking are done using &amp;amp;lt;tt&amp;amp;gt;make&amp;amp;lt;/tt&amp;amp;gt; as usual, after this step.&lt;br /&gt;
&lt;br /&gt;
You also need an explicit &amp;amp;lt;tt&amp;amp;gt;make install&amp;amp;lt;/tt&amp;amp;gt; step, after the initial &amp;amp;lt;tt&amp;amp;gt;make build&amp;amp;lt;/tt&amp;amp;gt; to cleanly install Swarm to an appropriate location (for example &amp;amp;lt;tt&amp;amp;gt;/usr/local&amp;amp;lt;/tt&amp;amp;gt;). This is explained futher in the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; files contained in the distribution.&lt;br /&gt;
&lt;br /&gt;
After compilation and installation of Swarm a set of program libraries and header files against which Swarm applications can be compiled and linked is available.&lt;br /&gt;
&lt;br /&gt;
==Known bugs and fixes==&lt;br /&gt;
This section describes bugs that are known to exist in the release of version 2.2 and what you can do about them.&lt;br /&gt;
&lt;br /&gt;
===Error in &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; minimum, maximum values===&lt;br /&gt;
Swarm's &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; class (in the Analysis library) calculates statistics over values selected from a collection of objects. The '''&amp;amp;lt;tt&amp;amp;gt;getMin&amp;amp;lt;/tt&amp;amp;gt;''' and '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' methods do not work, and will report values that should easily (if checked) be detected as incorrect. (Note that the Reference Guide does not mention the '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' method but it does exist.) Bug reported here 21 April 2005.&lt;br /&gt;
&lt;br /&gt;
Fixes:&lt;br /&gt;
&lt;br /&gt;
''Windows users'' can download new DLL files with this bug fixed. These are (thanks to Marcus Daniels):&lt;br /&gt;
&lt;br /&gt;
  http://www.santafe.edu/~mgd/javaswarm.dll&lt;br /&gt;
  http://www.santafe.edu/~mgd/cygswarm-0.dll&lt;br /&gt;
&lt;br /&gt;
These would overwrite the equivalent files in the Java/Swarm binary distribution.&lt;br /&gt;
The &amp;amp;lt;tt&amp;amp;gt;cygswarm-0.dll&amp;amp;lt;/tt&amp;amp;gt; goes in &amp;amp;lt;tt&amp;amp;gt;Cygwin/bin&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''RPMs for Redhat Linux'' are available from Paul Johnson; see the link above on this page.&lt;br /&gt;
&lt;br /&gt;
''Builds from source code'' can check out the most recent source code at Swarm's Savannah site (see [[Swarm:_development_snapshot#CVS|CVS]]),  or simply fix the offending line of code:&lt;br /&gt;
&lt;br /&gt;
In &amp;amp;lt;tt&amp;amp;gt;Averager.m&amp;amp;lt;/tt&amp;amp;gt;, change line 106 from &lt;br /&gt;
  '''if (totalCount == 0)''' &lt;br /&gt;
to &lt;br /&gt;
 '''if (totalCount == 0 || count == 0)'''&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2177</id>
		<title>Swarm:Stable release</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2177"/>
				<updated>2015-12-05T00:53:29Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* GNU/Linux binaries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Stable release: Swarm 2.2==&lt;br /&gt;
&lt;br /&gt;
As of February, 2005, Swarm 2.2 is the new stable release. This release is the culmination of the numerous development snapshots since the previous release (Swarm 2.1.1, which was released in April, 2000). &lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 adds a few new capabilities to Swarm. These include improved support for HDF5 and Lisp archiving of data, with support for serialization; a variety of data summary options added to EZGraph and Averager; and binomial and Poisson random number distributions. Several components have been optimized for efficiency, including the random number generators.&lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 also works reliably in Windows XP, fixes a number of bugs, works around drag-and-drop problems with Tcl/Tk in Windows, and includes a number of changes to speed up model execution.&lt;br /&gt;
&lt;br /&gt;
The documentation set has been updated for Swarm 2.2; it is available from the [[Swarm: documentation|Swarm documentation]] page.&lt;br /&gt;
&lt;br /&gt;
NEWS (user-visible changes)&lt;br /&gt;
&lt;br /&gt;
 * '''See the list of known bugs''', below!&lt;br /&gt;
 * Release Notes for Swarm 2.2&lt;br /&gt;
 ** Numerous bugs have been fixed since 2.1.1&lt;br /&gt;
 ** MacOS X is now supported&lt;br /&gt;
 ** The Windows binaries for java Swarm now use the MingW compiler.&lt;br /&gt;
 ** Two new probability distributions (binomial, Poisson) have been added &lt;br /&gt;
    to the Random library.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
*If downloading a binary from within your web browser, you should do it in such a way that the browser never displays the file on the screen. If you save a file after viewing it, many browsers corrupt it. In Netscape, shift-clicking the url will save it directly to disk.&lt;br /&gt;
*The needed-software directory only applies to building Swarm from source. If you are installing one of the binary distributions, you will not be required to build any packages from source, all relevant packages will either be bundled with your distribution (such as Red Hat and Debian) and/or we provide the appropriate packages in on the ftp site, under the subdirectory relevant for that distribution (list below).&lt;br /&gt;
&lt;br /&gt;
==Packaged (binary) distributions (2.2)==&lt;br /&gt;
The packaged (binary) distributions provide an environment against which user applications can be compiled and linked, without building the Swarm kernel from source.&lt;br /&gt;
&lt;br /&gt;
===Windows binaries===&lt;br /&gt;
'''Windows binaries are different from previous versions!''' In Swarm 2.1.1 and earlier versions, Swarm Windows binaries were distributed as an executable file that installed Cygwin and Swarm on your computer. Swarm 2.2 is distributed by providing a special version of Cygwin that includes Swarm; this version is installed using a special version of the Cygwin setup program. Additional information and instructions are included in the [[Windows binary notes]]. &lt;br /&gt;
&lt;br /&gt;
The Windows binaries are installed via a setup program at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/cygwin/setup.exe&lt;br /&gt;
&lt;br /&gt;
This program downloads and installs Cygwin and Swarm from the internet; you will need a high-speed internet connection. (Alternatives for computers without high-speed access are discussed in [[Windows binary notes]].)&lt;br /&gt;
&lt;br /&gt;
Java binaries for Swarm 2.2 now use the MingW compiler (http://www.mingw.org ) instead of Sun JDK. This means they can be run outside of Cygwin. [http://www.swarm.org/swarmdocs-2.2/set/swarm.installbook.install.article.html Notes for installing Java Swarm] are in the Swarm documentation set. Java binaries for Windows are at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.tar.gz&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.zip&lt;br /&gt;
&lt;br /&gt;
For the latest information you should check out Paul Johnson's [http://www.ku.edu/~pauljohn/SwarmFaq/SwarmOnlineFaq.html online FAQ] or consult the [[Swarm: Mailing lists]] archives.&lt;br /&gt;
&lt;br /&gt;
===GNU/Linux binaries===&lt;br /&gt;
&lt;br /&gt;
Paul Johnson is maintaining [http://lark.cc.ku.edu/~pauljohn/Swarm/ RPMs] of Swarm for Fedora Core Linux (and Red Hat 9 if practical).&lt;br /&gt;
&lt;br /&gt;
Charlie Sharpsteen built a [https://launchpad.net/~sdg-team/+archive/ubuntu/stable Swarm site on Launchpad] which provides Swarm as a Ubuntu package. As of February 2015, Swarm can be installed (at least in Ubuntu 12.04) via: &lt;br /&gt;
&lt;br /&gt;
sudo apt-add-repository ppa:sdg-team/stable&lt;br /&gt;
sudo apt-get update&lt;br /&gt;
sudo apt-get install libswarm2-dev gobjc-4.5&lt;br /&gt;
&lt;br /&gt;
You may need to edit /usr/etc/swarm/Makefile.common to use gcc-4.5 for CC and OBJC. Ubuntu 12.04 was a long-term support (LTS) release that should be supported until in April 2017.&lt;br /&gt;
&lt;br /&gt;
===MacOS X binaries===&lt;br /&gt;
&lt;br /&gt;
Bill Northcott has produced binaries for MacOS X; see details at [[Swarm: MacOS X binaries]]  These packages include everything other than standard Apple software needed to build and run Swarm models on Panther. Tiger (MacOS X 10.4) is the preferred operating system but older binaries for Panther are available.  There are several versions of the gcc compiler provided, including bleeding edge versions built from the latest code in Apple's opensource cvs. This compiler includes Fortran, libffi and the GNU Objective-C runtime library.&lt;br /&gt;
&lt;br /&gt;
===Other platforms===&lt;br /&gt;
Binaries for other platforms have not been developed. If you develop binaries for another platform, please let us know so they can be shared.&lt;br /&gt;
&lt;br /&gt;
===Binaries of previous versions===&lt;br /&gt;
Legacy binaries (unmaintained) are available here:&lt;br /&gt;
*http://ftp.swarm.org/pub/swarm/binaries/old/&lt;br /&gt;
&amp;amp;lt;!-- commented out obsoleted binaries &lt;br /&gt;
    * Windows 9x, Windows NT 4, or Windows 2000. &lt;br /&gt;
          o Development Kit Note: very large (50 MB), you may wish to order a CD-ROM&lt;br /&gt;
          o&lt;br /&gt;
           Demos&lt;br /&gt;
    *&lt;br /&gt;
      Debian GNU/Linux 2.2. &lt;br /&gt;
          o&lt;br /&gt;
            ix86&lt;br /&gt;
          o&lt;br /&gt;
            sparc&lt;br /&gt;
    *      Red Hat GNU/Linux. &lt;br /&gt;
          o&lt;br /&gt;
            Red Hat 6.1 / x86&lt;br /&gt;
          o&lt;br /&gt;
            Red Hat 6.1 / sparc&lt;br /&gt;
          o&lt;br /&gt;
            LinuxPPC R5 (1999)&lt;br /&gt;
    *&lt;br /&gt;
      SuSE 6.3 GNU/Linux. &lt;br /&gt;
          o&lt;br /&gt;
            x86&lt;br /&gt;
    *&lt;br /&gt;
      Solaris 2.7. &lt;br /&gt;
          o&lt;br /&gt;
            Sparc&lt;br /&gt;
--&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Swarm source (2.2)==&lt;br /&gt;
The Swarm source distribution includes a complete set of swarm kernel sources and can be found at:&lt;br /&gt;
*ftp://ftp.swarm.org/pub/swarm/src/swarm/swarm-2.2.tar.gz &lt;br /&gt;
&lt;br /&gt;
The user must first install (or verify the availability of) appropriate versions of the needed software in order to provide a proper compilation and execution environment for Swarm. We no longer maintain an up-to-date archive of the packages needed by Swarm, as they are readily found on the web. The list of packages needed by Swarm 2.2 is:&lt;br /&gt;
* Tcl/Tk -- either built from source or using -devel binary packages on your favorite distribution&lt;br /&gt;
* BLT 2.4z, not 3.0&lt;br /&gt;
* libpng 1.2.5&lt;br /&gt;
* zlib 1.2.2&lt;br /&gt;
* xpm-4.2 (or the xpm-nox package for Cygwin)&lt;br /&gt;
* X11R6 on Linux and MacOS X (with SDK)&lt;br /&gt;
* Optionally, HDF5 1.6.2&lt;br /&gt;
* Optionally, Java SDK 1.4.2&lt;br /&gt;
* GCC 3.4.4 with Objective C (gcc-4.0 is preferable particularly on non-x86 platforms such as PowerPC, Alpha etc..)&lt;br /&gt;
* GNU Make&lt;br /&gt;
&lt;br /&gt;
Once the environment has been set up, and the source downloaded and de-tarred into an appropriate directory, the user should consult the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; file to learn what options should be specified to the configure script that configures Swarm to the local system. Compilation and linking are done using &amp;amp;lt;tt&amp;amp;gt;make&amp;amp;lt;/tt&amp;amp;gt; as usual, after this step.&lt;br /&gt;
&lt;br /&gt;
You also need an explicit &amp;amp;lt;tt&amp;amp;gt;make install&amp;amp;lt;/tt&amp;amp;gt; step, after the initial &amp;amp;lt;tt&amp;amp;gt;make build&amp;amp;lt;/tt&amp;amp;gt; to cleanly install Swarm to an appropriate location (for example &amp;amp;lt;tt&amp;amp;gt;/usr/local&amp;amp;lt;/tt&amp;amp;gt;). This is explained futher in the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; files contained in the distribution.&lt;br /&gt;
&lt;br /&gt;
After compilation and installation of Swarm a set of program libraries and header files against which Swarm applications can be compiled and linked is available.&lt;br /&gt;
&lt;br /&gt;
==Known bugs and fixes==&lt;br /&gt;
This section describes bugs that are known to exist in the release of version 2.2 and what you can do about them.&lt;br /&gt;
&lt;br /&gt;
===Error in &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; minimum, maximum values===&lt;br /&gt;
Swarm's &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; class (in the Analysis library) calculates statistics over values selected from a collection of objects. The '''&amp;amp;lt;tt&amp;amp;gt;getMin&amp;amp;lt;/tt&amp;amp;gt;''' and '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' methods do not work, and will report values that should easily (if checked) be detected as incorrect. (Note that the Reference Guide does not mention the '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' method but it does exist.) Bug reported here 21 April 2005.&lt;br /&gt;
&lt;br /&gt;
Fixes:&lt;br /&gt;
&lt;br /&gt;
''Windows users'' can download new DLL files with this bug fixed. These are (thanks to Marcus Daniels):&lt;br /&gt;
&lt;br /&gt;
  http://www.santafe.edu/~mgd/javaswarm.dll&lt;br /&gt;
  http://www.santafe.edu/~mgd/cygswarm-0.dll&lt;br /&gt;
&lt;br /&gt;
These would overwrite the equivalent files in the Java/Swarm binary distribution.&lt;br /&gt;
The &amp;amp;lt;tt&amp;amp;gt;cygswarm-0.dll&amp;amp;lt;/tt&amp;amp;gt; goes in &amp;amp;lt;tt&amp;amp;gt;Cygwin/bin&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''RPMs for Redhat Linux'' are available from Paul Johnson; see the link above on this page.&lt;br /&gt;
&lt;br /&gt;
''Builds from source code'' can check out the most recent source code at Swarm's Savannah site (see [[Swarm:_development_snapshot#CVS|CVS]]),  or simply fix the offending line of code:&lt;br /&gt;
&lt;br /&gt;
In &amp;amp;lt;tt&amp;amp;gt;Averager.m&amp;amp;lt;/tt&amp;amp;gt;, change line 106 from &lt;br /&gt;
  '''if (totalCount == 0)''' &lt;br /&gt;
to &lt;br /&gt;
 '''if (totalCount == 0 || count == 0)'''&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2176</id>
		<title>Swarm and MinGW</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2176"/>
				<updated>2015-12-03T02:04:00Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Software Used to Compile Swarm 2.4.1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This documentation provides information on how to use Swarm on Windows with [http://www.mingw.org MinGW] compilers. The following topics will be covered:&lt;br /&gt;
&lt;br /&gt;
* How to run a Swam model compiled with MinGW on Windows: Once you produce a Swarm model using MinGW (or someone gives one to you), how do you run it on other machines without installing Swarm there?&lt;br /&gt;
* How to use MinGW to compile your own Swarm models, either during model development or so you can distribute working models to others. This requires installing MinGW and our binary Swarm libraries.&lt;br /&gt;
* How to package a model compiled with MinGW so it can be installed and run by itself on Windows machines.&lt;br /&gt;
* How to use MinGW to compile the Swarm libraries, in case you want to build your own Swarm binaries.&lt;br /&gt;
&lt;br /&gt;
Each topic is more difficult than the one before it. However the topics are independent in that it is not necessary to know how to compile the Swarm library in order to run a pre-compiled Swarm model or compile your own model against a pre-compiled version of Swarm.&lt;br /&gt;
&lt;br /&gt;
= Using Swarm Models Compiled with MinGW =&lt;br /&gt;
&lt;br /&gt;
A model that has been compiled using MinGW can be installed and run from a Windows computer without installing MinGW or Swarm. An example code is this build of Heatbugs:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe]&lt;br /&gt;
&lt;br /&gt;
However, running a Swarm model requires some support programs and libraries. These are available as&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-win32.zip&amp;lt;/tt&amp;gt;, available here:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip]&lt;br /&gt;
&lt;br /&gt;
Unzipping that file will create a folder called &amp;lt;tt&amp;gt;swarm&amp;lt;/tt&amp;gt; which should be moved somewhere that is easy to remember. The rest of this tutorial will assume this Swarm folder has been placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before a Swarm model can be run, the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder must be added to the Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; so that Heatbugs can find necessary libraries when it runs. The &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder can be ''temporarily'' added to the path by executing the following in the Windows command line (the command line is accessed using the program &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;path=%PATH%;C:\swarm\bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, it is possible to have conflicts if other versions of libraries used by Swarm, such as HDF5, are already installed and in your path. And some Swarm programs require that the environment variable SWARMHOME be defined, which will typically not be true. These problems can be avoided by using the following statements instead of the above path command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
You can alternatively add the Swarm folder to your &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; permanently by editing the Windows PATH environment variable. A tool like [[#RapidEE|RapidEE]] makes doing so easy, or you can use use Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; to the PATH system variable.&lt;br /&gt;
&lt;br /&gt;
Once the path has been set to include the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder, Swarm models can be started through the Windows command line, or by double-clicking on them from the Windows Explorer.  &lt;br /&gt;
&lt;br /&gt;
The Heatbugs model can now be run by changing the directory of the command line to the folder holding &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; and then executing the program. For example, if &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is located in &amp;lt;tt&amp;gt;C:\Users\example_user\Downloads&amp;lt;/tt&amp;gt;, then the model may be run as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd C:\Users\example_user\Downloads&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(or you can just double-click on &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; from Windows Explorer, which temporarily opens a Windows command terminal while the model runs.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Running_Heatbugs.png|frame|none|alt=Running the Heatbugs model]]&lt;br /&gt;
&lt;br /&gt;
You can also create a simple Windows batch file that sets SWARMHOME and the path and then executes the model. Create a file called, for example &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; in the same directory where &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is, containing these lines: &lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, just double-clicking on &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; will start the model.&lt;br /&gt;
&lt;br /&gt;
If you try this and get an error that some .dll file is not found, then the problem is likely that the path is not set correctly to include the swarm\bin folder. If instead the program crashes without an error statement, then the problem is more likely that SWARMHOME needs to be set.&lt;br /&gt;
&lt;br /&gt;
= Installing Swarm and MinGW to compile models =&lt;br /&gt;
&lt;br /&gt;
To compile Swarm models from source using MinGW, the following simple steps need to be taken to set up the build environment:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|Install MinGW using instructions here]]. Currently only 32-bit MinGW can be used with Swarm. Install all components of MinGW.&lt;br /&gt;
* Download compiled Swarm binaries, archived as [http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip swarm-2.4.1-win32.zip]. Unzip the archive and place the extracted folder at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
The archived Swarm binaries '''MUST''' be placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt; to successfully compile Swarm models. This is because some paths had to be hard-coded by &amp;lt;tt&amp;gt;libtool&amp;lt;/tt&amp;gt; during the creation of the binaries.&lt;br /&gt;
&lt;br /&gt;
The final step before you can compile a Swarm model is to set the &amp;lt;tt&amp;gt;SWARMHOME&amp;lt;/tt&amp;gt; environment variable so that the &amp;amp;quot;make&amp;amp;quot; program knows where to find the Swarm libraries when compiling your code. There are several ways to do this.&lt;br /&gt;
*You can temporarily set SWARMHOME by entering this command in the MinGW shell: &amp;lt;pre&amp;gt;export SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*You can edit your Makefile so it starts with: &amp;lt;pre&amp;gt;SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Set SWARMHOME permanently as a Windows environment variable, either by using [[#RapidEE|RapidEE]] or Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add a new (User or System) variable called SWARMHOME with the value &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After MinGW has been installed and the Swarm binaries have been downloaded, Swarm models may be compiled using the MinGW shell. Start up the program MinGW Shell, cd to the directory containing your code and Makefile, and enter the command &amp;amp;quot;Make&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
An archive of official Swarm example programs can be downloaded from:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
&lt;br /&gt;
We will use the &amp;amp;quot;Heatbugs&amp;amp;quot; model as an example of how to compile a Swarm application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf /path/to/downloaded/swarmapps-2.3.0.tar.gz&lt;br /&gt;
cd swarmapps-2.3.0/objc/heatbugs&lt;br /&gt;
&lt;br /&gt;
make&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''VERY IMPORTANT NOTE: MinGW produces two executables called &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt;---one in the &amp;lt;tt&amp;gt;heatbugs&amp;lt;/tt&amp;gt; folder and another in the &amp;lt;tt&amp;gt;heatbugs/.libs&amp;lt;/tt&amp;gt; folder. You should ignore the executable in the top-level folder, &amp;lt;tt&amp;gt;heatbugs/heatbugs.exe&amp;lt;/tt&amp;gt;, as it is merely a compiled wrapper script that executes &amp;lt;tt&amp;gt;heatbugs/.libs/heatbugs.exe&amp;lt;/tt&amp;gt;. When distributing compiled models, only use binaries from the &amp;lt;tt&amp;gt;.libs&amp;lt;/tt&amp;gt; folder.'''&lt;br /&gt;
&lt;br /&gt;
The resulting executable, &amp;lt;tt&amp;gt;.libs/heatbugs.exe&amp;lt;/tt&amp;gt; may be executing by following the steps described above at ''Using Swarm Models Compiled with MinGW''. These steps must include setting the Windows Path to include &amp;lt;tt&amp;gt;C:\swarm\bin&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Distributing a Swarm Model for Windows Users =&lt;br /&gt;
&lt;br /&gt;
A major benefit of the MinGW version of Swarm is that models can be distributed for people to use without installing Swarm. A simple way to do this, after the model has been compiled and tested using methods in the previous section, is to create a ZIP archive that contains all the files to run the model.&lt;br /&gt;
&lt;br /&gt;
* Create a directory tree that includes the Swarm binary files. For example, create C:\MySwarmModel and add the Swarm binaries (as described [[Swarm_and_MinGW#Using_Swarm_Models_Compiled_with_MinGW|above]]) to it as a subdirectory tree.&lt;br /&gt;
* Create another subdirectory that includes just the compiled model.&lt;br /&gt;
* Create a third subdirectory that includes any input files that the model needs and a batch file that sets the path and executes the model. &lt;br /&gt;
* Zip the whole tree up for distribution.&lt;br /&gt;
&lt;br /&gt;
The directory tree in the zip file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\MySwarmModel\swarm&lt;br /&gt;
                      \bin&lt;br /&gt;
                      \etc&lt;br /&gt;
                      \include&lt;br /&gt;
                      \lib&lt;br /&gt;
                      \man&lt;br /&gt;
                      \share&lt;br /&gt;
               \executable\MySwarmModel.exe&lt;br /&gt;
               \Runfiles\MySwarmModel.bat (and any input files)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the file &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt; contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set SWARMHOME=C:\MySwarmModel\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
C:\MySwarmModel\executable\MySwarmModel.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then users can run the model just by double-clicking on &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Building Swarm Using MinGW =&lt;br /&gt;
&lt;br /&gt;
This tutorial provides directions and code for compiling your own Swarm libraries for Windows. It is a bit advanced---some familiarity with compiling software from source in a Linux environment and knowledge of the UNIX command line is assumed.&lt;br /&gt;
&lt;br /&gt;
== Install Required Tools ==&lt;br /&gt;
&lt;br /&gt;
The first step is to download and install tools required for compiling Swarm. These links provide directions:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|MinGW]]&lt;br /&gt;
* [[#Emacs|Emacs]]&lt;br /&gt;
* [[#GPerf|GPerf]]&lt;br /&gt;
&lt;br /&gt;
== Build Support Libraries ==&lt;br /&gt;
&lt;br /&gt;
The next steps are to build and install the libraries that Swarm depends on. A ZIP archive containing all the source code required can be found at:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip http://download.savannah.gnu.org/releases/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip]&lt;br /&gt;
&lt;br /&gt;
This archive contains two subdirectories:&lt;br /&gt;
&lt;br /&gt;
* sources: This folder contains the source code for each component.&lt;br /&gt;
* patches: This folder contains patchfiles that modfy source code so that MinGW can compile it.&lt;br /&gt;
&lt;br /&gt;
After downloading and extracting the source code archive, open up a MinGW shell and run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
mkdir build&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following steps will all assume your MinGW shell is operating out of the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory. All compiled software will be installed to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt; (The Windows Explorer will see the folder appear at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== ZLib ===&lt;br /&gt;
&lt;br /&gt;
ZLib will be the first library to be built as it is a common dependency for many of the other software components. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following to build Zlib:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/zlib-1.2.5.tar.gz&lt;br /&gt;
cd zlib-1.2.5&lt;br /&gt;
make -f win32/Makefile.gcc&amp;lt;/pre&amp;gt;&lt;br /&gt;
And then the following commands to install ZLib to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -p /c/swarm/bin&lt;br /&gt;
mkdir -p /c/swarm/include&lt;br /&gt;
mkdir -p /c/swarm/lib&lt;br /&gt;
&lt;br /&gt;
cp zlib1.dll /c/swarm/bin/&lt;br /&gt;
cp zconf.h zlib.h /c/swarm/include/&lt;br /&gt;
mv libzdll.a libz.dll.a&lt;br /&gt;
cp *.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LibPNG ===&lt;br /&gt;
&lt;br /&gt;
LibPNG will be built next as its only dependency is ZLib. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following steps to build and install LibPNG:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/libpng-1.5.4.tar.bz2&lt;br /&gt;
cd libpng-1.5.4&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm --with-zlib-prefix=/c/swarm&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XPM ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, the XPM library can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/xpm-nox-4.2.0.tar.bz2&lt;br /&gt;
cd xpm-nox-4.2.0&lt;br /&gt;
patch -p1 &amp;amp;lt; ../../patches/xpm-nox-4.2.0-mingw-tcl.patch&lt;br /&gt;
&lt;br /&gt;
make CC=gcc&lt;br /&gt;
make install prefix=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
The patchfile is inherited from the SUSE builds of XPM for MinGW and adds Makefiles and other critical components.&lt;br /&gt;
&lt;br /&gt;
One major modification has been made to the SUSE patchfile---&amp;lt;tt&amp;gt;tcl.h&amp;lt;/tt&amp;gt; is included in &amp;lt;tt&amp;gt;xpm.h&amp;lt;/tt&amp;gt;. This is required in order to use XPM while Tk is installed. Conversely, this means that this build of XPM cannot be used without having Tk installed.&lt;br /&gt;
&lt;br /&gt;
=== LibFFI ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, LibFFI can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/libffi-3.0.9.tar.gz&lt;br /&gt;
cd libffi-3.0.9&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
The LibFFI headers get installed in a weird place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mv /c/swarm/lib/libffi-3.0.9/include/*.h /c/swarm/include&lt;br /&gt;
rm -rf /c/swarm/lib/libffi-3.0.9&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tcl ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tcl can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tcl8.4.19-src.tar.gz&lt;br /&gt;
cd tcl8.4.19&lt;br /&gt;
patch -p1 &amp;amp;lt; ../../patches/tcl-8.4.19-fix-lvalues.patch&lt;br /&gt;
cd win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
At two places in the TCL source code, an assignment is made while simultaneously performing a typecast. The typecast and the assignment had to be split into separate operations in order to be acceptable to the MinGW compilers.&lt;br /&gt;
&lt;br /&gt;
=== Tk ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tk can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tk8.4.19-src.tar.gz&lt;br /&gt;
cd tk8.4.19/win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BLT ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, BLT can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/BLT2.4z.tar.gz&lt;br /&gt;
cd blt2.4z&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm --without-x&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDF5 (Optional) ===&lt;br /&gt;
&lt;br /&gt;
Getting HDF5 to work with MinGW is a little tricky. It is an optional dependency, so if support for reading and writing &amp;lt;tt&amp;gt;.hdf&amp;lt;/tt&amp;gt; files is not needed this section can be skipped.&lt;br /&gt;
&lt;br /&gt;
As of version 1.8.7, HDF5 currently does not compile under MinGW. So, we must wrap pre-compiled binaries for use with MinGW. In order to wrap the binaries, we will need an additional tool called &amp;lt;tt&amp;gt;pexports&amp;lt;/tt&amp;gt;. This can be installed using &amp;lt;tt&amp;gt;mingw-get&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mingw-utils&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download 32-bit Windows binaries from the HDF website compiled for use with the Visual Studio compilers (these files have &amp;amp;quot;VS&amp;amp;quot; listed under the ''Compilers'' section). After extracting the archive, the HDF5 libraries can be wrapped for use with MinGW by executing the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd path/to/where/HDF5/was/extracted&lt;br /&gt;
&lt;br /&gt;
for dll in `ls dll/*dll`; do&lt;br /&gt;
  def_file=`basename $dll .dll`.def&lt;br /&gt;
  lib_file=lib`basename $dll dll.dll`.a&lt;br /&gt;
  pexports $dll &amp;amp;gt; $def_file&lt;br /&gt;
  dlltool -d $def_file -l lib/$lib_file&lt;br /&gt;
done&amp;lt;/pre&amp;gt;&lt;br /&gt;
Next, move the libraries and header files needed to use HDF5 from C into &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp dll/hdf5dll.dll dll/szip.dll /c/swarm/bin&lt;br /&gt;
cp include/* /c/swarm/include&lt;br /&gt;
cp lib/libhdf5.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, a patch must be applied to the HDF header file &amp;lt;tt&amp;gt;H5public.h&amp;lt;/tt&amp;gt; so that it doesn't define &amp;lt;tt&amp;gt;ssize_t&amp;lt;/tt&amp;gt;---a constant already defined by MinGW. The required patch is contained in the Swarm MinGW source archive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
patch -p1 -d /c/swarm &amp;amp;lt; patches/hdf5-1.8.7-mingw.patch&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Swarm ==&lt;br /&gt;
&lt;br /&gt;
Finally, the Swarm libraries themselves can be built. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/swarm-2.4.1.tar.gz&lt;br /&gt;
cd swarm-2.4.1&lt;br /&gt;
patch -p1 ../../patches/swarm-2.4.1-mingw.patch&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm \&lt;br /&gt;
  --with-zlibdir=/c/swarm \&lt;br /&gt;
  --with-pngdir=/c/swarm \&lt;br /&gt;
  --with-xpmdir=/c/swarm \&lt;br /&gt;
  --with-ffidir=/c/swarm \&lt;br /&gt;
  --with-tcl=/c/swarm/lib \&lt;br /&gt;
  --with-tk=/c/swarm/lib \&lt;br /&gt;
  --with-bltdir=/c/swarm&lt;br /&gt;
&lt;br /&gt;
cd avcall&lt;br /&gt;
gcc -S avcall-i386.c&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you wrapped HDF5 up for use with MinGW, add &amp;lt;tt&amp;gt;--with-hdf5dir=/c/swarm&amp;lt;/tt&amp;gt; to the list of arguments passed to &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-mingw.patch&amp;lt;/tt&amp;gt; modifies the Swarm source code in the following ways:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;gettimeofday&amp;lt;/tt&amp;gt; is no longer defined in the Swarm sources as MinGW includes this function in its standard library.&lt;br /&gt;
* Swarm GUI functions are updated to be compatible with LibPNG 1.5.&lt;br /&gt;
* The Swarm &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt; script defines &amp;lt;tt&amp;gt;DATADIR&amp;lt;/tt&amp;gt; as a preprocessor macro---this conflicts with variables in the GCC Objective-C library. &amp;lt;tt&amp;gt;DATDIR&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;undef&amp;lt;/tt&amp;gt;ed in critical parts of the source code.&lt;br /&gt;
* The &amp;lt;tt&amp;gt;sleep&amp;lt;/tt&amp;gt; function is aliased to &amp;lt;tt&amp;gt;usleep&amp;lt;/tt&amp;gt;---which is the name of the MinGW implementation.&lt;br /&gt;
* The way in which Makefiles invoke &amp;lt;tt&amp;gt;gperf&amp;lt;/tt&amp;gt; is amended so that it actually produces output.&lt;br /&gt;
* NULL checks are added to `zstrdup` in src/defobj/internal.m. Some functions in the Swarm library may attempt to call `zstrdup` on a NULL pointer. (This happens if the SWARMHOME environment variable is not set.) Failing to check for this condition can lead to segfaults. `zstrdup` now returns NULL if passed a NULL string or if `alloc` fails to allocate memory for a duplicate.&lt;br /&gt;
&lt;br /&gt;
Full details are contained in the patchfile.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
&lt;br /&gt;
== MinGW ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.mingw.org&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/mingw/files&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 20110530&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org MinGW] is a set of software that aims to provide an environment where software developed on UNIX-like systems can be easily compiled for Windows. Since Swarm is primarily developed on Linux (a UNIX clone), MinGW can ease the task of creating Swarm models that run on Windows.&lt;br /&gt;
&lt;br /&gt;
MinGW is similar to the [http://www.cygwin.org Cygwin] project. The major difference is that MinGW produces executables that depend only on native Windows libraries while Cygwin executables require special compatibility libraries that are part of the Cygwin distribution.&lt;br /&gt;
&lt;br /&gt;
=== Installing MinGW ===&lt;br /&gt;
&lt;br /&gt;
MinGW can be installed by downloading the &amp;amp;quot;Automated MinGW Installer&amp;amp;quot;, which usually has a name like &amp;lt;tt&amp;gt;mingw-get-inst-&amp;amp;lt;date&amp;amp;gt;.exe&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;&amp;amp;lt;date&amp;amp;gt;&amp;lt;/tt&amp;gt; is the datestamp for when the installer was packaged. Running this executable will start the installation process. The installer lets you select which optional components to install; make sure all boxes are checked so you '''install all components'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Setup.png|frame|none|alt=Install all available MinGW components]]&lt;br /&gt;
&lt;br /&gt;
The installer downloads all components from the internet. This will take a while, so have a cup of coffee or walk the dog.&lt;br /&gt;
&lt;br /&gt;
See the following section about also installing an optional, more-functional shell window for MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Using MinGW ===&lt;br /&gt;
&lt;br /&gt;
The MinGW compilers are accessible through the &amp;amp;quot;MinGW Shell&amp;amp;quot; which should be located under the MinGW folder in the Start Menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Shell.png|frame|none|alt=Location of MinGW Shell]]&lt;br /&gt;
&lt;br /&gt;
or by running &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; (if MinGW was installed to its default location).&lt;br /&gt;
&lt;br /&gt;
By default the MinGW shell executes inside of a Windows &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt; terminal. There are a couple major drawbacks to this:&lt;br /&gt;
&lt;br /&gt;
* You cannot resize the window to full-screen.&lt;br /&gt;
* The shell provides limited history scrollback.&lt;br /&gt;
&lt;br /&gt;
MinGW provides a couple of alternative terminals for the MinGW shell which do not have these drawbacks; one of which is called MinTTY. To install MinTTY execute the following in a MinGW shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mintty&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then the &amp;lt;tt&amp;gt;mintty&amp;lt;/tt&amp;gt; command can be used to launch a MinTTY terminal. The MinGW Shell can also be set to launch MinTTY by default by editing the file &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; and changing the following line (approximately line 58):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;quot;x%MSYSCON%&amp;amp;quot; == &amp;amp;quot;xunknown&amp;amp;quot; set MSYSCON=sh.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;quot;x%MSYSCON%&amp;amp;quot; == &amp;amp;quot;xunknown&amp;amp;quot; set MSYSCON=mintty.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A Note About Paths ===&lt;br /&gt;
&lt;br /&gt;
The MinGW Shell emulates a UNIX &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell and thus uses UNIX-style paths, &amp;lt;tt&amp;gt;/path/to/file&amp;lt;/tt&amp;gt;, instead of Windows-style paths, &amp;lt;tt&amp;gt;C:\path\to\file&amp;lt;/tt&amp;gt;. One peculiarity of this process is that the shell must deal with the fact that Windows filesystems have multiple roots (&amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt;, etc.) while a UNIX filesystem only has one root called &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;. The way this is reconciled by the &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell provided with MinGW is that &amp;lt;tt&amp;gt;/c&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt; drive, &amp;lt;tt&amp;gt;/d&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt; drive and so on and so forth.&lt;br /&gt;
&lt;br /&gt;
The root of the filesystem itself, &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;, also has some caveats. &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt; refers to the &amp;lt;tt&amp;gt;mysy&amp;lt;/tt&amp;gt; folder, &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0&amp;lt;/tt&amp;gt; in a default installation. &amp;lt;tt&amp;gt;/usr&amp;lt;/tt&amp;gt; also refers to the same location. Thus, &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/local&amp;lt;/tt&amp;gt; both refer to &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0/local&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== A Note About MinGW-64 ===&lt;br /&gt;
&lt;br /&gt;
Currently Swarm has been developed and tested against the 32-bit version of MinGW. Hence Swarm models produced this way should run in any version of Windows.&lt;br /&gt;
&lt;br /&gt;
The [MinGW-w64][mingw_65] project produces 64-bit MinGW compilers that can produce 64-bit executables that will only run on 64-bit versions of Windows. These executables benefit from:&lt;br /&gt;
&lt;br /&gt;
* Access to more memory. A 32-bit executable will only be able to allocate ~3 GB of RAM---even if the system has more RAM available.&lt;br /&gt;
* Possibly quicker execution speeds due to matching the native architecture of the operating system---however this depends on the types of tasks that the program executes. It has been reported that 64 bit Swarm executables run quicker than 32 bit Swarm executables on Linux.&lt;br /&gt;
&lt;br /&gt;
Currently, no attempt has been made to compile Swarm 2.4.1 with the 64 bit MinGW compilers. If a successful attempt is made, please report it on the [http://www.swarm.org/mailman/listinfo/support Swarm mailing list].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Emacs ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/emacs&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 23.3&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://ftp.gnu.org/gnu/emacs/windows&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GNU Emacs is a text editor that is used by many programmers to edit code. However, Emacs can also be scripted to perform a variety of complicated transformations on text files. The scripts that build the Swarm libraries use Emacs to automate the process of generating some source files. Thus Emacs has to be installed in order to build Swarm from source.&lt;br /&gt;
&lt;br /&gt;
=== Installing Emacs ===&lt;br /&gt;
&lt;br /&gt;
Install Emacs by downloading one of the &amp;lt;tt&amp;gt;emacs-&amp;amp;lt;version&lt;br /&gt;
number&amp;amp;gt;-bin-i386.zip&amp;lt;/tt&amp;gt; files from the download area. Don't use any of the&lt;br /&gt;
files containing &amp;lt;tt&amp;gt;barebin&amp;lt;/tt&amp;gt;. After extracting the ZIP archive there will&lt;br /&gt;
be an Emacs folder containing a subfolder called &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt;. Add this folder&lt;br /&gt;
to your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. [[#RapidEE|RapidEE]] can help edit the&lt;br /&gt;
&amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
== GPerf ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/gperf/&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/gnuwin32/files/gperf&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 3.0.1&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GPerf is a program that produces C code containing hash functions. The scripts&lt;br /&gt;
that build the Swarm libraries use GPerf to generate some source code files.&lt;br /&gt;
Download &amp;lt;tt&amp;gt;gperf.exe&amp;lt;/tt&amp;gt; from the GnuWin32 site on Sourceforge and place it&lt;br /&gt;
somewhere on your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. Again, [[#RapidEE|RapidEE]] can help set the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RapidEE ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.rapidee.com&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 5.0&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.rapidee.com/en/license Freeware]&lt;br /&gt;
&lt;br /&gt;
The Rapid Environment Editor (RapidEE) is a spiffy tool that makes it easy to inspect and alter the value of Windows environment variables, such as the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. RapidEE may be used to edit &amp;amp;quot;System Variables&amp;amp;quot; which will affect all user accounts or &amp;amp;quot;User Variables&amp;amp;quot; which will affect just the current account. Administrative privileges may be required to edit the System Variables.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_1.png|frame|none|alt=The different variables RapidEE can edit]]&lt;br /&gt;
&lt;br /&gt;
Right-clicking on the &amp;lt;tt&amp;gt;Path&amp;lt;/tt&amp;gt; variable in the System Variables or User Variables will bring up a menu that presents the option to &amp;amp;quot;Add value&amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_2.png|frame|none|alt=Adding a new value to the PATH]]&lt;br /&gt;
&lt;br /&gt;
Once the new entry has been added, RapidEE must be told to save the changes. Command line shells, such as &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;, must be restarted in order for them to notice the changes.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_3.png|frame|none|alt=Adding and saving a value]]&lt;br /&gt;
&lt;br /&gt;
== Depends ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.dependencywalker.com/&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 2.2&lt;br /&gt;
&lt;br /&gt;
'''License:''' Freeware&lt;br /&gt;
&lt;br /&gt;
Depends is a usefull utility that scans Windows executables and reports information concerning the Dynamic-link Libraries (DLLs) that those executables require in order to run.&lt;br /&gt;
&lt;br /&gt;
= Software Used to Compile Swarm 2.4.1 =&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!  Name&lt;br /&gt;
!  Verson Used&lt;br /&gt;
!  License&lt;br /&gt;
!  Homepage&lt;br /&gt;
!  Download Area&lt;br /&gt;
|-&lt;br /&gt;
|  ZLib&lt;br /&gt;
|  1.2.5&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG License]&lt;br /&gt;
|  [http://www.zlib.net http://www.zlib.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibFFI&lt;br /&gt;
|  3.0.9&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  [http://sourceware.org/libffi http://sourceware.org/libffi]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibPNG&lt;br /&gt;
|  1.5.4&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG]&lt;br /&gt;
|  [http://www.libpng.org/pub/png/libpng.html http://www.libpng.org/pub/png/libpng.html]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  XPM-NoX&lt;br /&gt;
|  4.2.0&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  unknown&lt;br /&gt;
|  Try: [http://gnuwin32.sourceforge.net/packages/xpm-nox.htm http://gnuwin32.sourceforge.net/packages/xpm-nox.htm]&lt;br /&gt;
|-&lt;br /&gt;
|  Tcl&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Tk&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  BLT&lt;br /&gt;
|  2.4z&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://blt.sourceforge.net http://blt.sourceforge.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  HDF5&lt;br /&gt;
|  1.8.7&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://www.hdfgroup.org/HDF5 http://www.hdfgroup.org/HDF5]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Swarm&lt;br /&gt;
|  2.4.1&lt;br /&gt;
|  [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
|  [https://savannah.nongnu.org/projects/swarm/ https://savannah.nongnu.org/projects/swarm/]&lt;br /&gt;
|  [http://download.savannah.gnu.org/releases/swarm/src/swarm/swarm-2.4.1.tar.gz http://download.savannah.gnu.org/releases/swarm/src/swarm/swarm-2.4.1.tar.gz]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2175</id>
		<title>Swarm and MinGW</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2175"/>
				<updated>2015-12-03T02:01:23Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Software Used to Compile Swarm 2.4.1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This documentation provides information on how to use Swarm on Windows with [http://www.mingw.org MinGW] compilers. The following topics will be covered:&lt;br /&gt;
&lt;br /&gt;
* How to run a Swam model compiled with MinGW on Windows: Once you produce a Swarm model using MinGW (or someone gives one to you), how do you run it on other machines without installing Swarm there?&lt;br /&gt;
* How to use MinGW to compile your own Swarm models, either during model development or so you can distribute working models to others. This requires installing MinGW and our binary Swarm libraries.&lt;br /&gt;
* How to package a model compiled with MinGW so it can be installed and run by itself on Windows machines.&lt;br /&gt;
* How to use MinGW to compile the Swarm libraries, in case you want to build your own Swarm binaries.&lt;br /&gt;
&lt;br /&gt;
Each topic is more difficult than the one before it. However the topics are independent in that it is not necessary to know how to compile the Swarm library in order to run a pre-compiled Swarm model or compile your own model against a pre-compiled version of Swarm.&lt;br /&gt;
&lt;br /&gt;
= Using Swarm Models Compiled with MinGW =&lt;br /&gt;
&lt;br /&gt;
A model that has been compiled using MinGW can be installed and run from a Windows computer without installing MinGW or Swarm. An example code is this build of Heatbugs:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe]&lt;br /&gt;
&lt;br /&gt;
However, running a Swarm model requires some support programs and libraries. These are available as&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-win32.zip&amp;lt;/tt&amp;gt;, available here:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip]&lt;br /&gt;
&lt;br /&gt;
Unzipping that file will create a folder called &amp;lt;tt&amp;gt;swarm&amp;lt;/tt&amp;gt; which should be moved somewhere that is easy to remember. The rest of this tutorial will assume this Swarm folder has been placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before a Swarm model can be run, the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder must be added to the Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; so that Heatbugs can find necessary libraries when it runs. The &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder can be ''temporarily'' added to the path by executing the following in the Windows command line (the command line is accessed using the program &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;path=%PATH%;C:\swarm\bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, it is possible to have conflicts if other versions of libraries used by Swarm, such as HDF5, are already installed and in your path. And some Swarm programs require that the environment variable SWARMHOME be defined, which will typically not be true. These problems can be avoided by using the following statements instead of the above path command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
You can alternatively add the Swarm folder to your &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; permanently by editing the Windows PATH environment variable. A tool like [[#RapidEE|RapidEE]] makes doing so easy, or you can use use Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; to the PATH system variable.&lt;br /&gt;
&lt;br /&gt;
Once the path has been set to include the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder, Swarm models can be started through the Windows command line, or by double-clicking on them from the Windows Explorer.  &lt;br /&gt;
&lt;br /&gt;
The Heatbugs model can now be run by changing the directory of the command line to the folder holding &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; and then executing the program. For example, if &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is located in &amp;lt;tt&amp;gt;C:\Users\example_user\Downloads&amp;lt;/tt&amp;gt;, then the model may be run as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd C:\Users\example_user\Downloads&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(or you can just double-click on &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; from Windows Explorer, which temporarily opens a Windows command terminal while the model runs.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Running_Heatbugs.png|frame|none|alt=Running the Heatbugs model]]&lt;br /&gt;
&lt;br /&gt;
You can also create a simple Windows batch file that sets SWARMHOME and the path and then executes the model. Create a file called, for example &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; in the same directory where &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is, containing these lines: &lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, just double-clicking on &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; will start the model.&lt;br /&gt;
&lt;br /&gt;
If you try this and get an error that some .dll file is not found, then the problem is likely that the path is not set correctly to include the swarm\bin folder. If instead the program crashes without an error statement, then the problem is more likely that SWARMHOME needs to be set.&lt;br /&gt;
&lt;br /&gt;
= Installing Swarm and MinGW to compile models =&lt;br /&gt;
&lt;br /&gt;
To compile Swarm models from source using MinGW, the following simple steps need to be taken to set up the build environment:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|Install MinGW using instructions here]]. Currently only 32-bit MinGW can be used with Swarm. Install all components of MinGW.&lt;br /&gt;
* Download compiled Swarm binaries, archived as [http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip swarm-2.4.1-win32.zip]. Unzip the archive and place the extracted folder at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
The archived Swarm binaries '''MUST''' be placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt; to successfully compile Swarm models. This is because some paths had to be hard-coded by &amp;lt;tt&amp;gt;libtool&amp;lt;/tt&amp;gt; during the creation of the binaries.&lt;br /&gt;
&lt;br /&gt;
The final step before you can compile a Swarm model is to set the &amp;lt;tt&amp;gt;SWARMHOME&amp;lt;/tt&amp;gt; environment variable so that the &amp;amp;quot;make&amp;amp;quot; program knows where to find the Swarm libraries when compiling your code. There are several ways to do this.&lt;br /&gt;
*You can temporarily set SWARMHOME by entering this command in the MinGW shell: &amp;lt;pre&amp;gt;export SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*You can edit your Makefile so it starts with: &amp;lt;pre&amp;gt;SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Set SWARMHOME permanently as a Windows environment variable, either by using [[#RapidEE|RapidEE]] or Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add a new (User or System) variable called SWARMHOME with the value &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After MinGW has been installed and the Swarm binaries have been downloaded, Swarm models may be compiled using the MinGW shell. Start up the program MinGW Shell, cd to the directory containing your code and Makefile, and enter the command &amp;amp;quot;Make&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
An archive of official Swarm example programs can be downloaded from:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
&lt;br /&gt;
We will use the &amp;amp;quot;Heatbugs&amp;amp;quot; model as an example of how to compile a Swarm application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf /path/to/downloaded/swarmapps-2.3.0.tar.gz&lt;br /&gt;
cd swarmapps-2.3.0/objc/heatbugs&lt;br /&gt;
&lt;br /&gt;
make&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''VERY IMPORTANT NOTE: MinGW produces two executables called &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt;---one in the &amp;lt;tt&amp;gt;heatbugs&amp;lt;/tt&amp;gt; folder and another in the &amp;lt;tt&amp;gt;heatbugs/.libs&amp;lt;/tt&amp;gt; folder. You should ignore the executable in the top-level folder, &amp;lt;tt&amp;gt;heatbugs/heatbugs.exe&amp;lt;/tt&amp;gt;, as it is merely a compiled wrapper script that executes &amp;lt;tt&amp;gt;heatbugs/.libs/heatbugs.exe&amp;lt;/tt&amp;gt;. When distributing compiled models, only use binaries from the &amp;lt;tt&amp;gt;.libs&amp;lt;/tt&amp;gt; folder.'''&lt;br /&gt;
&lt;br /&gt;
The resulting executable, &amp;lt;tt&amp;gt;.libs/heatbugs.exe&amp;lt;/tt&amp;gt; may be executing by following the steps described above at ''Using Swarm Models Compiled with MinGW''. These steps must include setting the Windows Path to include &amp;lt;tt&amp;gt;C:\swarm\bin&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Distributing a Swarm Model for Windows Users =&lt;br /&gt;
&lt;br /&gt;
A major benefit of the MinGW version of Swarm is that models can be distributed for people to use without installing Swarm. A simple way to do this, after the model has been compiled and tested using methods in the previous section, is to create a ZIP archive that contains all the files to run the model.&lt;br /&gt;
&lt;br /&gt;
* Create a directory tree that includes the Swarm binary files. For example, create C:\MySwarmModel and add the Swarm binaries (as described [[Swarm_and_MinGW#Using_Swarm_Models_Compiled_with_MinGW|above]]) to it as a subdirectory tree.&lt;br /&gt;
* Create another subdirectory that includes just the compiled model.&lt;br /&gt;
* Create a third subdirectory that includes any input files that the model needs and a batch file that sets the path and executes the model. &lt;br /&gt;
* Zip the whole tree up for distribution.&lt;br /&gt;
&lt;br /&gt;
The directory tree in the zip file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\MySwarmModel\swarm&lt;br /&gt;
                      \bin&lt;br /&gt;
                      \etc&lt;br /&gt;
                      \include&lt;br /&gt;
                      \lib&lt;br /&gt;
                      \man&lt;br /&gt;
                      \share&lt;br /&gt;
               \executable\MySwarmModel.exe&lt;br /&gt;
               \Runfiles\MySwarmModel.bat (and any input files)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the file &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt; contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set SWARMHOME=C:\MySwarmModel\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
C:\MySwarmModel\executable\MySwarmModel.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then users can run the model just by double-clicking on &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Building Swarm Using MinGW =&lt;br /&gt;
&lt;br /&gt;
This tutorial provides directions and code for compiling your own Swarm libraries for Windows. It is a bit advanced---some familiarity with compiling software from source in a Linux environment and knowledge of the UNIX command line is assumed.&lt;br /&gt;
&lt;br /&gt;
== Install Required Tools ==&lt;br /&gt;
&lt;br /&gt;
The first step is to download and install tools required for compiling Swarm. These links provide directions:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|MinGW]]&lt;br /&gt;
* [[#Emacs|Emacs]]&lt;br /&gt;
* [[#GPerf|GPerf]]&lt;br /&gt;
&lt;br /&gt;
== Build Support Libraries ==&lt;br /&gt;
&lt;br /&gt;
The next steps are to build and install the libraries that Swarm depends on. A ZIP archive containing all the source code required can be found at:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip http://download.savannah.gnu.org/releases/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip]&lt;br /&gt;
&lt;br /&gt;
This archive contains two subdirectories:&lt;br /&gt;
&lt;br /&gt;
* sources: This folder contains the source code for each component.&lt;br /&gt;
* patches: This folder contains patchfiles that modfy source code so that MinGW can compile it.&lt;br /&gt;
&lt;br /&gt;
After downloading and extracting the source code archive, open up a MinGW shell and run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
mkdir build&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following steps will all assume your MinGW shell is operating out of the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory. All compiled software will be installed to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt; (The Windows Explorer will see the folder appear at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== ZLib ===&lt;br /&gt;
&lt;br /&gt;
ZLib will be the first library to be built as it is a common dependency for many of the other software components. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following to build Zlib:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/zlib-1.2.5.tar.gz&lt;br /&gt;
cd zlib-1.2.5&lt;br /&gt;
make -f win32/Makefile.gcc&amp;lt;/pre&amp;gt;&lt;br /&gt;
And then the following commands to install ZLib to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -p /c/swarm/bin&lt;br /&gt;
mkdir -p /c/swarm/include&lt;br /&gt;
mkdir -p /c/swarm/lib&lt;br /&gt;
&lt;br /&gt;
cp zlib1.dll /c/swarm/bin/&lt;br /&gt;
cp zconf.h zlib.h /c/swarm/include/&lt;br /&gt;
mv libzdll.a libz.dll.a&lt;br /&gt;
cp *.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LibPNG ===&lt;br /&gt;
&lt;br /&gt;
LibPNG will be built next as its only dependency is ZLib. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following steps to build and install LibPNG:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/libpng-1.5.4.tar.bz2&lt;br /&gt;
cd libpng-1.5.4&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm --with-zlib-prefix=/c/swarm&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XPM ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, the XPM library can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/xpm-nox-4.2.0.tar.bz2&lt;br /&gt;
cd xpm-nox-4.2.0&lt;br /&gt;
patch -p1 &amp;amp;lt; ../../patches/xpm-nox-4.2.0-mingw-tcl.patch&lt;br /&gt;
&lt;br /&gt;
make CC=gcc&lt;br /&gt;
make install prefix=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
The patchfile is inherited from the SUSE builds of XPM for MinGW and adds Makefiles and other critical components.&lt;br /&gt;
&lt;br /&gt;
One major modification has been made to the SUSE patchfile---&amp;lt;tt&amp;gt;tcl.h&amp;lt;/tt&amp;gt; is included in &amp;lt;tt&amp;gt;xpm.h&amp;lt;/tt&amp;gt;. This is required in order to use XPM while Tk is installed. Conversely, this means that this build of XPM cannot be used without having Tk installed.&lt;br /&gt;
&lt;br /&gt;
=== LibFFI ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, LibFFI can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/libffi-3.0.9.tar.gz&lt;br /&gt;
cd libffi-3.0.9&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
The LibFFI headers get installed in a weird place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mv /c/swarm/lib/libffi-3.0.9/include/*.h /c/swarm/include&lt;br /&gt;
rm -rf /c/swarm/lib/libffi-3.0.9&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tcl ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tcl can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tcl8.4.19-src.tar.gz&lt;br /&gt;
cd tcl8.4.19&lt;br /&gt;
patch -p1 &amp;amp;lt; ../../patches/tcl-8.4.19-fix-lvalues.patch&lt;br /&gt;
cd win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
At two places in the TCL source code, an assignment is made while simultaneously performing a typecast. The typecast and the assignment had to be split into separate operations in order to be acceptable to the MinGW compilers.&lt;br /&gt;
&lt;br /&gt;
=== Tk ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tk can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tk8.4.19-src.tar.gz&lt;br /&gt;
cd tk8.4.19/win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BLT ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, BLT can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/BLT2.4z.tar.gz&lt;br /&gt;
cd blt2.4z&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm --without-x&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDF5 (Optional) ===&lt;br /&gt;
&lt;br /&gt;
Getting HDF5 to work with MinGW is a little tricky. It is an optional dependency, so if support for reading and writing &amp;lt;tt&amp;gt;.hdf&amp;lt;/tt&amp;gt; files is not needed this section can be skipped.&lt;br /&gt;
&lt;br /&gt;
As of version 1.8.7, HDF5 currently does not compile under MinGW. So, we must wrap pre-compiled binaries for use with MinGW. In order to wrap the binaries, we will need an additional tool called &amp;lt;tt&amp;gt;pexports&amp;lt;/tt&amp;gt;. This can be installed using &amp;lt;tt&amp;gt;mingw-get&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mingw-utils&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download 32-bit Windows binaries from the HDF website compiled for use with the Visual Studio compilers (these files have &amp;amp;quot;VS&amp;amp;quot; listed under the ''Compilers'' section). After extracting the archive, the HDF5 libraries can be wrapped for use with MinGW by executing the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd path/to/where/HDF5/was/extracted&lt;br /&gt;
&lt;br /&gt;
for dll in `ls dll/*dll`; do&lt;br /&gt;
  def_file=`basename $dll .dll`.def&lt;br /&gt;
  lib_file=lib`basename $dll dll.dll`.a&lt;br /&gt;
  pexports $dll &amp;amp;gt; $def_file&lt;br /&gt;
  dlltool -d $def_file -l lib/$lib_file&lt;br /&gt;
done&amp;lt;/pre&amp;gt;&lt;br /&gt;
Next, move the libraries and header files needed to use HDF5 from C into &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp dll/hdf5dll.dll dll/szip.dll /c/swarm/bin&lt;br /&gt;
cp include/* /c/swarm/include&lt;br /&gt;
cp lib/libhdf5.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, a patch must be applied to the HDF header file &amp;lt;tt&amp;gt;H5public.h&amp;lt;/tt&amp;gt; so that it doesn't define &amp;lt;tt&amp;gt;ssize_t&amp;lt;/tt&amp;gt;---a constant already defined by MinGW. The required patch is contained in the Swarm MinGW source archive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
patch -p1 -d /c/swarm &amp;amp;lt; patches/hdf5-1.8.7-mingw.patch&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Swarm ==&lt;br /&gt;
&lt;br /&gt;
Finally, the Swarm libraries themselves can be built. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/swarm-2.4.1.tar.gz&lt;br /&gt;
cd swarm-2.4.1&lt;br /&gt;
patch -p1 ../../patches/swarm-2.4.1-mingw.patch&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm \&lt;br /&gt;
  --with-zlibdir=/c/swarm \&lt;br /&gt;
  --with-pngdir=/c/swarm \&lt;br /&gt;
  --with-xpmdir=/c/swarm \&lt;br /&gt;
  --with-ffidir=/c/swarm \&lt;br /&gt;
  --with-tcl=/c/swarm/lib \&lt;br /&gt;
  --with-tk=/c/swarm/lib \&lt;br /&gt;
  --with-bltdir=/c/swarm&lt;br /&gt;
&lt;br /&gt;
cd avcall&lt;br /&gt;
gcc -S avcall-i386.c&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you wrapped HDF5 up for use with MinGW, add &amp;lt;tt&amp;gt;--with-hdf5dir=/c/swarm&amp;lt;/tt&amp;gt; to the list of arguments passed to &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-mingw.patch&amp;lt;/tt&amp;gt; modifies the Swarm source code in the following ways:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;gettimeofday&amp;lt;/tt&amp;gt; is no longer defined in the Swarm sources as MinGW includes this function in its standard library.&lt;br /&gt;
* Swarm GUI functions are updated to be compatible with LibPNG 1.5.&lt;br /&gt;
* The Swarm &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt; script defines &amp;lt;tt&amp;gt;DATADIR&amp;lt;/tt&amp;gt; as a preprocessor macro---this conflicts with variables in the GCC Objective-C library. &amp;lt;tt&amp;gt;DATDIR&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;undef&amp;lt;/tt&amp;gt;ed in critical parts of the source code.&lt;br /&gt;
* The &amp;lt;tt&amp;gt;sleep&amp;lt;/tt&amp;gt; function is aliased to &amp;lt;tt&amp;gt;usleep&amp;lt;/tt&amp;gt;---which is the name of the MinGW implementation.&lt;br /&gt;
* The way in which Makefiles invoke &amp;lt;tt&amp;gt;gperf&amp;lt;/tt&amp;gt; is amended so that it actually produces output.&lt;br /&gt;
* NULL checks are added to `zstrdup` in src/defobj/internal.m. Some functions in the Swarm library may attempt to call `zstrdup` on a NULL pointer. (This happens if the SWARMHOME environment variable is not set.) Failing to check for this condition can lead to segfaults. `zstrdup` now returns NULL if passed a NULL string or if `alloc` fails to allocate memory for a duplicate.&lt;br /&gt;
&lt;br /&gt;
Full details are contained in the patchfile.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
&lt;br /&gt;
== MinGW ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.mingw.org&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/mingw/files&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 20110530&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org MinGW] is a set of software that aims to provide an environment where software developed on UNIX-like systems can be easily compiled for Windows. Since Swarm is primarily developed on Linux (a UNIX clone), MinGW can ease the task of creating Swarm models that run on Windows.&lt;br /&gt;
&lt;br /&gt;
MinGW is similar to the [http://www.cygwin.org Cygwin] project. The major difference is that MinGW produces executables that depend only on native Windows libraries while Cygwin executables require special compatibility libraries that are part of the Cygwin distribution.&lt;br /&gt;
&lt;br /&gt;
=== Installing MinGW ===&lt;br /&gt;
&lt;br /&gt;
MinGW can be installed by downloading the &amp;amp;quot;Automated MinGW Installer&amp;amp;quot;, which usually has a name like &amp;lt;tt&amp;gt;mingw-get-inst-&amp;amp;lt;date&amp;amp;gt;.exe&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;&amp;amp;lt;date&amp;amp;gt;&amp;lt;/tt&amp;gt; is the datestamp for when the installer was packaged. Running this executable will start the installation process. The installer lets you select which optional components to install; make sure all boxes are checked so you '''install all components'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Setup.png|frame|none|alt=Install all available MinGW components]]&lt;br /&gt;
&lt;br /&gt;
The installer downloads all components from the internet. This will take a while, so have a cup of coffee or walk the dog.&lt;br /&gt;
&lt;br /&gt;
See the following section about also installing an optional, more-functional shell window for MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Using MinGW ===&lt;br /&gt;
&lt;br /&gt;
The MinGW compilers are accessible through the &amp;amp;quot;MinGW Shell&amp;amp;quot; which should be located under the MinGW folder in the Start Menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Shell.png|frame|none|alt=Location of MinGW Shell]]&lt;br /&gt;
&lt;br /&gt;
or by running &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; (if MinGW was installed to its default location).&lt;br /&gt;
&lt;br /&gt;
By default the MinGW shell executes inside of a Windows &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt; terminal. There are a couple major drawbacks to this:&lt;br /&gt;
&lt;br /&gt;
* You cannot resize the window to full-screen.&lt;br /&gt;
* The shell provides limited history scrollback.&lt;br /&gt;
&lt;br /&gt;
MinGW provides a couple of alternative terminals for the MinGW shell which do not have these drawbacks; one of which is called MinTTY. To install MinTTY execute the following in a MinGW shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mintty&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then the &amp;lt;tt&amp;gt;mintty&amp;lt;/tt&amp;gt; command can be used to launch a MinTTY terminal. The MinGW Shell can also be set to launch MinTTY by default by editing the file &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; and changing the following line (approximately line 58):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;quot;x%MSYSCON%&amp;amp;quot; == &amp;amp;quot;xunknown&amp;amp;quot; set MSYSCON=sh.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;quot;x%MSYSCON%&amp;amp;quot; == &amp;amp;quot;xunknown&amp;amp;quot; set MSYSCON=mintty.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A Note About Paths ===&lt;br /&gt;
&lt;br /&gt;
The MinGW Shell emulates a UNIX &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell and thus uses UNIX-style paths, &amp;lt;tt&amp;gt;/path/to/file&amp;lt;/tt&amp;gt;, instead of Windows-style paths, &amp;lt;tt&amp;gt;C:\path\to\file&amp;lt;/tt&amp;gt;. One peculiarity of this process is that the shell must deal with the fact that Windows filesystems have multiple roots (&amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt;, etc.) while a UNIX filesystem only has one root called &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;. The way this is reconciled by the &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell provided with MinGW is that &amp;lt;tt&amp;gt;/c&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt; drive, &amp;lt;tt&amp;gt;/d&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt; drive and so on and so forth.&lt;br /&gt;
&lt;br /&gt;
The root of the filesystem itself, &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;, also has some caveats. &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt; refers to the &amp;lt;tt&amp;gt;mysy&amp;lt;/tt&amp;gt; folder, &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0&amp;lt;/tt&amp;gt; in a default installation. &amp;lt;tt&amp;gt;/usr&amp;lt;/tt&amp;gt; also refers to the same location. Thus, &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/local&amp;lt;/tt&amp;gt; both refer to &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0/local&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== A Note About MinGW-64 ===&lt;br /&gt;
&lt;br /&gt;
Currently Swarm has been developed and tested against the 32-bit version of MinGW. Hence Swarm models produced this way should run in any version of Windows.&lt;br /&gt;
&lt;br /&gt;
The [MinGW-w64][mingw_65] project produces 64-bit MinGW compilers that can produce 64-bit executables that will only run on 64-bit versions of Windows. These executables benefit from:&lt;br /&gt;
&lt;br /&gt;
* Access to more memory. A 32-bit executable will only be able to allocate ~3 GB of RAM---even if the system has more RAM available.&lt;br /&gt;
* Possibly quicker execution speeds due to matching the native architecture of the operating system---however this depends on the types of tasks that the program executes. It has been reported that 64 bit Swarm executables run quicker than 32 bit Swarm executables on Linux.&lt;br /&gt;
&lt;br /&gt;
Currently, no attempt has been made to compile Swarm 2.4.1 with the 64 bit MinGW compilers. If a successful attempt is made, please report it on the [http://www.swarm.org/mailman/listinfo/support Swarm mailing list].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Emacs ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/emacs&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 23.3&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://ftp.gnu.org/gnu/emacs/windows&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GNU Emacs is a text editor that is used by many programmers to edit code. However, Emacs can also be scripted to perform a variety of complicated transformations on text files. The scripts that build the Swarm libraries use Emacs to automate the process of generating some source files. Thus Emacs has to be installed in order to build Swarm from source.&lt;br /&gt;
&lt;br /&gt;
=== Installing Emacs ===&lt;br /&gt;
&lt;br /&gt;
Install Emacs by downloading one of the &amp;lt;tt&amp;gt;emacs-&amp;amp;lt;version&lt;br /&gt;
number&amp;amp;gt;-bin-i386.zip&amp;lt;/tt&amp;gt; files from the download area. Don't use any of the&lt;br /&gt;
files containing &amp;lt;tt&amp;gt;barebin&amp;lt;/tt&amp;gt;. After extracting the ZIP archive there will&lt;br /&gt;
be an Emacs folder containing a subfolder called &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt;. Add this folder&lt;br /&gt;
to your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. [[#RapidEE|RapidEE]] can help edit the&lt;br /&gt;
&amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
== GPerf ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/gperf/&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/gnuwin32/files/gperf&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 3.0.1&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GPerf is a program that produces C code containing hash functions. The scripts&lt;br /&gt;
that build the Swarm libraries use GPerf to generate some source code files.&lt;br /&gt;
Download &amp;lt;tt&amp;gt;gperf.exe&amp;lt;/tt&amp;gt; from the GnuWin32 site on Sourceforge and place it&lt;br /&gt;
somewhere on your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. Again, [[#RapidEE|RapidEE]] can help set the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RapidEE ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.rapidee.com&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 5.0&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.rapidee.com/en/license Freeware]&lt;br /&gt;
&lt;br /&gt;
The Rapid Environment Editor (RapidEE) is a spiffy tool that makes it easy to inspect and alter the value of Windows environment variables, such as the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. RapidEE may be used to edit &amp;amp;quot;System Variables&amp;amp;quot; which will affect all user accounts or &amp;amp;quot;User Variables&amp;amp;quot; which will affect just the current account. Administrative privileges may be required to edit the System Variables.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_1.png|frame|none|alt=The different variables RapidEE can edit]]&lt;br /&gt;
&lt;br /&gt;
Right-clicking on the &amp;lt;tt&amp;gt;Path&amp;lt;/tt&amp;gt; variable in the System Variables or User Variables will bring up a menu that presents the option to &amp;amp;quot;Add value&amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_2.png|frame|none|alt=Adding a new value to the PATH]]&lt;br /&gt;
&lt;br /&gt;
Once the new entry has been added, RapidEE must be told to save the changes. Command line shells, such as &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;, must be restarted in order for them to notice the changes.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_3.png|frame|none|alt=Adding and saving a value]]&lt;br /&gt;
&lt;br /&gt;
== Depends ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.dependencywalker.com/&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 2.2&lt;br /&gt;
&lt;br /&gt;
'''License:''' Freeware&lt;br /&gt;
&lt;br /&gt;
Depends is a usefull utility that scans Windows executables and reports information concerning the Dynamic-link Libraries (DLLs) that those executables require in order to run.&lt;br /&gt;
&lt;br /&gt;
= Software Used to Compile Swarm 2.4.1 =&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!  Name&lt;br /&gt;
!  Verson Used&lt;br /&gt;
!  License&lt;br /&gt;
!  Homepage&lt;br /&gt;
!  Download Area&lt;br /&gt;
|-&lt;br /&gt;
|  ZLib&lt;br /&gt;
|  1.2.5&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG License]&lt;br /&gt;
|  [http://www.zlib.net http://www.zlib.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibFFI&lt;br /&gt;
|  3.0.9&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  [http://sourceware.org/libffi http://sourceware.org/libffi]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibPNG&lt;br /&gt;
|  1.5.4&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG]&lt;br /&gt;
|  [http://www.libpng.org/pub/png/libpng.html http://www.libpng.org/pub/png/libpng.html]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  XPM-NoX&lt;br /&gt;
|  4.2.0&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  unknown&lt;br /&gt;
|  Try: [http://gnuwin32.sourceforge.net/packages/xpm-nox.htm http://gnuwin32.sourceforge.net/packages/xpm-nox.htm]&lt;br /&gt;
|-&lt;br /&gt;
|  Tcl&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Tk&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  BLT&lt;br /&gt;
|  2.4z&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://blt.sourceforge.net http://blt.sourceforge.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  HDF5&lt;br /&gt;
|  1.8.7&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://www.hdfgroup.org/HDF5 http://www.hdfgroup.org/HDF5]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Swarm&lt;br /&gt;
|  2.4.1&lt;br /&gt;
|  [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
|  [http://www.swarm.org http://www.swarm.org]&lt;br /&gt;
|  [http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2174</id>
		<title>Swarm and MinGW</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2174"/>
				<updated>2015-12-03T01:57:56Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This documentation provides information on how to use Swarm on Windows with [http://www.mingw.org MinGW] compilers. The following topics will be covered:&lt;br /&gt;
&lt;br /&gt;
* How to run a Swam model compiled with MinGW on Windows: Once you produce a Swarm model using MinGW (or someone gives one to you), how do you run it on other machines without installing Swarm there?&lt;br /&gt;
* How to use MinGW to compile your own Swarm models, either during model development or so you can distribute working models to others. This requires installing MinGW and our binary Swarm libraries.&lt;br /&gt;
* How to package a model compiled with MinGW so it can be installed and run by itself on Windows machines.&lt;br /&gt;
* How to use MinGW to compile the Swarm libraries, in case you want to build your own Swarm binaries.&lt;br /&gt;
&lt;br /&gt;
Each topic is more difficult than the one before it. However the topics are independent in that it is not necessary to know how to compile the Swarm library in order to run a pre-compiled Swarm model or compile your own model against a pre-compiled version of Swarm.&lt;br /&gt;
&lt;br /&gt;
= Using Swarm Models Compiled with MinGW =&lt;br /&gt;
&lt;br /&gt;
A model that has been compiled using MinGW can be installed and run from a Windows computer without installing MinGW or Swarm. An example code is this build of Heatbugs:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe]&lt;br /&gt;
&lt;br /&gt;
However, running a Swarm model requires some support programs and libraries. These are available as&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-win32.zip&amp;lt;/tt&amp;gt;, available here:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip]&lt;br /&gt;
&lt;br /&gt;
Unzipping that file will create a folder called &amp;lt;tt&amp;gt;swarm&amp;lt;/tt&amp;gt; which should be moved somewhere that is easy to remember. The rest of this tutorial will assume this Swarm folder has been placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before a Swarm model can be run, the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder must be added to the Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; so that Heatbugs can find necessary libraries when it runs. The &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder can be ''temporarily'' added to the path by executing the following in the Windows command line (the command line is accessed using the program &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;path=%PATH%;C:\swarm\bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, it is possible to have conflicts if other versions of libraries used by Swarm, such as HDF5, are already installed and in your path. And some Swarm programs require that the environment variable SWARMHOME be defined, which will typically not be true. These problems can be avoided by using the following statements instead of the above path command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
You can alternatively add the Swarm folder to your &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; permanently by editing the Windows PATH environment variable. A tool like [[#RapidEE|RapidEE]] makes doing so easy, or you can use use Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; to the PATH system variable.&lt;br /&gt;
&lt;br /&gt;
Once the path has been set to include the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder, Swarm models can be started through the Windows command line, or by double-clicking on them from the Windows Explorer.  &lt;br /&gt;
&lt;br /&gt;
The Heatbugs model can now be run by changing the directory of the command line to the folder holding &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; and then executing the program. For example, if &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is located in &amp;lt;tt&amp;gt;C:\Users\example_user\Downloads&amp;lt;/tt&amp;gt;, then the model may be run as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd C:\Users\example_user\Downloads&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(or you can just double-click on &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; from Windows Explorer, which temporarily opens a Windows command terminal while the model runs.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Running_Heatbugs.png|frame|none|alt=Running the Heatbugs model]]&lt;br /&gt;
&lt;br /&gt;
You can also create a simple Windows batch file that sets SWARMHOME and the path and then executes the model. Create a file called, for example &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; in the same directory where &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is, containing these lines: &lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, just double-clicking on &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; will start the model.&lt;br /&gt;
&lt;br /&gt;
If you try this and get an error that some .dll file is not found, then the problem is likely that the path is not set correctly to include the swarm\bin folder. If instead the program crashes without an error statement, then the problem is more likely that SWARMHOME needs to be set.&lt;br /&gt;
&lt;br /&gt;
= Installing Swarm and MinGW to compile models =&lt;br /&gt;
&lt;br /&gt;
To compile Swarm models from source using MinGW, the following simple steps need to be taken to set up the build environment:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|Install MinGW using instructions here]]. Currently only 32-bit MinGW can be used with Swarm. Install all components of MinGW.&lt;br /&gt;
* Download compiled Swarm binaries, archived as [http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip swarm-2.4.1-win32.zip]. Unzip the archive and place the extracted folder at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
The archived Swarm binaries '''MUST''' be placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt; to successfully compile Swarm models. This is because some paths had to be hard-coded by &amp;lt;tt&amp;gt;libtool&amp;lt;/tt&amp;gt; during the creation of the binaries.&lt;br /&gt;
&lt;br /&gt;
The final step before you can compile a Swarm model is to set the &amp;lt;tt&amp;gt;SWARMHOME&amp;lt;/tt&amp;gt; environment variable so that the &amp;amp;quot;make&amp;amp;quot; program knows where to find the Swarm libraries when compiling your code. There are several ways to do this.&lt;br /&gt;
*You can temporarily set SWARMHOME by entering this command in the MinGW shell: &amp;lt;pre&amp;gt;export SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*You can edit your Makefile so it starts with: &amp;lt;pre&amp;gt;SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Set SWARMHOME permanently as a Windows environment variable, either by using [[#RapidEE|RapidEE]] or Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add a new (User or System) variable called SWARMHOME with the value &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After MinGW has been installed and the Swarm binaries have been downloaded, Swarm models may be compiled using the MinGW shell. Start up the program MinGW Shell, cd to the directory containing your code and Makefile, and enter the command &amp;amp;quot;Make&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
An archive of official Swarm example programs can be downloaded from:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
&lt;br /&gt;
We will use the &amp;amp;quot;Heatbugs&amp;amp;quot; model as an example of how to compile a Swarm application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf /path/to/downloaded/swarmapps-2.3.0.tar.gz&lt;br /&gt;
cd swarmapps-2.3.0/objc/heatbugs&lt;br /&gt;
&lt;br /&gt;
make&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''VERY IMPORTANT NOTE: MinGW produces two executables called &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt;---one in the &amp;lt;tt&amp;gt;heatbugs&amp;lt;/tt&amp;gt; folder and another in the &amp;lt;tt&amp;gt;heatbugs/.libs&amp;lt;/tt&amp;gt; folder. You should ignore the executable in the top-level folder, &amp;lt;tt&amp;gt;heatbugs/heatbugs.exe&amp;lt;/tt&amp;gt;, as it is merely a compiled wrapper script that executes &amp;lt;tt&amp;gt;heatbugs/.libs/heatbugs.exe&amp;lt;/tt&amp;gt;. When distributing compiled models, only use binaries from the &amp;lt;tt&amp;gt;.libs&amp;lt;/tt&amp;gt; folder.'''&lt;br /&gt;
&lt;br /&gt;
The resulting executable, &amp;lt;tt&amp;gt;.libs/heatbugs.exe&amp;lt;/tt&amp;gt; may be executing by following the steps described above at ''Using Swarm Models Compiled with MinGW''. These steps must include setting the Windows Path to include &amp;lt;tt&amp;gt;C:\swarm\bin&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Distributing a Swarm Model for Windows Users =&lt;br /&gt;
&lt;br /&gt;
A major benefit of the MinGW version of Swarm is that models can be distributed for people to use without installing Swarm. A simple way to do this, after the model has been compiled and tested using methods in the previous section, is to create a ZIP archive that contains all the files to run the model.&lt;br /&gt;
&lt;br /&gt;
* Create a directory tree that includes the Swarm binary files. For example, create C:\MySwarmModel and add the Swarm binaries (as described [[Swarm_and_MinGW#Using_Swarm_Models_Compiled_with_MinGW|above]]) to it as a subdirectory tree.&lt;br /&gt;
* Create another subdirectory that includes just the compiled model.&lt;br /&gt;
* Create a third subdirectory that includes any input files that the model needs and a batch file that sets the path and executes the model. &lt;br /&gt;
* Zip the whole tree up for distribution.&lt;br /&gt;
&lt;br /&gt;
The directory tree in the zip file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\MySwarmModel\swarm&lt;br /&gt;
                      \bin&lt;br /&gt;
                      \etc&lt;br /&gt;
                      \include&lt;br /&gt;
                      \lib&lt;br /&gt;
                      \man&lt;br /&gt;
                      \share&lt;br /&gt;
               \executable\MySwarmModel.exe&lt;br /&gt;
               \Runfiles\MySwarmModel.bat (and any input files)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the file &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt; contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set SWARMHOME=C:\MySwarmModel\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
C:\MySwarmModel\executable\MySwarmModel.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then users can run the model just by double-clicking on &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Building Swarm Using MinGW =&lt;br /&gt;
&lt;br /&gt;
This tutorial provides directions and code for compiling your own Swarm libraries for Windows. It is a bit advanced---some familiarity with compiling software from source in a Linux environment and knowledge of the UNIX command line is assumed.&lt;br /&gt;
&lt;br /&gt;
== Install Required Tools ==&lt;br /&gt;
&lt;br /&gt;
The first step is to download and install tools required for compiling Swarm. These links provide directions:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|MinGW]]&lt;br /&gt;
* [[#Emacs|Emacs]]&lt;br /&gt;
* [[#GPerf|GPerf]]&lt;br /&gt;
&lt;br /&gt;
== Build Support Libraries ==&lt;br /&gt;
&lt;br /&gt;
The next steps are to build and install the libraries that Swarm depends on. A ZIP archive containing all the source code required can be found at:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip http://download.savannah.gnu.org/releases/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip]&lt;br /&gt;
&lt;br /&gt;
This archive contains two subdirectories:&lt;br /&gt;
&lt;br /&gt;
* sources: This folder contains the source code for each component.&lt;br /&gt;
* patches: This folder contains patchfiles that modfy source code so that MinGW can compile it.&lt;br /&gt;
&lt;br /&gt;
After downloading and extracting the source code archive, open up a MinGW shell and run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
mkdir build&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following steps will all assume your MinGW shell is operating out of the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory. All compiled software will be installed to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt; (The Windows Explorer will see the folder appear at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== ZLib ===&lt;br /&gt;
&lt;br /&gt;
ZLib will be the first library to be built as it is a common dependency for many of the other software components. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following to build Zlib:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/zlib-1.2.5.tar.gz&lt;br /&gt;
cd zlib-1.2.5&lt;br /&gt;
make -f win32/Makefile.gcc&amp;lt;/pre&amp;gt;&lt;br /&gt;
And then the following commands to install ZLib to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -p /c/swarm/bin&lt;br /&gt;
mkdir -p /c/swarm/include&lt;br /&gt;
mkdir -p /c/swarm/lib&lt;br /&gt;
&lt;br /&gt;
cp zlib1.dll /c/swarm/bin/&lt;br /&gt;
cp zconf.h zlib.h /c/swarm/include/&lt;br /&gt;
mv libzdll.a libz.dll.a&lt;br /&gt;
cp *.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LibPNG ===&lt;br /&gt;
&lt;br /&gt;
LibPNG will be built next as its only dependency is ZLib. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following steps to build and install LibPNG:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/libpng-1.5.4.tar.bz2&lt;br /&gt;
cd libpng-1.5.4&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm --with-zlib-prefix=/c/swarm&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XPM ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, the XPM library can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/xpm-nox-4.2.0.tar.bz2&lt;br /&gt;
cd xpm-nox-4.2.0&lt;br /&gt;
patch -p1 &amp;amp;lt; ../../patches/xpm-nox-4.2.0-mingw-tcl.patch&lt;br /&gt;
&lt;br /&gt;
make CC=gcc&lt;br /&gt;
make install prefix=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
The patchfile is inherited from the SUSE builds of XPM for MinGW and adds Makefiles and other critical components.&lt;br /&gt;
&lt;br /&gt;
One major modification has been made to the SUSE patchfile---&amp;lt;tt&amp;gt;tcl.h&amp;lt;/tt&amp;gt; is included in &amp;lt;tt&amp;gt;xpm.h&amp;lt;/tt&amp;gt;. This is required in order to use XPM while Tk is installed. Conversely, this means that this build of XPM cannot be used without having Tk installed.&lt;br /&gt;
&lt;br /&gt;
=== LibFFI ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, LibFFI can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/libffi-3.0.9.tar.gz&lt;br /&gt;
cd libffi-3.0.9&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
The LibFFI headers get installed in a weird place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mv /c/swarm/lib/libffi-3.0.9/include/*.h /c/swarm/include&lt;br /&gt;
rm -rf /c/swarm/lib/libffi-3.0.9&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tcl ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tcl can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tcl8.4.19-src.tar.gz&lt;br /&gt;
cd tcl8.4.19&lt;br /&gt;
patch -p1 &amp;amp;lt; ../../patches/tcl-8.4.19-fix-lvalues.patch&lt;br /&gt;
cd win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
At two places in the TCL source code, an assignment is made while simultaneously performing a typecast. The typecast and the assignment had to be split into separate operations in order to be acceptable to the MinGW compilers.&lt;br /&gt;
&lt;br /&gt;
=== Tk ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tk can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tk8.4.19-src.tar.gz&lt;br /&gt;
cd tk8.4.19/win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BLT ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, BLT can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/BLT2.4z.tar.gz&lt;br /&gt;
cd blt2.4z&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm --without-x&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDF5 (Optional) ===&lt;br /&gt;
&lt;br /&gt;
Getting HDF5 to work with MinGW is a little tricky. It is an optional dependency, so if support for reading and writing &amp;lt;tt&amp;gt;.hdf&amp;lt;/tt&amp;gt; files is not needed this section can be skipped.&lt;br /&gt;
&lt;br /&gt;
As of version 1.8.7, HDF5 currently does not compile under MinGW. So, we must wrap pre-compiled binaries for use with MinGW. In order to wrap the binaries, we will need an additional tool called &amp;lt;tt&amp;gt;pexports&amp;lt;/tt&amp;gt;. This can be installed using &amp;lt;tt&amp;gt;mingw-get&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mingw-utils&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download 32-bit Windows binaries from the HDF website compiled for use with the Visual Studio compilers (these files have &amp;amp;quot;VS&amp;amp;quot; listed under the ''Compilers'' section). After extracting the archive, the HDF5 libraries can be wrapped for use with MinGW by executing the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd path/to/where/HDF5/was/extracted&lt;br /&gt;
&lt;br /&gt;
for dll in `ls dll/*dll`; do&lt;br /&gt;
  def_file=`basename $dll .dll`.def&lt;br /&gt;
  lib_file=lib`basename $dll dll.dll`.a&lt;br /&gt;
  pexports $dll &amp;amp;gt; $def_file&lt;br /&gt;
  dlltool -d $def_file -l lib/$lib_file&lt;br /&gt;
done&amp;lt;/pre&amp;gt;&lt;br /&gt;
Next, move the libraries and header files needed to use HDF5 from C into &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp dll/hdf5dll.dll dll/szip.dll /c/swarm/bin&lt;br /&gt;
cp include/* /c/swarm/include&lt;br /&gt;
cp lib/libhdf5.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, a patch must be applied to the HDF header file &amp;lt;tt&amp;gt;H5public.h&amp;lt;/tt&amp;gt; so that it doesn't define &amp;lt;tt&amp;gt;ssize_t&amp;lt;/tt&amp;gt;---a constant already defined by MinGW. The required patch is contained in the Swarm MinGW source archive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
patch -p1 -d /c/swarm &amp;amp;lt; patches/hdf5-1.8.7-mingw.patch&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Swarm ==&lt;br /&gt;
&lt;br /&gt;
Finally, the Swarm libraries themselves can be built. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/swarm-2.4.1.tar.gz&lt;br /&gt;
cd swarm-2.4.1&lt;br /&gt;
patch -p1 ../../patches/swarm-2.4.1-mingw.patch&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm \&lt;br /&gt;
  --with-zlibdir=/c/swarm \&lt;br /&gt;
  --with-pngdir=/c/swarm \&lt;br /&gt;
  --with-xpmdir=/c/swarm \&lt;br /&gt;
  --with-ffidir=/c/swarm \&lt;br /&gt;
  --with-tcl=/c/swarm/lib \&lt;br /&gt;
  --with-tk=/c/swarm/lib \&lt;br /&gt;
  --with-bltdir=/c/swarm&lt;br /&gt;
&lt;br /&gt;
cd avcall&lt;br /&gt;
gcc -S avcall-i386.c&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you wrapped HDF5 up for use with MinGW, add &amp;lt;tt&amp;gt;--with-hdf5dir=/c/swarm&amp;lt;/tt&amp;gt; to the list of arguments passed to &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-mingw.patch&amp;lt;/tt&amp;gt; modifies the Swarm source code in the following ways:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;gettimeofday&amp;lt;/tt&amp;gt; is no longer defined in the Swarm sources as MinGW includes this function in its standard library.&lt;br /&gt;
* Swarm GUI functions are updated to be compatible with LibPNG 1.5.&lt;br /&gt;
* The Swarm &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt; script defines &amp;lt;tt&amp;gt;DATADIR&amp;lt;/tt&amp;gt; as a preprocessor macro---this conflicts with variables in the GCC Objective-C library. &amp;lt;tt&amp;gt;DATDIR&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;undef&amp;lt;/tt&amp;gt;ed in critical parts of the source code.&lt;br /&gt;
* The &amp;lt;tt&amp;gt;sleep&amp;lt;/tt&amp;gt; function is aliased to &amp;lt;tt&amp;gt;usleep&amp;lt;/tt&amp;gt;---which is the name of the MinGW implementation.&lt;br /&gt;
* The way in which Makefiles invoke &amp;lt;tt&amp;gt;gperf&amp;lt;/tt&amp;gt; is amended so that it actually produces output.&lt;br /&gt;
* NULL checks are added to `zstrdup` in src/defobj/internal.m. Some functions in the Swarm library may attempt to call `zstrdup` on a NULL pointer. (This happens if the SWARMHOME environment variable is not set.) Failing to check for this condition can lead to segfaults. `zstrdup` now returns NULL if passed a NULL string or if `alloc` fails to allocate memory for a duplicate.&lt;br /&gt;
&lt;br /&gt;
Full details are contained in the patchfile.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
&lt;br /&gt;
== MinGW ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.mingw.org&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/mingw/files&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 20110530&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org MinGW] is a set of software that aims to provide an environment where software developed on UNIX-like systems can be easily compiled for Windows. Since Swarm is primarily developed on Linux (a UNIX clone), MinGW can ease the task of creating Swarm models that run on Windows.&lt;br /&gt;
&lt;br /&gt;
MinGW is similar to the [http://www.cygwin.org Cygwin] project. The major difference is that MinGW produces executables that depend only on native Windows libraries while Cygwin executables require special compatibility libraries that are part of the Cygwin distribution.&lt;br /&gt;
&lt;br /&gt;
=== Installing MinGW ===&lt;br /&gt;
&lt;br /&gt;
MinGW can be installed by downloading the &amp;amp;quot;Automated MinGW Installer&amp;amp;quot;, which usually has a name like &amp;lt;tt&amp;gt;mingw-get-inst-&amp;amp;lt;date&amp;amp;gt;.exe&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;&amp;amp;lt;date&amp;amp;gt;&amp;lt;/tt&amp;gt; is the datestamp for when the installer was packaged. Running this executable will start the installation process. The installer lets you select which optional components to install; make sure all boxes are checked so you '''install all components'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Setup.png|frame|none|alt=Install all available MinGW components]]&lt;br /&gt;
&lt;br /&gt;
The installer downloads all components from the internet. This will take a while, so have a cup of coffee or walk the dog.&lt;br /&gt;
&lt;br /&gt;
See the following section about also installing an optional, more-functional shell window for MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Using MinGW ===&lt;br /&gt;
&lt;br /&gt;
The MinGW compilers are accessible through the &amp;amp;quot;MinGW Shell&amp;amp;quot; which should be located under the MinGW folder in the Start Menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Shell.png|frame|none|alt=Location of MinGW Shell]]&lt;br /&gt;
&lt;br /&gt;
or by running &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; (if MinGW was installed to its default location).&lt;br /&gt;
&lt;br /&gt;
By default the MinGW shell executes inside of a Windows &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt; terminal. There are a couple major drawbacks to this:&lt;br /&gt;
&lt;br /&gt;
* You cannot resize the window to full-screen.&lt;br /&gt;
* The shell provides limited history scrollback.&lt;br /&gt;
&lt;br /&gt;
MinGW provides a couple of alternative terminals for the MinGW shell which do not have these drawbacks; one of which is called MinTTY. To install MinTTY execute the following in a MinGW shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mintty&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then the &amp;lt;tt&amp;gt;mintty&amp;lt;/tt&amp;gt; command can be used to launch a MinTTY terminal. The MinGW Shell can also be set to launch MinTTY by default by editing the file &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; and changing the following line (approximately line 58):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;quot;x%MSYSCON%&amp;amp;quot; == &amp;amp;quot;xunknown&amp;amp;quot; set MSYSCON=sh.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;quot;x%MSYSCON%&amp;amp;quot; == &amp;amp;quot;xunknown&amp;amp;quot; set MSYSCON=mintty.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A Note About Paths ===&lt;br /&gt;
&lt;br /&gt;
The MinGW Shell emulates a UNIX &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell and thus uses UNIX-style paths, &amp;lt;tt&amp;gt;/path/to/file&amp;lt;/tt&amp;gt;, instead of Windows-style paths, &amp;lt;tt&amp;gt;C:\path\to\file&amp;lt;/tt&amp;gt;. One peculiarity of this process is that the shell must deal with the fact that Windows filesystems have multiple roots (&amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt;, etc.) while a UNIX filesystem only has one root called &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;. The way this is reconciled by the &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell provided with MinGW is that &amp;lt;tt&amp;gt;/c&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt; drive, &amp;lt;tt&amp;gt;/d&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt; drive and so on and so forth.&lt;br /&gt;
&lt;br /&gt;
The root of the filesystem itself, &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;, also has some caveats. &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt; refers to the &amp;lt;tt&amp;gt;mysy&amp;lt;/tt&amp;gt; folder, &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0&amp;lt;/tt&amp;gt; in a default installation. &amp;lt;tt&amp;gt;/usr&amp;lt;/tt&amp;gt; also refers to the same location. Thus, &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/local&amp;lt;/tt&amp;gt; both refer to &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0/local&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== A Note About MinGW-64 ===&lt;br /&gt;
&lt;br /&gt;
Currently Swarm has been developed and tested against the 32-bit version of MinGW. Hence Swarm models produced this way should run in any version of Windows.&lt;br /&gt;
&lt;br /&gt;
The [MinGW-w64][mingw_65] project produces 64-bit MinGW compilers that can produce 64-bit executables that will only run on 64-bit versions of Windows. These executables benefit from:&lt;br /&gt;
&lt;br /&gt;
* Access to more memory. A 32-bit executable will only be able to allocate ~3 GB of RAM---even if the system has more RAM available.&lt;br /&gt;
* Possibly quicker execution speeds due to matching the native architecture of the operating system---however this depends on the types of tasks that the program executes. It has been reported that 64 bit Swarm executables run quicker than 32 bit Swarm executables on Linux.&lt;br /&gt;
&lt;br /&gt;
Currently, no attempt has been made to compile Swarm 2.4.1 with the 64 bit MinGW compilers. If a successful attempt is made, please report it on the [http://www.swarm.org/mailman/listinfo/support Swarm mailing list].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Emacs ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/emacs&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 23.3&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://ftp.gnu.org/gnu/emacs/windows&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GNU Emacs is a text editor that is used by many programmers to edit code. However, Emacs can also be scripted to perform a variety of complicated transformations on text files. The scripts that build the Swarm libraries use Emacs to automate the process of generating some source files. Thus Emacs has to be installed in order to build Swarm from source.&lt;br /&gt;
&lt;br /&gt;
=== Installing Emacs ===&lt;br /&gt;
&lt;br /&gt;
Install Emacs by downloading one of the &amp;lt;tt&amp;gt;emacs-&amp;amp;lt;version&lt;br /&gt;
number&amp;amp;gt;-bin-i386.zip&amp;lt;/tt&amp;gt; files from the download area. Don't use any of the&lt;br /&gt;
files containing &amp;lt;tt&amp;gt;barebin&amp;lt;/tt&amp;gt;. After extracting the ZIP archive there will&lt;br /&gt;
be an Emacs folder containing a subfolder called &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt;. Add this folder&lt;br /&gt;
to your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. [[#RapidEE|RapidEE]] can help edit the&lt;br /&gt;
&amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
== GPerf ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/gperf/&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/gnuwin32/files/gperf&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 3.0.1&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GPerf is a program that produces C code containing hash functions. The scripts&lt;br /&gt;
that build the Swarm libraries use GPerf to generate some source code files.&lt;br /&gt;
Download &amp;lt;tt&amp;gt;gperf.exe&amp;lt;/tt&amp;gt; from the GnuWin32 site on Sourceforge and place it&lt;br /&gt;
somewhere on your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. Again, [[#RapidEE|RapidEE]] can help set the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RapidEE ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.rapidee.com&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 5.0&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.rapidee.com/en/license Freeware]&lt;br /&gt;
&lt;br /&gt;
The Rapid Environment Editor (RapidEE) is a spiffy tool that makes it easy to inspect and alter the value of Windows environment variables, such as the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. RapidEE may be used to edit &amp;amp;quot;System Variables&amp;amp;quot; which will affect all user accounts or &amp;amp;quot;User Variables&amp;amp;quot; which will affect just the current account. Administrative privileges may be required to edit the System Variables.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_1.png|frame|none|alt=The different variables RapidEE can edit]]&lt;br /&gt;
&lt;br /&gt;
Right-clicking on the &amp;lt;tt&amp;gt;Path&amp;lt;/tt&amp;gt; variable in the System Variables or User Variables will bring up a menu that presents the option to &amp;amp;quot;Add value&amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_2.png|frame|none|alt=Adding a new value to the PATH]]&lt;br /&gt;
&lt;br /&gt;
Once the new entry has been added, RapidEE must be told to save the changes. Command line shells, such as &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;, must be restarted in order for them to notice the changes.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_3.png|frame|none|alt=Adding and saving a value]]&lt;br /&gt;
&lt;br /&gt;
== Depends ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.dependencywalker.com/&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 2.2&lt;br /&gt;
&lt;br /&gt;
'''License:''' Freeware&lt;br /&gt;
&lt;br /&gt;
Depends is a usefull utility that scans Windows executables and reports information concerning the Dynamic-link Libraries (DLLs) that those executables require in order to run.&lt;br /&gt;
&lt;br /&gt;
= Software Used to Compile Swarm 2.4.1 =&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!  Name&lt;br /&gt;
!  Verson Used&lt;br /&gt;
!  License&lt;br /&gt;
!  Homepage&lt;br /&gt;
!  Download Area&lt;br /&gt;
|-&lt;br /&gt;
|  ZLib&lt;br /&gt;
|  1.2.5&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG License]&lt;br /&gt;
|  [http://www.zlib.net http://www.zlib.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibFFI&lt;br /&gt;
|  3.0.9&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  [http://sourceware.org/libffi http://sourceware.org/libffi]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibPNG&lt;br /&gt;
|  1.5.4&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG]&lt;br /&gt;
|  [http://www.libpng.org/pub/png/libpng.html http://www.libpng.org/pub/png/libpng.html]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  XPM-NoX&lt;br /&gt;
|  4.2.0&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  unknown&lt;br /&gt;
|  [http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32 http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32]&lt;br /&gt;
|-&lt;br /&gt;
|  Tcl&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Tk&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  BLT&lt;br /&gt;
|  2.4z&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://blt.sourceforge.net http://blt.sourceforge.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  HDF5&lt;br /&gt;
|  1.8.7&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://www.hdfgroup.org/HDF5 http://www.hdfgroup.org/HDF5]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Swarm&lt;br /&gt;
|  2.4.1&lt;br /&gt;
|  [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
|  [http://www.swarm.org http://www.swarm.org]&lt;br /&gt;
|  [http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2173</id>
		<title>Swarm and MinGW</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2173"/>
				<updated>2015-12-03T01:55:33Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Installing Emacs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This documentation provides information on how to use Swarm on Windows with [http://www.mingw.org MinGW] compilers. The following topics will be covered:&lt;br /&gt;
&lt;br /&gt;
* How to run a Swam model compiled with MinGW on Windows: Once you produce a Swarm model using MinGW (or someone gives one to you), how do you run it on other machines without installing Swarm there?&lt;br /&gt;
* How to use MinGW to compile your own Swarm models, either during model development or so you can distribute working models to others. This requires installing MinGW and our binary Swarm libraries.&lt;br /&gt;
* How to package a model compiled with MinGW so it can be installed and run by itself on Windows machines.&lt;br /&gt;
* How to use MinGW to compile the Swarm libraries, in case you want to build your own Swarm binaries.&lt;br /&gt;
&lt;br /&gt;
Each topic is more difficult than the one before it. However the topics are independent in that it is not necessary to know how to compile the Swarm library in order to run a pre-compiled Swarm model or compile your own model against a pre-compiled version of Swarm.&lt;br /&gt;
&lt;br /&gt;
= Using Swarm Models Compiled with MinGW =&lt;br /&gt;
&lt;br /&gt;
A model that has been compiled using MinGW can be installed and run from a Windows computer without installing MinGW or Swarm. An example code is this build of Heatbugs:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe]&lt;br /&gt;
&lt;br /&gt;
However, running a Swarm model requires some support programs and libraries. These are available as&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-win32.zip&amp;lt;/tt&amp;gt;, available here:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip]&lt;br /&gt;
&lt;br /&gt;
Unzipping that file will create a folder called &amp;lt;tt&amp;gt;swarm&amp;lt;/tt&amp;gt; which should be moved somewhere that is easy to remember. The rest of this tutorial will assume this Swarm folder has been placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before a Swarm model can be run, the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder must be added to the Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; so that Heatbugs can find necessary libraries when it runs. The &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder can be ''temporarily'' added to the path by executing the following in the Windows command line (the command line is accessed using the program &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;path=%PATH%;C:\swarm\bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, it is possible to have conflicts if other versions of libraries used by Swarm, such as HDF5, are already installed and in your path. And some Swarm programs require that the environment variable SWARMHOME be defined, which will typically not be true. These problems can be avoided by using the following statements instead of the above path command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
You can alternatively add the Swarm folder to your &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; permanently by editing the Windows PATH environment variable. A tool like [[#RapidEE|RapidEE]] makes doing so easy, or you can use use Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; to the PATH system variable.&lt;br /&gt;
&lt;br /&gt;
Once the path has been set to include the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder, Swarm models can be started through the Windows command line, or by double-clicking on them from the Windows Explorer.  &lt;br /&gt;
&lt;br /&gt;
The Heatbugs model can now be run by changing the directory of the command line to the folder holding &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; and then executing the program. For example, if &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is located in &amp;lt;tt&amp;gt;C:\Users\example_user\Downloads&amp;lt;/tt&amp;gt;, then the model may be run as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd C:\Users\example_user\Downloads&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(or you can just double-click on &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; from Windows Explorer, which temporarily opens a Windows command terminal while the model runs.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Running_Heatbugs.png|frame|none|alt=Running the Heatbugs model]]&lt;br /&gt;
&lt;br /&gt;
You can also create a simple Windows batch file that sets SWARMHOME and the path and then executes the model. Create a file called, for example &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; in the same directory where &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is, containing these lines: &lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, just double-clicking on &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; will start the model.&lt;br /&gt;
&lt;br /&gt;
If you try this and get an error that some .dll file is not found, then the problem is likely that the path is not set correctly to include the swarm\bin folder. If instead the program crashes without an error statement, then the problem is more likely that SWARMHOME needs to be set.&lt;br /&gt;
&lt;br /&gt;
= Installing Swarm and MinGW to compile models =&lt;br /&gt;
&lt;br /&gt;
To compile Swarm models from source using MinGW, the following simple steps need to be taken to set up the build environment:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|Install MinGW using instructions here]]. Currently only 32-bit MinGW can be used with Swarm. Install all components of MinGW.&lt;br /&gt;
* Download compiled Swarm binaries, archived as [http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip swarm-2.4.1-win32.zip]. Unzip the archive and place the extracted folder at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
The archived Swarm binaries '''MUST''' be placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt; to successfully compile Swarm models. This is because some paths had to be hard-coded by &amp;lt;tt&amp;gt;libtool&amp;lt;/tt&amp;gt; during the creation of the binaries.&lt;br /&gt;
&lt;br /&gt;
The final step before you can compile a Swarm model is to set the &amp;lt;tt&amp;gt;SWARMHOME&amp;lt;/tt&amp;gt; environment variable so that the &amp;amp;quot;make&amp;amp;quot; program knows where to find the Swarm libraries when compiling your code. There are several ways to do this.&lt;br /&gt;
*You can temporarily set SWARMHOME by entering this command in the MinGW shell: &amp;lt;pre&amp;gt;export SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*You can edit your Makefile so it starts with: &amp;lt;pre&amp;gt;SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Set SWARMHOME permanently as a Windows environment variable, either by using [[#RapidEE|RapidEE]] or Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add a new (User or System) variable called SWARMHOME with the value &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After MinGW has been installed and the Swarm binaries have been downloaded, Swarm models may be compiled using the MinGW shell. Start up the program MinGW Shell, cd to the directory containing your code and Makefile, and enter the command &amp;amp;quot;Make&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
An archive of official Swarm example programs can be downloaded from:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
&lt;br /&gt;
We will use the &amp;amp;quot;Heatbugs&amp;amp;quot; model as an example of how to compile a Swarm application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf /path/to/downloaded/swarmapps-2.3.0.tar.gz&lt;br /&gt;
cd swarmapps-2.3.0/objc/heatbugs&lt;br /&gt;
&lt;br /&gt;
make&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''VERY IMPORTANT NOTE: MinGW produces two executables called &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt;---one in the &amp;lt;tt&amp;gt;heatbugs&amp;lt;/tt&amp;gt; folder and another in the &amp;lt;tt&amp;gt;heatbugs/.libs&amp;lt;/tt&amp;gt; folder. You should ignore the executable in the top-level folder, &amp;lt;tt&amp;gt;heatbugs/heatbugs.exe&amp;lt;/tt&amp;gt;, as it is merely a compiled wrapper script that executes &amp;lt;tt&amp;gt;heatbugs/.libs/heatbugs.exe&amp;lt;/tt&amp;gt;. When distributing compiled models, only use binaries from the &amp;lt;tt&amp;gt;.libs&amp;lt;/tt&amp;gt; folder.'''&lt;br /&gt;
&lt;br /&gt;
The resulting executable, &amp;lt;tt&amp;gt;.libs/heatbugs.exe&amp;lt;/tt&amp;gt; may be executing by following the steps described above at ''Using Swarm Models Compiled with MinGW''. These steps must include setting the Windows Path to include &amp;lt;tt&amp;gt;C:\swarm\bin&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Distributing a Swarm Model for Windows Users =&lt;br /&gt;
&lt;br /&gt;
A major benefit of the MinGW version of Swarm is that models can be distributed for people to use without installing Swarm. A simple way to do this, after the model has been compiled and tested using methods in the previous section, is to create a ZIP archive that contains all the files to run the model.&lt;br /&gt;
&lt;br /&gt;
* Create a directory tree that includes the Swarm binary files. For example, create C:\MySwarmModel and add the Swarm binaries (as described [[Swarm_and_MinGW#Using_Swarm_Models_Compiled_with_MinGW|above]]) to it as a subdirectory tree.&lt;br /&gt;
* Create another subdirectory that includes just the compiled model.&lt;br /&gt;
* Create a third subdirectory that includes any input files that the model needs and a batch file that sets the path and executes the model. &lt;br /&gt;
* Zip the whole tree up for distribution.&lt;br /&gt;
&lt;br /&gt;
The directory tree in the zip file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\MySwarmModel\swarm&lt;br /&gt;
                      \bin&lt;br /&gt;
                      \etc&lt;br /&gt;
                      \include&lt;br /&gt;
                      \lib&lt;br /&gt;
                      \man&lt;br /&gt;
                      \share&lt;br /&gt;
               \executable\MySwarmModel.exe&lt;br /&gt;
               \Runfiles\MySwarmModel.bat (and any input files)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the file &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt; contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set SWARMHOME=C:\MySwarmModel\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
C:\MySwarmModel\executable\MySwarmModel.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then users can run the model just by double-clicking on &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Building Swarm Using MinGW =&lt;br /&gt;
&lt;br /&gt;
This tutorial provides directions and code for compiling your own Swarm libraries for Windows. It is a bit advanced---some familiarity with compiling software from source in a Linux environment and knowledge of the UNIX command line is assumed.&lt;br /&gt;
&lt;br /&gt;
== Install Required Tools ==&lt;br /&gt;
&lt;br /&gt;
The first step is to download and install tools required for compiling Swarm. These links provide directions:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|MinGW]]&lt;br /&gt;
* [[#Emacs|Emacs]]&lt;br /&gt;
* [[#GPerf|GPerf]]&lt;br /&gt;
&lt;br /&gt;
== Build Support Libraries ==&lt;br /&gt;
&lt;br /&gt;
The next steps are to build and install the libraries that Swarm depends on. A ZIP archive containing all the source code required can be found at:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip http://download.savannah.gnu.org/releases/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip]&lt;br /&gt;
&lt;br /&gt;
This archive contains two subdirectories:&lt;br /&gt;
&lt;br /&gt;
* sources: This folder contains the source code for each component.&lt;br /&gt;
* patches: This folder contains patchfiles that modfy source code so that MinGW can compile it.&lt;br /&gt;
&lt;br /&gt;
After downloading and extracting the source code archive, open up a MinGW shell and run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
mkdir build&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following steps will all assume your MinGW shell is operating out of the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory. All compiled software will be installed to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt; (The Windows Explorer will see the folder appear at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== ZLib ===&lt;br /&gt;
&lt;br /&gt;
ZLib will be the first library to be built as it is a common dependency for many of the other software components. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following to build Zlib:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/zlib-1.2.5.tar.gz&lt;br /&gt;
cd zlib-1.2.5&lt;br /&gt;
make -f win32/Makefile.gcc&amp;lt;/pre&amp;gt;&lt;br /&gt;
And then the following commands to install ZLib to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -p /c/swarm/bin&lt;br /&gt;
mkdir -p /c/swarm/include&lt;br /&gt;
mkdir -p /c/swarm/lib&lt;br /&gt;
&lt;br /&gt;
cp zlib1.dll /c/swarm/bin/&lt;br /&gt;
cp zconf.h zlib.h /c/swarm/include/&lt;br /&gt;
mv libzdll.a libz.dll.a&lt;br /&gt;
cp *.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LibPNG ===&lt;br /&gt;
&lt;br /&gt;
LibPNG will be built next as its only dependency is ZLib. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following steps to build and install LibPNG:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/libpng-1.5.4.tar.bz2&lt;br /&gt;
cd libpng-1.5.4&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm --with-zlib-prefix=/c/swarm&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XPM ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, the XPM library can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/xpm-nox-4.2.0.tar.bz2&lt;br /&gt;
cd xpm-nox-4.2.0&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/xpm-nox-4.2.0-mingw-tcl.patch&lt;br /&gt;
&lt;br /&gt;
make CC=gcc&lt;br /&gt;
make install prefix=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
The patchfile is inherited from the SUSE builds of XPM for MinGW and adds Makefiles and other critical components.&lt;br /&gt;
&lt;br /&gt;
One major modification has been made to the SUSE patchfile---&amp;lt;tt&amp;gt;tcl.h&amp;lt;/tt&amp;gt; is included in &amp;lt;tt&amp;gt;xpm.h&amp;lt;/tt&amp;gt;. This is required in order to use XPM while Tk is installed. Conversely, this means that this build of XPM cannot be used without having Tk installed.&lt;br /&gt;
&lt;br /&gt;
=== LibFFI ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, LibFFI can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/libffi-3.0.9.tar.gz&lt;br /&gt;
cd libffi-3.0.9&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
The LibFFI headers get installed in a weird place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mv /c/swarm/lib/libffi-3.0.9/include/*.h /c/swarm/include&lt;br /&gt;
rm -rf /c/swarm/lib/libffi-3.0.9&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tcl ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tcl can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tcl8.4.19-src.tar.gz&lt;br /&gt;
cd tcl8.4.19&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/tcl-8.4.19-fix-lvalues.patch&lt;br /&gt;
cd win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
At two places in the TCL source code, an assignment is made while simultaneously performing a typecast. The typecast and the assignment had to be split into separate operations in order to be acceptable to the MinGW compilers.&lt;br /&gt;
&lt;br /&gt;
=== Tk ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tk can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tk8.4.19-src.tar.gz&lt;br /&gt;
cd tk8.4.19/win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BLT ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, BLT can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/BLT2.4z.tar.gz&lt;br /&gt;
cd blt2.4z&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm --without-x&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDF5 (Optional) ===&lt;br /&gt;
&lt;br /&gt;
Getting HDF5 to work with MinGW is a little tricky. It is an optional dependency, so if support for reading and writing &amp;lt;tt&amp;gt;.hdf&amp;lt;/tt&amp;gt; files is not needed this section can be skipped.&lt;br /&gt;
&lt;br /&gt;
As of version 1.8.7, HDF5 currently does not compile under MinGW. So, we must wrap pre-compiled binaries for use with MinGW. In order to wrap the binaries, we will need an additional tool called &amp;lt;tt&amp;gt;pexports&amp;lt;/tt&amp;gt;. This can be installed using &amp;lt;tt&amp;gt;mingw-get&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mingw-utils&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download 32-bit Windows binaries from the HDF website compiled for use with the Visual Studio compilers (these files have &amp;amp;quot;VS&amp;amp;quot; listed under the ''Compilers'' section). After extracting the archive, the HDF5 libraries can be wrapped for use with MinGW by executing the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd path/to/where/HDF5/was/extracted&lt;br /&gt;
&lt;br /&gt;
for dll in `ls dll/*dll`; do&lt;br /&gt;
  def_file=`basename $dll .dll`.def&lt;br /&gt;
  lib_file=lib`basename $dll dll.dll`.a&lt;br /&gt;
  pexports $dll &amp;amp;amp;gt; $def_file&lt;br /&gt;
  dlltool -d $def_file -l lib/$lib_file&lt;br /&gt;
done&amp;lt;/pre&amp;gt;&lt;br /&gt;
Next, move the libraries and header files needed to use HDF5 from C into &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp dll/hdf5dll.dll dll/szip.dll /c/swarm/bin&lt;br /&gt;
cp include/* /c/swarm/include&lt;br /&gt;
cp lib/libhdf5.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, a patch must be applied to the HDF header file &amp;lt;tt&amp;gt;H5public.h&amp;lt;/tt&amp;gt; so that it doesn't define &amp;lt;tt&amp;gt;ssize_t&amp;lt;/tt&amp;gt;---a constant already defined by MinGW. The required patch is contained in the Swarm MinGW source archive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
patch -p1 -d /c/swarm &amp;amp;amp;lt; patches/hdf5-1.8.7-mingw.patch&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Swarm ==&lt;br /&gt;
&lt;br /&gt;
Finally, the Swarm libraries themselves can be built. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/swarm-2.4.1.tar.gz&lt;br /&gt;
cd swarm-2.4.1&lt;br /&gt;
patch -p1 ../../patches/swarm-2.4.1-mingw.patch&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm \&lt;br /&gt;
  --with-zlibdir=/c/swarm \&lt;br /&gt;
  --with-pngdir=/c/swarm \&lt;br /&gt;
  --with-xpmdir=/c/swarm \&lt;br /&gt;
  --with-ffidir=/c/swarm \&lt;br /&gt;
  --with-tcl=/c/swarm/lib \&lt;br /&gt;
  --with-tk=/c/swarm/lib \&lt;br /&gt;
  --with-bltdir=/c/swarm&lt;br /&gt;
&lt;br /&gt;
cd avcall&lt;br /&gt;
gcc -S avcall-i386.c&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you wrapped HDF5 up for use with MinGW, add &amp;lt;tt&amp;gt;--with-hdf5dir=/c/swarm&amp;lt;/tt&amp;gt; to the list of arguments passed to &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-mingw.patch&amp;lt;/tt&amp;gt; modifies the Swarm source code in the following ways:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;gettimeofday&amp;lt;/tt&amp;gt; is no longer defined in the Swarm sources as MinGW includes this function in its standard library.&lt;br /&gt;
* Swarm GUI functions are updated to be compatible with LibPNG 1.5.&lt;br /&gt;
* The Swarm &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt; script defines &amp;lt;tt&amp;gt;DATADIR&amp;lt;/tt&amp;gt; as a preprocessor macro---this conflicts with variables in the GCC Objective-C library. &amp;lt;tt&amp;gt;DATDIR&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;undef&amp;lt;/tt&amp;gt;ed in critical parts of the source code.&lt;br /&gt;
* The &amp;lt;tt&amp;gt;sleep&amp;lt;/tt&amp;gt; function is aliased to &amp;lt;tt&amp;gt;usleep&amp;lt;/tt&amp;gt;---which is the name of the MinGW implementation.&lt;br /&gt;
* The way in which Makefiles invoke &amp;lt;tt&amp;gt;gperf&amp;lt;/tt&amp;gt; is amended so that it actually produces output.&lt;br /&gt;
* NULL checks are added to `zstrdup` in src/defobj/internal.m. Some functions in the Swarm library may attempt to call `zstrdup` on a NULL pointer. (This happens if the SWARMHOME environment variable is not set.) Failing to check for this condition can lead to segfaults. `zstrdup` now returns NULL if passed a NULL string or if `alloc` fails to allocate memory for a duplicate.&lt;br /&gt;
&lt;br /&gt;
Full details are contained in the patchfile.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
&lt;br /&gt;
== MinGW ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.mingw.org&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/mingw/files&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 20110530&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org MinGW] is a set of software that aims to provide an environment where software developed on UNIX-like systems can be easily compiled for Windows. Since Swarm is primarily developed on Linux (a UNIX clone), MinGW can ease the task of creating Swarm models that run on Windows.&lt;br /&gt;
&lt;br /&gt;
MinGW is similar to the [http://www.cygwin.org Cygwin] project. The major difference is that MinGW produces executables that depend only on native Windows libraries while Cygwin executables require special compatibility libraries that are part of the Cygwin distribution.&lt;br /&gt;
&lt;br /&gt;
=== Installing MinGW ===&lt;br /&gt;
&lt;br /&gt;
MinGW can be installed by downloading the &amp;amp;quot;Automated MinGW Installer&amp;amp;quot;, which usually has a name like &amp;lt;tt&amp;gt;mingw-get-inst-&amp;amp;amp;lt;date&amp;amp;amp;gt;.exe&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;&amp;amp;amp;lt;date&amp;amp;amp;gt;&amp;lt;/tt&amp;gt; is the datestamp for when the installer was packaged. Running this executable will start the installation process. The installer lets you select which optional components to install; make sure all boxes are checked so you '''install all components'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Setup.png|frame|none|alt=Install all available MinGW components]]&lt;br /&gt;
&lt;br /&gt;
The installer downloads all components from the internet. This will take a while, so have a cup of coffee or walk the dog.&lt;br /&gt;
&lt;br /&gt;
See the following section about also installing an optional, more-functional shell window for MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Using MinGW ===&lt;br /&gt;
&lt;br /&gt;
The MinGW compilers are accessible through the &amp;amp;quot;MinGW Shell&amp;amp;quot; which should be located under the MinGW folder in the Start Menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Shell.png|frame|none|alt=Location of MinGW Shell]]&lt;br /&gt;
&lt;br /&gt;
or by running &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; (if MinGW was installed to its default location).&lt;br /&gt;
&lt;br /&gt;
By default the MinGW shell executes inside of a Windows &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt; terminal. There are a couple major drawbacks to this:&lt;br /&gt;
&lt;br /&gt;
* You cannot resize the window to full-screen.&lt;br /&gt;
* The shell provides limited history scrollback.&lt;br /&gt;
&lt;br /&gt;
MinGW provides a couple of alternative terminals for the MinGW shell which do not have these drawbacks; one of which is called MinTTY. To install MinTTY execute the following in a MinGW shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mintty&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then the &amp;lt;tt&amp;gt;mintty&amp;lt;/tt&amp;gt; command can be used to launch a MinTTY terminal. The MinGW Shell can also be set to launch MinTTY by default by editing the file &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; and changing the following line (approximately line 58):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;quot;x%MSYSCON%&amp;amp;quot; == &amp;amp;quot;xunknown&amp;amp;quot; set MSYSCON=sh.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;quot;x%MSYSCON%&amp;amp;quot; == &amp;amp;quot;xunknown&amp;amp;quot; set MSYSCON=mintty.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A Note About Paths ===&lt;br /&gt;
&lt;br /&gt;
The MinGW Shell emulates a UNIX &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell and thus uses UNIX-style paths, &amp;lt;tt&amp;gt;/path/to/file&amp;lt;/tt&amp;gt;, instead of Windows-style paths, &amp;lt;tt&amp;gt;C:\path\to\file&amp;lt;/tt&amp;gt;. One peculiarity of this process is that the shell must deal with the fact that Windows filesystems have multiple roots (&amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt;, etc.) while a UNIX filesystem only has one root called &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;. The way this is reconciled by the &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell provided with MinGW is that &amp;lt;tt&amp;gt;/c&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt; drive, &amp;lt;tt&amp;gt;/d&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt; drive and so on and so forth.&lt;br /&gt;
&lt;br /&gt;
The root of the filesystem itself, &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;, also has some caveats. &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt; refers to the &amp;lt;tt&amp;gt;mysy&amp;lt;/tt&amp;gt; folder, &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0&amp;lt;/tt&amp;gt; in a default installation. &amp;lt;tt&amp;gt;/usr&amp;lt;/tt&amp;gt; also refers to the same location. Thus, &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/local&amp;lt;/tt&amp;gt; both refer to &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0/local&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== A Note About MinGW-64 ===&lt;br /&gt;
&lt;br /&gt;
Currently Swarm has been developed and tested against the 32-bit version of MinGW. Hence Swarm models produced this way should run in any version of Windows.&lt;br /&gt;
&lt;br /&gt;
The [MinGW-w64][mingw_65] project produces 64-bit MinGW compilers that can produce 64-bit executables that will only run on 64-bit versions of Windows. These executables benefit from:&lt;br /&gt;
&lt;br /&gt;
* Access to more memory. A 32-bit executable will only be able to allocate ~3 GB of RAM---even if the system has more RAM available.&lt;br /&gt;
* Possibly quicker execution speeds due to matching the native architecture of the operating system---however this depends on the types of tasks that the program executes. It has been reported that 64 bit Swarm executables run quicker than 32 bit Swarm executables on Linux.&lt;br /&gt;
&lt;br /&gt;
Currently, no attempt has been made to compile Swarm 2.4.1 with the 64 bit MinGW compilers. If a successful attempt is made, please report it on the [http://www.swarm.org/mailman/listinfo/support Swarm mailing list].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Emacs ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/emacs&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 23.3&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://ftp.gnu.org/gnu/emacs/windows&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GNU Emacs is a text editor that is used by many programmers to edit code. However, Emacs can also be scripted to perform a variety of complicated transformations on text files. The scripts that build the Swarm libraries use Emacs to automate the process of generating some source files. Thus Emacs has to be installed in order to build Swarm from source.&lt;br /&gt;
&lt;br /&gt;
=== Installing Emacs ===&lt;br /&gt;
&lt;br /&gt;
Install Emacs by downloading one of the &amp;lt;tt&amp;gt;emacs-&amp;amp;lt;version&lt;br /&gt;
number&amp;amp;gt;-bin-i386.zip&amp;lt;/tt&amp;gt; files from the download area. Don't use any of the&lt;br /&gt;
files containing &amp;lt;tt&amp;gt;barebin&amp;lt;/tt&amp;gt;. After extracting the ZIP archive there will&lt;br /&gt;
be an Emacs folder containing a subfolder called &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt;. Add this folder&lt;br /&gt;
to your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. [[#RapidEE|RapidEE]] can help edit the&lt;br /&gt;
&amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
== GPerf ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/gperf/&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/gnuwin32/files/gperf&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 3.0.1&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GPerf is a program that produces C code containing hash functions. The scripts&lt;br /&gt;
that build the Swarm libraries use GPerf to generate some source code files.&lt;br /&gt;
Download &amp;lt;tt&amp;gt;gperf.exe&amp;lt;/tt&amp;gt; from the GnuWin32 site on Sourceforge and place it&lt;br /&gt;
somewhere on your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. Again, [[#RapidEE|RapidEE]] can help set the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RapidEE ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.rapidee.com&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 5.0&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.rapidee.com/en/license Freeware]&lt;br /&gt;
&lt;br /&gt;
The Rapid Environment Editor (RapidEE) is a spiffy tool that makes it easy to inspect and alter the value of Windows environment variables, such as the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. RapidEE may be used to edit &amp;amp;quot;System Variables&amp;amp;quot; which will affect all user accounts or &amp;amp;quot;User Variables&amp;amp;quot; which will affect just the current account. Administrative privileges may be required to edit the System Variables.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_1.png|frame|none|alt=The different variables RapidEE can edit]]&lt;br /&gt;
&lt;br /&gt;
Right-clicking on the &amp;lt;tt&amp;gt;Path&amp;lt;/tt&amp;gt; variable in the System Variables or User Variables will bring up a menu that presents the option to &amp;amp;quot;Add value&amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_2.png|frame|none|alt=Adding a new value to the PATH]]&lt;br /&gt;
&lt;br /&gt;
Once the new entry has been added, RapidEE must be told to save the changes. Command line shells, such as &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;, must be restarted in order for them to notice the changes.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_3.png|frame|none|alt=Adding and saving a value]]&lt;br /&gt;
&lt;br /&gt;
== Depends ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.dependencywalker.com/&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 2.2&lt;br /&gt;
&lt;br /&gt;
'''License:''' Freeware&lt;br /&gt;
&lt;br /&gt;
Depends is a usefull utility that scans Windows executables and reports information concerning the Dynamic-link Libraries (DLLs) that those executables require in order to run.&lt;br /&gt;
&lt;br /&gt;
= Software Used to Compile Swarm 2.4.1 =&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!  Name&lt;br /&gt;
!  Verson Used&lt;br /&gt;
!  License&lt;br /&gt;
!  Homepage&lt;br /&gt;
!  Download Area&lt;br /&gt;
|-&lt;br /&gt;
|  ZLib&lt;br /&gt;
|  1.2.5&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG License]&lt;br /&gt;
|  [http://www.zlib.net http://www.zlib.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibFFI&lt;br /&gt;
|  3.0.9&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  [http://sourceware.org/libffi http://sourceware.org/libffi]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibPNG&lt;br /&gt;
|  1.5.4&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG]&lt;br /&gt;
|  [http://www.libpng.org/pub/png/libpng.html http://www.libpng.org/pub/png/libpng.html]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  XPM-NoX&lt;br /&gt;
|  4.2.0&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  unknown&lt;br /&gt;
|  [http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32 http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32]&lt;br /&gt;
|-&lt;br /&gt;
|  Tcl&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Tk&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  BLT&lt;br /&gt;
|  2.4z&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://blt.sourceforge.net http://blt.sourceforge.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  HDF5&lt;br /&gt;
|  1.8.7&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://www.hdfgroup.org/HDF5 http://www.hdfgroup.org/HDF5]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Swarm&lt;br /&gt;
|  2.4.1&lt;br /&gt;
|  [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
|  [http://www.swarm.org http://www.swarm.org]&lt;br /&gt;
|  [http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2172</id>
		<title>Swarm and MinGW</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2172"/>
				<updated>2015-12-03T01:54:22Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This documentation provides information on how to use Swarm on Windows with [http://www.mingw.org MinGW] compilers. The following topics will be covered:&lt;br /&gt;
&lt;br /&gt;
* How to run a Swam model compiled with MinGW on Windows: Once you produce a Swarm model using MinGW (or someone gives one to you), how do you run it on other machines without installing Swarm there?&lt;br /&gt;
* How to use MinGW to compile your own Swarm models, either during model development or so you can distribute working models to others. This requires installing MinGW and our binary Swarm libraries.&lt;br /&gt;
* How to package a model compiled with MinGW so it can be installed and run by itself on Windows machines.&lt;br /&gt;
* How to use MinGW to compile the Swarm libraries, in case you want to build your own Swarm binaries.&lt;br /&gt;
&lt;br /&gt;
Each topic is more difficult than the one before it. However the topics are independent in that it is not necessary to know how to compile the Swarm library in order to run a pre-compiled Swarm model or compile your own model against a pre-compiled version of Swarm.&lt;br /&gt;
&lt;br /&gt;
= Using Swarm Models Compiled with MinGW =&lt;br /&gt;
&lt;br /&gt;
A model that has been compiled using MinGW can be installed and run from a Windows computer without installing MinGW or Swarm. An example code is this build of Heatbugs:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe]&lt;br /&gt;
&lt;br /&gt;
However, running a Swarm model requires some support programs and libraries. These are available as&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-win32.zip&amp;lt;/tt&amp;gt;, available here:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip]&lt;br /&gt;
&lt;br /&gt;
Unzipping that file will create a folder called &amp;lt;tt&amp;gt;swarm&amp;lt;/tt&amp;gt; which should be moved somewhere that is easy to remember. The rest of this tutorial will assume this Swarm folder has been placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before a Swarm model can be run, the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder must be added to the Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; so that Heatbugs can find necessary libraries when it runs. The &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder can be ''temporarily'' added to the path by executing the following in the Windows command line (the command line is accessed using the program &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;path=%PATH%;C:\swarm\bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, it is possible to have conflicts if other versions of libraries used by Swarm, such as HDF5, are already installed and in your path. And some Swarm programs require that the environment variable SWARMHOME be defined, which will typically not be true. These problems can be avoided by using the following statements instead of the above path command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
You can alternatively add the Swarm folder to your &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; permanently by editing the Windows PATH environment variable. A tool like [[#RapidEE|RapidEE]] makes doing so easy, or you can use use Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; to the PATH system variable.&lt;br /&gt;
&lt;br /&gt;
Once the path has been set to include the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder, Swarm models can be started through the Windows command line, or by double-clicking on them from the Windows Explorer.  &lt;br /&gt;
&lt;br /&gt;
The Heatbugs model can now be run by changing the directory of the command line to the folder holding &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; and then executing the program. For example, if &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is located in &amp;lt;tt&amp;gt;C:\Users\example_user\Downloads&amp;lt;/tt&amp;gt;, then the model may be run as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd C:\Users\example_user\Downloads&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(or you can just double-click on &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; from Windows Explorer, which temporarily opens a Windows command terminal while the model runs.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Running_Heatbugs.png|frame|none|alt=Running the Heatbugs model]]&lt;br /&gt;
&lt;br /&gt;
You can also create a simple Windows batch file that sets SWARMHOME and the path and then executes the model. Create a file called, for example &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; in the same directory where &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is, containing these lines: &lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, just double-clicking on &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; will start the model.&lt;br /&gt;
&lt;br /&gt;
If you try this and get an error that some .dll file is not found, then the problem is likely that the path is not set correctly to include the swarm\bin folder. If instead the program crashes without an error statement, then the problem is more likely that SWARMHOME needs to be set.&lt;br /&gt;
&lt;br /&gt;
= Installing Swarm and MinGW to compile models =&lt;br /&gt;
&lt;br /&gt;
To compile Swarm models from source using MinGW, the following simple steps need to be taken to set up the build environment:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|Install MinGW using instructions here]]. Currently only 32-bit MinGW can be used with Swarm. Install all components of MinGW.&lt;br /&gt;
* Download compiled Swarm binaries, archived as [http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip swarm-2.4.1-win32.zip]. Unzip the archive and place the extracted folder at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
The archived Swarm binaries '''MUST''' be placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt; to successfully compile Swarm models. This is because some paths had to be hard-coded by &amp;lt;tt&amp;gt;libtool&amp;lt;/tt&amp;gt; during the creation of the binaries.&lt;br /&gt;
&lt;br /&gt;
The final step before you can compile a Swarm model is to set the &amp;lt;tt&amp;gt;SWARMHOME&amp;lt;/tt&amp;gt; environment variable so that the &amp;amp;quot;make&amp;amp;quot; program knows where to find the Swarm libraries when compiling your code. There are several ways to do this.&lt;br /&gt;
*You can temporarily set SWARMHOME by entering this command in the MinGW shell: &amp;lt;pre&amp;gt;export SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*You can edit your Makefile so it starts with: &amp;lt;pre&amp;gt;SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Set SWARMHOME permanently as a Windows environment variable, either by using [[#RapidEE|RapidEE]] or Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add a new (User or System) variable called SWARMHOME with the value &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After MinGW has been installed and the Swarm binaries have been downloaded, Swarm models may be compiled using the MinGW shell. Start up the program MinGW Shell, cd to the directory containing your code and Makefile, and enter the command &amp;amp;quot;Make&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
An archive of official Swarm example programs can be downloaded from:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
&lt;br /&gt;
We will use the &amp;amp;quot;Heatbugs&amp;amp;quot; model as an example of how to compile a Swarm application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf /path/to/downloaded/swarmapps-2.3.0.tar.gz&lt;br /&gt;
cd swarmapps-2.3.0/objc/heatbugs&lt;br /&gt;
&lt;br /&gt;
make&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''VERY IMPORTANT NOTE: MinGW produces two executables called &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt;---one in the &amp;lt;tt&amp;gt;heatbugs&amp;lt;/tt&amp;gt; folder and another in the &amp;lt;tt&amp;gt;heatbugs/.libs&amp;lt;/tt&amp;gt; folder. You should ignore the executable in the top-level folder, &amp;lt;tt&amp;gt;heatbugs/heatbugs.exe&amp;lt;/tt&amp;gt;, as it is merely a compiled wrapper script that executes &amp;lt;tt&amp;gt;heatbugs/.libs/heatbugs.exe&amp;lt;/tt&amp;gt;. When distributing compiled models, only use binaries from the &amp;lt;tt&amp;gt;.libs&amp;lt;/tt&amp;gt; folder.'''&lt;br /&gt;
&lt;br /&gt;
The resulting executable, &amp;lt;tt&amp;gt;.libs/heatbugs.exe&amp;lt;/tt&amp;gt; may be executing by following the steps described above at ''Using Swarm Models Compiled with MinGW''. These steps must include setting the Windows Path to include &amp;lt;tt&amp;gt;C:\swarm\bin&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Distributing a Swarm Model for Windows Users =&lt;br /&gt;
&lt;br /&gt;
A major benefit of the MinGW version of Swarm is that models can be distributed for people to use without installing Swarm. A simple way to do this, after the model has been compiled and tested using methods in the previous section, is to create a ZIP archive that contains all the files to run the model.&lt;br /&gt;
&lt;br /&gt;
* Create a directory tree that includes the Swarm binary files. For example, create C:\MySwarmModel and add the Swarm binaries (as described [[Swarm_and_MinGW#Using_Swarm_Models_Compiled_with_MinGW|above]]) to it as a subdirectory tree.&lt;br /&gt;
* Create another subdirectory that includes just the compiled model.&lt;br /&gt;
* Create a third subdirectory that includes any input files that the model needs and a batch file that sets the path and executes the model. &lt;br /&gt;
* Zip the whole tree up for distribution.&lt;br /&gt;
&lt;br /&gt;
The directory tree in the zip file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\MySwarmModel\swarm&lt;br /&gt;
                      \bin&lt;br /&gt;
                      \etc&lt;br /&gt;
                      \include&lt;br /&gt;
                      \lib&lt;br /&gt;
                      \man&lt;br /&gt;
                      \share&lt;br /&gt;
               \executable\MySwarmModel.exe&lt;br /&gt;
               \Runfiles\MySwarmModel.bat (and any input files)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the file &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt; contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set SWARMHOME=C:\MySwarmModel\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
C:\MySwarmModel\executable\MySwarmModel.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then users can run the model just by double-clicking on &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Building Swarm Using MinGW =&lt;br /&gt;
&lt;br /&gt;
This tutorial provides directions and code for compiling your own Swarm libraries for Windows. It is a bit advanced---some familiarity with compiling software from source in a Linux environment and knowledge of the UNIX command line is assumed.&lt;br /&gt;
&lt;br /&gt;
== Install Required Tools ==&lt;br /&gt;
&lt;br /&gt;
The first step is to download and install tools required for compiling Swarm. These links provide directions:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|MinGW]]&lt;br /&gt;
* [[#Emacs|Emacs]]&lt;br /&gt;
* [[#GPerf|GPerf]]&lt;br /&gt;
&lt;br /&gt;
== Build Support Libraries ==&lt;br /&gt;
&lt;br /&gt;
The next steps are to build and install the libraries that Swarm depends on. A ZIP archive containing all the source code required can be found at:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip http://download.savannah.gnu.org/releases/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip]&lt;br /&gt;
&lt;br /&gt;
This archive contains two subdirectories:&lt;br /&gt;
&lt;br /&gt;
* sources: This folder contains the source code for each component.&lt;br /&gt;
* patches: This folder contains patchfiles that modfy source code so that MinGW can compile it.&lt;br /&gt;
&lt;br /&gt;
After downloading and extracting the source code archive, open up a MinGW shell and run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
mkdir build&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following steps will all assume your MinGW shell is operating out of the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory. All compiled software will be installed to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt; (The Windows Explorer will see the folder appear at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== ZLib ===&lt;br /&gt;
&lt;br /&gt;
ZLib will be the first library to be built as it is a common dependency for many of the other software components. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following to build Zlib:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/zlib-1.2.5.tar.gz&lt;br /&gt;
cd zlib-1.2.5&lt;br /&gt;
make -f win32/Makefile.gcc&amp;lt;/pre&amp;gt;&lt;br /&gt;
And then the following commands to install ZLib to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -p /c/swarm/bin&lt;br /&gt;
mkdir -p /c/swarm/include&lt;br /&gt;
mkdir -p /c/swarm/lib&lt;br /&gt;
&lt;br /&gt;
cp zlib1.dll /c/swarm/bin/&lt;br /&gt;
cp zconf.h zlib.h /c/swarm/include/&lt;br /&gt;
mv libzdll.a libz.dll.a&lt;br /&gt;
cp *.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LibPNG ===&lt;br /&gt;
&lt;br /&gt;
LibPNG will be built next as its only dependency is ZLib. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following steps to build and install LibPNG:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/libpng-1.5.4.tar.bz2&lt;br /&gt;
cd libpng-1.5.4&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm --with-zlib-prefix=/c/swarm&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XPM ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, the XPM library can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/xpm-nox-4.2.0.tar.bz2&lt;br /&gt;
cd xpm-nox-4.2.0&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/xpm-nox-4.2.0-mingw-tcl.patch&lt;br /&gt;
&lt;br /&gt;
make CC=gcc&lt;br /&gt;
make install prefix=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
The patchfile is inherited from the SUSE builds of XPM for MinGW and adds Makefiles and other critical components.&lt;br /&gt;
&lt;br /&gt;
One major modification has been made to the SUSE patchfile---&amp;lt;tt&amp;gt;tcl.h&amp;lt;/tt&amp;gt; is included in &amp;lt;tt&amp;gt;xpm.h&amp;lt;/tt&amp;gt;. This is required in order to use XPM while Tk is installed. Conversely, this means that this build of XPM cannot be used without having Tk installed.&lt;br /&gt;
&lt;br /&gt;
=== LibFFI ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, LibFFI can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/libffi-3.0.9.tar.gz&lt;br /&gt;
cd libffi-3.0.9&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
The LibFFI headers get installed in a weird place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mv /c/swarm/lib/libffi-3.0.9/include/*.h /c/swarm/include&lt;br /&gt;
rm -rf /c/swarm/lib/libffi-3.0.9&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tcl ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tcl can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tcl8.4.19-src.tar.gz&lt;br /&gt;
cd tcl8.4.19&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/tcl-8.4.19-fix-lvalues.patch&lt;br /&gt;
cd win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
At two places in the TCL source code, an assignment is made while simultaneously performing a typecast. The typecast and the assignment had to be split into separate operations in order to be acceptable to the MinGW compilers.&lt;br /&gt;
&lt;br /&gt;
=== Tk ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tk can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tk8.4.19-src.tar.gz&lt;br /&gt;
cd tk8.4.19/win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BLT ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, BLT can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/BLT2.4z.tar.gz&lt;br /&gt;
cd blt2.4z&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm --without-x&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDF5 (Optional) ===&lt;br /&gt;
&lt;br /&gt;
Getting HDF5 to work with MinGW is a little tricky. It is an optional dependency, so if support for reading and writing &amp;lt;tt&amp;gt;.hdf&amp;lt;/tt&amp;gt; files is not needed this section can be skipped.&lt;br /&gt;
&lt;br /&gt;
As of version 1.8.7, HDF5 currently does not compile under MinGW. So, we must wrap pre-compiled binaries for use with MinGW. In order to wrap the binaries, we will need an additional tool called &amp;lt;tt&amp;gt;pexports&amp;lt;/tt&amp;gt;. This can be installed using &amp;lt;tt&amp;gt;mingw-get&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mingw-utils&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download 32-bit Windows binaries from the HDF website compiled for use with the Visual Studio compilers (these files have &amp;amp;quot;VS&amp;amp;quot; listed under the ''Compilers'' section). After extracting the archive, the HDF5 libraries can be wrapped for use with MinGW by executing the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd path/to/where/HDF5/was/extracted&lt;br /&gt;
&lt;br /&gt;
for dll in `ls dll/*dll`; do&lt;br /&gt;
  def_file=`basename $dll .dll`.def&lt;br /&gt;
  lib_file=lib`basename $dll dll.dll`.a&lt;br /&gt;
  pexports $dll &amp;amp;amp;gt; $def_file&lt;br /&gt;
  dlltool -d $def_file -l lib/$lib_file&lt;br /&gt;
done&amp;lt;/pre&amp;gt;&lt;br /&gt;
Next, move the libraries and header files needed to use HDF5 from C into &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp dll/hdf5dll.dll dll/szip.dll /c/swarm/bin&lt;br /&gt;
cp include/* /c/swarm/include&lt;br /&gt;
cp lib/libhdf5.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, a patch must be applied to the HDF header file &amp;lt;tt&amp;gt;H5public.h&amp;lt;/tt&amp;gt; so that it doesn't define &amp;lt;tt&amp;gt;ssize_t&amp;lt;/tt&amp;gt;---a constant already defined by MinGW. The required patch is contained in the Swarm MinGW source archive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
patch -p1 -d /c/swarm &amp;amp;amp;lt; patches/hdf5-1.8.7-mingw.patch&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Swarm ==&lt;br /&gt;
&lt;br /&gt;
Finally, the Swarm libraries themselves can be built. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/swarm-2.4.1.tar.gz&lt;br /&gt;
cd swarm-2.4.1&lt;br /&gt;
patch -p1 ../../patches/swarm-2.4.1-mingw.patch&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm \&lt;br /&gt;
  --with-zlibdir=/c/swarm \&lt;br /&gt;
  --with-pngdir=/c/swarm \&lt;br /&gt;
  --with-xpmdir=/c/swarm \&lt;br /&gt;
  --with-ffidir=/c/swarm \&lt;br /&gt;
  --with-tcl=/c/swarm/lib \&lt;br /&gt;
  --with-tk=/c/swarm/lib \&lt;br /&gt;
  --with-bltdir=/c/swarm&lt;br /&gt;
&lt;br /&gt;
cd avcall&lt;br /&gt;
gcc -S avcall-i386.c&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you wrapped HDF5 up for use with MinGW, add &amp;lt;tt&amp;gt;--with-hdf5dir=/c/swarm&amp;lt;/tt&amp;gt; to the list of arguments passed to &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-mingw.patch&amp;lt;/tt&amp;gt; modifies the Swarm source code in the following ways:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;gettimeofday&amp;lt;/tt&amp;gt; is no longer defined in the Swarm sources as MinGW includes this function in its standard library.&lt;br /&gt;
* Swarm GUI functions are updated to be compatible with LibPNG 1.5.&lt;br /&gt;
* The Swarm &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt; script defines &amp;lt;tt&amp;gt;DATADIR&amp;lt;/tt&amp;gt; as a preprocessor macro---this conflicts with variables in the GCC Objective-C library. &amp;lt;tt&amp;gt;DATDIR&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;undef&amp;lt;/tt&amp;gt;ed in critical parts of the source code.&lt;br /&gt;
* The &amp;lt;tt&amp;gt;sleep&amp;lt;/tt&amp;gt; function is aliased to &amp;lt;tt&amp;gt;usleep&amp;lt;/tt&amp;gt;---which is the name of the MinGW implementation.&lt;br /&gt;
* The way in which Makefiles invoke &amp;lt;tt&amp;gt;gperf&amp;lt;/tt&amp;gt; is amended so that it actually produces output.&lt;br /&gt;
* NULL checks are added to `zstrdup` in src/defobj/internal.m. Some functions in the Swarm library may attempt to call `zstrdup` on a NULL pointer. (This happens if the SWARMHOME environment variable is not set.) Failing to check for this condition can lead to segfaults. `zstrdup` now returns NULL if passed a NULL string or if `alloc` fails to allocate memory for a duplicate.&lt;br /&gt;
&lt;br /&gt;
Full details are contained in the patchfile.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
&lt;br /&gt;
== MinGW ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.mingw.org&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/mingw/files&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 20110530&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org MinGW] is a set of software that aims to provide an environment where software developed on UNIX-like systems can be easily compiled for Windows. Since Swarm is primarily developed on Linux (a UNIX clone), MinGW can ease the task of creating Swarm models that run on Windows.&lt;br /&gt;
&lt;br /&gt;
MinGW is similar to the [http://www.cygwin.org Cygwin] project. The major difference is that MinGW produces executables that depend only on native Windows libraries while Cygwin executables require special compatibility libraries that are part of the Cygwin distribution.&lt;br /&gt;
&lt;br /&gt;
=== Installing MinGW ===&lt;br /&gt;
&lt;br /&gt;
MinGW can be installed by downloading the &amp;amp;quot;Automated MinGW Installer&amp;amp;quot;, which usually has a name like &amp;lt;tt&amp;gt;mingw-get-inst-&amp;amp;amp;lt;date&amp;amp;amp;gt;.exe&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;&amp;amp;amp;lt;date&amp;amp;amp;gt;&amp;lt;/tt&amp;gt; is the datestamp for when the installer was packaged. Running this executable will start the installation process. The installer lets you select which optional components to install; make sure all boxes are checked so you '''install all components'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Setup.png|frame|none|alt=Install all available MinGW components]]&lt;br /&gt;
&lt;br /&gt;
The installer downloads all components from the internet. This will take a while, so have a cup of coffee or walk the dog.&lt;br /&gt;
&lt;br /&gt;
See the following section about also installing an optional, more-functional shell window for MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Using MinGW ===&lt;br /&gt;
&lt;br /&gt;
The MinGW compilers are accessible through the &amp;amp;quot;MinGW Shell&amp;amp;quot; which should be located under the MinGW folder in the Start Menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Shell.png|frame|none|alt=Location of MinGW Shell]]&lt;br /&gt;
&lt;br /&gt;
or by running &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; (if MinGW was installed to its default location).&lt;br /&gt;
&lt;br /&gt;
By default the MinGW shell executes inside of a Windows &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt; terminal. There are a couple major drawbacks to this:&lt;br /&gt;
&lt;br /&gt;
* You cannot resize the window to full-screen.&lt;br /&gt;
* The shell provides limited history scrollback.&lt;br /&gt;
&lt;br /&gt;
MinGW provides a couple of alternative terminals for the MinGW shell which do not have these drawbacks; one of which is called MinTTY. To install MinTTY execute the following in a MinGW shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mintty&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then the &amp;lt;tt&amp;gt;mintty&amp;lt;/tt&amp;gt; command can be used to launch a MinTTY terminal. The MinGW Shell can also be set to launch MinTTY by default by editing the file &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; and changing the following line (approximately line 58):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;quot;x%MSYSCON%&amp;amp;quot; == &amp;amp;quot;xunknown&amp;amp;quot; set MSYSCON=sh.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;quot;x%MSYSCON%&amp;amp;quot; == &amp;amp;quot;xunknown&amp;amp;quot; set MSYSCON=mintty.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A Note About Paths ===&lt;br /&gt;
&lt;br /&gt;
The MinGW Shell emulates a UNIX &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell and thus uses UNIX-style paths, &amp;lt;tt&amp;gt;/path/to/file&amp;lt;/tt&amp;gt;, instead of Windows-style paths, &amp;lt;tt&amp;gt;C:\path\to\file&amp;lt;/tt&amp;gt;. One peculiarity of this process is that the shell must deal with the fact that Windows filesystems have multiple roots (&amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt;, etc.) while a UNIX filesystem only has one root called &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;. The way this is reconciled by the &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell provided with MinGW is that &amp;lt;tt&amp;gt;/c&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt; drive, &amp;lt;tt&amp;gt;/d&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt; drive and so on and so forth.&lt;br /&gt;
&lt;br /&gt;
The root of the filesystem itself, &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;, also has some caveats. &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt; refers to the &amp;lt;tt&amp;gt;mysy&amp;lt;/tt&amp;gt; folder, &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0&amp;lt;/tt&amp;gt; in a default installation. &amp;lt;tt&amp;gt;/usr&amp;lt;/tt&amp;gt; also refers to the same location. Thus, &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/local&amp;lt;/tt&amp;gt; both refer to &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0/local&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== A Note About MinGW-64 ===&lt;br /&gt;
&lt;br /&gt;
Currently Swarm has been developed and tested against the 32-bit version of MinGW. Hence Swarm models produced this way should run in any version of Windows.&lt;br /&gt;
&lt;br /&gt;
The [MinGW-w64][mingw_65] project produces 64-bit MinGW compilers that can produce 64-bit executables that will only run on 64-bit versions of Windows. These executables benefit from:&lt;br /&gt;
&lt;br /&gt;
* Access to more memory. A 32-bit executable will only be able to allocate ~3 GB of RAM---even if the system has more RAM available.&lt;br /&gt;
* Possibly quicker execution speeds due to matching the native architecture of the operating system---however this depends on the types of tasks that the program executes. It has been reported that 64 bit Swarm executables run quicker than 32 bit Swarm executables on Linux.&lt;br /&gt;
&lt;br /&gt;
Currently, no attempt has been made to compile Swarm 2.4.1 with the 64 bit MinGW compilers. If a successful attempt is made, please report it on the [http://www.swarm.org/mailman/listinfo/support Swarm mailing list].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Emacs ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/emacs&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 23.3&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://ftp.gnu.org/gnu/emacs/windows&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GNU Emacs is a text editor that is used by many programmers to edit code. However, Emacs can also be scripted to perform a variety of complicated transformations on text files. The scripts that build the Swarm libraries use Emacs to automate the process of generating some source files. Thus Emacs has to be installed in order to build Swarm from source.&lt;br /&gt;
&lt;br /&gt;
=== Installing Emacs ===&lt;br /&gt;
&lt;br /&gt;
Install Emacs by downloading one of the &amp;lt;tt&amp;gt;emacs-&amp;amp;amp;lt;version&lt;br /&gt;
number&amp;amp;amp;gt;-bin-i386.zip&amp;lt;/tt&amp;gt; files from the download area. Don't use any of the&lt;br /&gt;
files containing &amp;lt;tt&amp;gt;barebin&amp;lt;/tt&amp;gt;. After extracting the ZIP archive there will&lt;br /&gt;
be an Emacs folder containing a subfolder called &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt;. Add this folder&lt;br /&gt;
to your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. [[#RapidEE|RapidEE]] can help edit the&lt;br /&gt;
&amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GPerf ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/gperf/&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/gnuwin32/files/gperf&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 3.0.1&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GPerf is a program that produces C code containing hash functions. The scripts&lt;br /&gt;
that build the Swarm libraries use GPerf to generate some source code files.&lt;br /&gt;
Download &amp;lt;tt&amp;gt;gperf.exe&amp;lt;/tt&amp;gt; from the GnuWin32 site on Sourceforge and place it&lt;br /&gt;
somewhere on your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. Again, [[#RapidEE|RapidEE]] can help set the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RapidEE ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.rapidee.com&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 5.0&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.rapidee.com/en/license Freeware]&lt;br /&gt;
&lt;br /&gt;
The Rapid Environment Editor (RapidEE) is a spiffy tool that makes it easy to inspect and alter the value of Windows environment variables, such as the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. RapidEE may be used to edit &amp;amp;quot;System Variables&amp;amp;quot; which will affect all user accounts or &amp;amp;quot;User Variables&amp;amp;quot; which will affect just the current account. Administrative privileges may be required to edit the System Variables.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_1.png|frame|none|alt=The different variables RapidEE can edit]]&lt;br /&gt;
&lt;br /&gt;
Right-clicking on the &amp;lt;tt&amp;gt;Path&amp;lt;/tt&amp;gt; variable in the System Variables or User Variables will bring up a menu that presents the option to &amp;amp;quot;Add value&amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_2.png|frame|none|alt=Adding a new value to the PATH]]&lt;br /&gt;
&lt;br /&gt;
Once the new entry has been added, RapidEE must be told to save the changes. Command line shells, such as &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;, must be restarted in order for them to notice the changes.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_3.png|frame|none|alt=Adding and saving a value]]&lt;br /&gt;
&lt;br /&gt;
== Depends ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.dependencywalker.com/&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 2.2&lt;br /&gt;
&lt;br /&gt;
'''License:''' Freeware&lt;br /&gt;
&lt;br /&gt;
Depends is a usefull utility that scans Windows executables and reports information concerning the Dynamic-link Libraries (DLLs) that those executables require in order to run.&lt;br /&gt;
&lt;br /&gt;
= Software Used to Compile Swarm 2.4.1 =&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!  Name&lt;br /&gt;
!  Verson Used&lt;br /&gt;
!  License&lt;br /&gt;
!  Homepage&lt;br /&gt;
!  Download Area&lt;br /&gt;
|-&lt;br /&gt;
|  ZLib&lt;br /&gt;
|  1.2.5&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG License]&lt;br /&gt;
|  [http://www.zlib.net http://www.zlib.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibFFI&lt;br /&gt;
|  3.0.9&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  [http://sourceware.org/libffi http://sourceware.org/libffi]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibPNG&lt;br /&gt;
|  1.5.4&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG]&lt;br /&gt;
|  [http://www.libpng.org/pub/png/libpng.html http://www.libpng.org/pub/png/libpng.html]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  XPM-NoX&lt;br /&gt;
|  4.2.0&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  unknown&lt;br /&gt;
|  [http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32 http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32]&lt;br /&gt;
|-&lt;br /&gt;
|  Tcl&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Tk&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  BLT&lt;br /&gt;
|  2.4z&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://blt.sourceforge.net http://blt.sourceforge.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  HDF5&lt;br /&gt;
|  1.8.7&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://www.hdfgroup.org/HDF5 http://www.hdfgroup.org/HDF5]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Swarm&lt;br /&gt;
|  2.4.1&lt;br /&gt;
|  [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
|  [http://www.swarm.org http://www.swarm.org]&lt;br /&gt;
|  [http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2171</id>
		<title>Swarm and MinGW</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2171"/>
				<updated>2015-12-03T01:50:57Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* RapidEE */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This documentation provides information on how to use Swarm on Windows with [http://www.mingw.org MinGW] compilers. The following topics will be covered:&lt;br /&gt;
&lt;br /&gt;
* How to run a Swam model compiled with MinGW on Windows: Once you produce a Swarm model using MinGW (or someone gives one to you), how do you run it on other machines without installing Swarm there?&lt;br /&gt;
* How to use MinGW to compile your own Swarm models, either during model development or so you can distribute working models to others. This requires installing MinGW and our binary Swarm libraries.&lt;br /&gt;
* How to package a model compiled with MinGW so it can be installed and run by itself on Windows machines.&lt;br /&gt;
* How to use MinGW to compile the Swarm libraries, in case you want to build your own Swarm binaries.&lt;br /&gt;
&lt;br /&gt;
Each topic is more difficult than the one before it. However the topics are independent in that it is not necessary to know how to compile the Swarm library in order to run a pre-compiled Swarm model or compile your own model against a pre-compiled version of Swarm.&lt;br /&gt;
&lt;br /&gt;
= Using Swarm Models Compiled with MinGW =&lt;br /&gt;
&lt;br /&gt;
A model that has been compiled using MinGW can be installed and run from a Windows computer without installing MinGW or Swarm. An example code is this build of Heatbugs:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe]&lt;br /&gt;
&lt;br /&gt;
However, running a Swarm model requires some support programs and libraries. These are available as&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-win32.zip&amp;lt;/tt&amp;gt;, available here:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip]&lt;br /&gt;
&lt;br /&gt;
Unzipping that file will create a folder called &amp;lt;tt&amp;gt;swarm&amp;lt;/tt&amp;gt; which should be moved somewhere that is easy to remember. The rest of this tutorial will assume this Swarm folder has been placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before a Swarm model can be run, the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder must be added to the Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; so that Heatbugs can find necessary libraries when it runs. The &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder can be ''temporarily'' added to the path by executing the following in the Windows command line (the command line is accessed using the program &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;path=%PATH%;C:\swarm\bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, it is possible to have conflicts if other versions of libraries used by Swarm, such as HDF5, are already installed and in your path. And some Swarm programs require that the environment variable SWARMHOME be defined, which will typically not be true. These problems can be avoided by using the following statements instead of the above path command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
You can alternatively add the Swarm folder to your &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; permanently by editing the Windows PATH environment variable. A tool like [[#RapidEE|RapidEE]] makes doing so easy, or you can use use Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; to the PATH system variable.&lt;br /&gt;
&lt;br /&gt;
Once the path has been set to include the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder, Swarm models can be started through the Windows command line, or by double-clicking on them from the Windows Explorer.  &lt;br /&gt;
&lt;br /&gt;
The Heatbugs model can now be run by changing the directory of the command line to the folder holding &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; and then executing the program. For example, if &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is located in &amp;lt;tt&amp;gt;C:\Users\example_user\Downloads&amp;lt;/tt&amp;gt;, then the model may be run as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd C:\Users\example_user\Downloads&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(or you can just double-click on &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; from Windows Explorer, which temporarily opens a Windows command terminal while the model runs.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Running_Heatbugs.png|frame|none|alt=Running the Heatbugs model]]&lt;br /&gt;
&lt;br /&gt;
You can also create a simple Windows batch file that sets SWARMHOME and the path and then executes the model. Create a file called, for example &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; in the same directory where &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is, containing these lines: &lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, just double-clicking on &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; will start the model.&lt;br /&gt;
&lt;br /&gt;
If you try this and get an error that some .dll file is not found, then the problem is likely that the path is not set correctly to include the swarm\bin folder. If instead the program crashes without an error statement, then the problem is more likely that SWARMHOME needs to be set.&lt;br /&gt;
&lt;br /&gt;
= Installing Swarm and MinGW to compile models =&lt;br /&gt;
&lt;br /&gt;
To compile Swarm models from source using MinGW, the following simple steps need to be taken to set up the build environment:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|Install MinGW using instructions here]]. Currently only 32-bit MinGW can be used with Swarm. Install all components of MinGW.&lt;br /&gt;
* Download compiled Swarm binaries, archived as [http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip swarm-2.4.1-win32.zip]. Unzip the archive and place the extracted folder at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
The archived Swarm binaries '''MUST''' be placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt; to successfully compile Swarm models. This is because some paths had to be hard-coded by &amp;lt;tt&amp;gt;libtool&amp;lt;/tt&amp;gt; during the creation of the binaries.&lt;br /&gt;
&lt;br /&gt;
The final step before you can compile a Swarm model is to set the &amp;lt;tt&amp;gt;SWARMHOME&amp;lt;/tt&amp;gt; environment variable so that the &amp;amp;quot;make&amp;amp;quot; program knows where to find the Swarm libraries when compiling your code. There are several ways to do this.&lt;br /&gt;
*You can temporarily set SWARMHOME by entering this command in the MinGW shell: &amp;lt;pre&amp;gt;export SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*You can edit your Makefile so it starts with: &amp;lt;pre&amp;gt;SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Set SWARMHOME permanently as a Windows environment variable, either by using [[#RapidEE|RapidEE]] or Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add a new (User or System) variable called SWARMHOME with the value &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After MinGW has been installed and the Swarm binaries have been downloaded, Swarm models may be compiled using the MinGW shell. Start up the program MinGW Shell, cd to the directory containing your code and Makefile, and enter the command &amp;amp;quot;Make&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
An archive of official Swarm example programs can be downloaded from:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
&lt;br /&gt;
We will use the &amp;amp;quot;Heatbugs&amp;amp;quot; model as an example of how to compile a Swarm application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf /path/to/downloaded/swarmapps-2.3.0.tar.gz&lt;br /&gt;
cd swarmapps-2.3.0/objc/heatbugs&lt;br /&gt;
&lt;br /&gt;
make&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''VERY IMPORTANT NOTE: MinGW produces two executables called &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt;---one in the &amp;lt;tt&amp;gt;heatbugs&amp;lt;/tt&amp;gt; folder and another in the &amp;lt;tt&amp;gt;heatbugs/.libs&amp;lt;/tt&amp;gt; folder. You should ignore the executable in the top-level folder, &amp;lt;tt&amp;gt;heatbugs/heatbugs.exe&amp;lt;/tt&amp;gt;, as it is merely a compiled wrapper script that executes &amp;lt;tt&amp;gt;heatbugs/.libs/heatbugs.exe&amp;lt;/tt&amp;gt;. When distributing compiled models, only use binaries from the &amp;lt;tt&amp;gt;.libs&amp;lt;/tt&amp;gt; folder.'''&lt;br /&gt;
&lt;br /&gt;
The resulting executable, &amp;lt;tt&amp;gt;.libs/heatbugs.exe&amp;lt;/tt&amp;gt; may be executing by following the steps described above at ''Using Swarm Models Compiled with MinGW''. These steps must include setting the Windows Path to include &amp;lt;tt&amp;gt;C:\swarm\bin&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Distributing a Swarm Model for Windows Users =&lt;br /&gt;
&lt;br /&gt;
A major benefit of the MinGW version of Swarm is that models can be distributed for people to use without installing Swarm. A simple way to do this, after the model has been compiled and tested using methods in the previous section, is to create a ZIP archive that contains all the files to run the model.&lt;br /&gt;
&lt;br /&gt;
* Create a directory tree that includes the Swarm binary files. For example, create C:\MySwarmModel and add the Swarm binaries (as described [[Swarm_and_MinGW#Using_Swarm_Models_Compiled_with_MinGW|above]]) to it as a subdirectory tree.&lt;br /&gt;
* Create another subdirectory that includes just the compiled model.&lt;br /&gt;
* Create a third subdirectory that includes any input files that the model needs and a batch file that sets the path and executes the model. &lt;br /&gt;
* Zip the whole tree up for distribution.&lt;br /&gt;
&lt;br /&gt;
The directory tree in the zip file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\MySwarmModel\swarm&lt;br /&gt;
                      \bin&lt;br /&gt;
                      \etc&lt;br /&gt;
                      \include&lt;br /&gt;
                      \lib&lt;br /&gt;
                      \man&lt;br /&gt;
                      \share&lt;br /&gt;
               \executable\MySwarmModel.exe&lt;br /&gt;
               \Runfiles\MySwarmModel.bat (and any input files)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the file &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt; contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set SWARMHOME=C:\MySwarmModel\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
C:\MySwarmModel\executable\MySwarmModel.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then users can run the model just by double-clicking on &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Building Swarm Using MinGW =&lt;br /&gt;
&lt;br /&gt;
This tutorial provides directions and code for compiling your own Swarm libraries for Windows. It is a bit advanced---some familiarity with compiling software from source in a Linux environment and knowledge of the UNIX command line is assumed.&lt;br /&gt;
&lt;br /&gt;
== Install Required Tools ==&lt;br /&gt;
&lt;br /&gt;
The first step is to download and install tools required for compiling Swarm. These links provide directions:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|MinGW]]&lt;br /&gt;
* [[#Emacs|Emacs]]&lt;br /&gt;
* [[#GPerf|GPerf]]&lt;br /&gt;
&lt;br /&gt;
== Build Support Libraries ==&lt;br /&gt;
&lt;br /&gt;
The next steps are to build and install the libraries that Swarm depends on. A ZIP archive containing all the source code required can be found at:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip http://download.savannah.gnu.org/releases/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip]&lt;br /&gt;
&lt;br /&gt;
This archive contains two subdirectories:&lt;br /&gt;
&lt;br /&gt;
* sources: This folder contains the source code for each component.&lt;br /&gt;
* patches: This folder contains patchfiles that modfy source code so that MinGW can compile it.&lt;br /&gt;
&lt;br /&gt;
After downloading and extracting the source code archive, open up a MinGW shell and run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
mkdir build&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following steps will all assume your MinGW shell is operating out of the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory. All compiled software will be installed to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt; (The Windows Explorer will see the folder appear at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== ZLib ===&lt;br /&gt;
&lt;br /&gt;
ZLib will be the first library to be built as it is a common dependency for many of the other software components. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following to build Zlib:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/zlib-1.2.5.tar.gz&lt;br /&gt;
cd zlib-1.2.5&lt;br /&gt;
make -f win32/Makefile.gcc&amp;lt;/pre&amp;gt;&lt;br /&gt;
And then the following commands to install ZLib to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -p /c/swarm/bin&lt;br /&gt;
mkdir -p /c/swarm/include&lt;br /&gt;
mkdir -p /c/swarm/lib&lt;br /&gt;
&lt;br /&gt;
cp zlib1.dll /c/swarm/bin/&lt;br /&gt;
cp zconf.h zlib.h /c/swarm/include/&lt;br /&gt;
mv libzdll.a libz.dll.a&lt;br /&gt;
cp *.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LibPNG ===&lt;br /&gt;
&lt;br /&gt;
LibPNG will be built next as its only dependency is ZLib. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following steps to build and install LibPNG:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/libpng-1.5.4.tar.bz2&lt;br /&gt;
cd libpng-1.5.4&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm --with-zlib-prefix=/c/swarm&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XPM ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, the XPM library can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/xpm-nox-4.2.0.tar.bz2&lt;br /&gt;
cd xpm-nox-4.2.0&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/xpm-nox-4.2.0-mingw-tcl.patch&lt;br /&gt;
&lt;br /&gt;
make CC=gcc&lt;br /&gt;
make install prefix=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
The patchfile is inherited from the SUSE builds of XPM for MinGW and adds Makefiles and other critical components.&lt;br /&gt;
&lt;br /&gt;
One major modification has been made to the SUSE patchfile---&amp;lt;tt&amp;gt;tcl.h&amp;lt;/tt&amp;gt; is included in &amp;lt;tt&amp;gt;xpm.h&amp;lt;/tt&amp;gt;. This is required in order to use XPM while Tk is installed. Conversely, this means that this build of XPM cannot be used without having Tk installed.&lt;br /&gt;
&lt;br /&gt;
=== LibFFI ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, LibFFI can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/libffi-3.0.9.tar.gz&lt;br /&gt;
cd libffi-3.0.9&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
The LibFFI headers get installed in a weird place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mv /c/swarm/lib/libffi-3.0.9/include/*.h /c/swarm/include&lt;br /&gt;
rm -rf /c/swarm/lib/libffi-3.0.9&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tcl ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tcl can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tcl8.4.19-src.tar.gz&lt;br /&gt;
cd tcl8.4.19&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/tcl-8.4.19-fix-lvalues.patch&lt;br /&gt;
cd win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
At two places in the TCL source code, an assignment is made while simultaneously performing a typecast. The typecast and the assignment had to be split into separate operations in order to be acceptable to the MinGW compilers.&lt;br /&gt;
&lt;br /&gt;
=== Tk ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tk can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tk8.4.19-src.tar.gz&lt;br /&gt;
cd tk8.4.19/win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BLT ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, BLT can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/BLT2.4z.tar.gz&lt;br /&gt;
cd blt2.4z&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm --without-x&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDF5 (Optional) ===&lt;br /&gt;
&lt;br /&gt;
Getting HDF5 to work with MinGW is a little tricky. It is an optional dependency, so if support for reading and writing &amp;lt;tt&amp;gt;.hdf&amp;lt;/tt&amp;gt; files is not needed this section can be skipped.&lt;br /&gt;
&lt;br /&gt;
As of version 1.8.7, HDF5 currently does not compile under MinGW. So, we must wrap pre-compiled binaries for use with MinGW. In order to wrap the binaries, we will need an additional tool called &amp;lt;tt&amp;gt;pexports&amp;lt;/tt&amp;gt;. This can be installed using &amp;lt;tt&amp;gt;mingw-get&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mingw-utils&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download 32-bit Windows binaries from the HDF website compiled for use with the Visual Studio compilers (these files have &amp;amp;amp;quot;VS&amp;amp;amp;quot; listed under the ''Compilers'' section). After extracting the archive, the HDF5 libraries can be wrapped for use with MinGW by executing the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd path/to/where/HDF5/was/extracted&lt;br /&gt;
&lt;br /&gt;
for dll in `ls dll/*dll`; do&lt;br /&gt;
  def_file=`basename $dll .dll`.def&lt;br /&gt;
  lib_file=lib`basename $dll dll.dll`.a&lt;br /&gt;
  pexports $dll &amp;amp;amp;gt; $def_file&lt;br /&gt;
  dlltool -d $def_file -l lib/$lib_file&lt;br /&gt;
done&amp;lt;/pre&amp;gt;&lt;br /&gt;
Next, move the libraries and header files needed to use HDF5 from C into &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp dll/hdf5dll.dll dll/szip.dll /c/swarm/bin&lt;br /&gt;
cp include/* /c/swarm/include&lt;br /&gt;
cp lib/libhdf5.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, a patch must be applied to the HDF header file &amp;lt;tt&amp;gt;H5public.h&amp;lt;/tt&amp;gt; so that it doesn't define &amp;lt;tt&amp;gt;ssize_t&amp;lt;/tt&amp;gt;---a constant already defined by MinGW. The required patch is contained in the Swarm MinGW source archive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
patch -p1 -d /c/swarm &amp;amp;amp;lt; patches/hdf5-1.8.7-mingw.patch&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Swarm ==&lt;br /&gt;
&lt;br /&gt;
Finally, the Swarm libraries themselves can be built. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/swarm-2.4.1.tar.gz&lt;br /&gt;
cd swarm-2.4.1&lt;br /&gt;
patch -p1 ../../patches/swarm-2.4.1-mingw.patch&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm \&lt;br /&gt;
  --with-zlibdir=/c/swarm \&lt;br /&gt;
  --with-pngdir=/c/swarm \&lt;br /&gt;
  --with-xpmdir=/c/swarm \&lt;br /&gt;
  --with-ffidir=/c/swarm \&lt;br /&gt;
  --with-tcl=/c/swarm/lib \&lt;br /&gt;
  --with-tk=/c/swarm/lib \&lt;br /&gt;
  --with-bltdir=/c/swarm&lt;br /&gt;
&lt;br /&gt;
cd avcall&lt;br /&gt;
gcc -S avcall-i386.c&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you wrapped HDF5 up for use with MinGW, add &amp;lt;tt&amp;gt;--with-hdf5dir=/c/swarm&amp;lt;/tt&amp;gt; to the list of arguments passed to &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-mingw.patch&amp;lt;/tt&amp;gt; modifies the Swarm source code in the following ways:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;gettimeofday&amp;lt;/tt&amp;gt; is no longer defined in the Swarm sources as MinGW includes this function in its standard library.&lt;br /&gt;
* Swarm GUI functions are updated to be compatible with LibPNG 1.5.&lt;br /&gt;
* The Swarm &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt; script defines &amp;lt;tt&amp;gt;DATADIR&amp;lt;/tt&amp;gt; as a preprocessor macro---this conflicts with variables in the GCC Objective-C library. &amp;lt;tt&amp;gt;DATDIR&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;undef&amp;lt;/tt&amp;gt;ed in critical parts of the source code.&lt;br /&gt;
* The &amp;lt;tt&amp;gt;sleep&amp;lt;/tt&amp;gt; function is aliased to &amp;lt;tt&amp;gt;usleep&amp;lt;/tt&amp;gt;---which is the name of the MinGW implementation.&lt;br /&gt;
* The way in which Makefiles invoke &amp;lt;tt&amp;gt;gperf&amp;lt;/tt&amp;gt; is amended so that it actually produces output.&lt;br /&gt;
* NULL checks are added to `zstrdup` in src/defobj/internal.m. Some functions in the Swarm library may attempt to call `zstrdup` on a NULL pointer. (This happens if the SWARMHOME environment variable is not set.) Failing to check for this condition can lead to segfaults. `zstrdup` now returns NULL if passed a NULL string or if `alloc` fails to allocate memory for a duplicate.&lt;br /&gt;
&lt;br /&gt;
Full details are contained in the patchfile.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
&lt;br /&gt;
== MinGW ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.mingw.org&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/mingw/files&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 20110530&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org MinGW] is a set of software that aims to provide an environment where software developed on UNIX-like systems can be easily compiled for Windows. Since Swarm is primarily developed on Linux (a UNIX clone), MinGW can ease the task of creating Swarm models that run on Windows.&lt;br /&gt;
&lt;br /&gt;
MinGW is similar to the [http://www.cygwin.org Cygwin] project. The major difference is that MinGW produces executables that depend only on native Windows libraries while Cygwin executables require special compatibility libraries that are part of the Cygwin distribution.&lt;br /&gt;
&lt;br /&gt;
=== Installing MinGW ===&lt;br /&gt;
&lt;br /&gt;
MinGW can be installed by downloading the &amp;amp;quot;Automated MinGW Installer&amp;amp;quot;, which usually has a name like &amp;lt;tt&amp;gt;mingw-get-inst-&amp;amp;amp;lt;date&amp;amp;amp;gt;.exe&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;&amp;amp;amp;lt;date&amp;amp;amp;gt;&amp;lt;/tt&amp;gt; is the datestamp for when the installer was packaged. Running this executable will start the installation process. The installer lets you select which optional components to install; make sure all boxes are checked so you '''install all components'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Setup.png|frame|none|alt=Install all available MinGW components]]&lt;br /&gt;
&lt;br /&gt;
The installer downloads all components from the internet. This will take a while, so have a cup of coffee or walk the dog.&lt;br /&gt;
&lt;br /&gt;
See the following section about also installing an optional, more-functional shell window for MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Using MinGW ===&lt;br /&gt;
&lt;br /&gt;
The MinGW compilers are accessible through the &amp;amp;amp;quot;MinGW Shell&amp;amp;amp;quot; which should be located under the MinGW folder in the Start Menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Shell.png|frame|none|alt=Location of MinGW Shell]]&lt;br /&gt;
&lt;br /&gt;
or by running &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; (if MinGW was installed to its default location).&lt;br /&gt;
&lt;br /&gt;
By default the MinGW shell executes inside of a Windows &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt; terminal. There are a couple major drawbacks to this:&lt;br /&gt;
&lt;br /&gt;
* You cannot resize the window to full-screen.&lt;br /&gt;
* The shell provides limited history scrollback.&lt;br /&gt;
&lt;br /&gt;
MinGW provides a couple of alternative terminals for the MinGW shell which do not have these drawbacks; one of which is called MinTTY. To install MinTTY execute the following in a MinGW shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mintty&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then the &amp;lt;tt&amp;gt;mintty&amp;lt;/tt&amp;gt; command can be used to launch a MinTTY terminal. The MinGW Shell can also be set to launch MinTTY by default by editing the file &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; and changing the following line (approximately line 58):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=sh.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=mintty.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A Note About Paths ===&lt;br /&gt;
&lt;br /&gt;
The MinGW Shell emulates a UNIX &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell and thus uses UNIX-style paths, &amp;lt;tt&amp;gt;/path/to/file&amp;lt;/tt&amp;gt;, instead of Windows-style paths, &amp;lt;tt&amp;gt;C:\path\to\file&amp;lt;/tt&amp;gt;. One peculiarity of this process is that the shell must deal with the fact that Windows filesystems have multiple roots (&amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt;, etc.) while a UNIX filesystem only has one root called &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;. The way this is reconciled by the &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell provided with MinGW is that &amp;lt;tt&amp;gt;/c&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt; drive, &amp;lt;tt&amp;gt;/d&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt; drive and so on and so forth.&lt;br /&gt;
&lt;br /&gt;
The root of the filesystem itself, &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;, also has some caveats. &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt; refers to the &amp;lt;tt&amp;gt;mysy&amp;lt;/tt&amp;gt; folder, &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0&amp;lt;/tt&amp;gt; in a default installation. &amp;lt;tt&amp;gt;/usr&amp;lt;/tt&amp;gt; also refers to the same location. Thus, &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/local&amp;lt;/tt&amp;gt; both refer to &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0/local&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== A Note About MinGW-64 ===&lt;br /&gt;
&lt;br /&gt;
Currently Swarm has been developed and tested against the 32-bit version of MinGW. Hence Swarm models produced this way should run in any version of Windows.&lt;br /&gt;
&lt;br /&gt;
The [MinGW-w64][mingw_65] project produces 64-bit MinGW compilers that can produce 64-bit executables that will only run on 64-bit versions of Windows. These executables benefit from:&lt;br /&gt;
&lt;br /&gt;
* Access to more memory. A 32-bit executable will only be able to allocate ~3 GB of RAM---even if the system has more RAM available.&lt;br /&gt;
* Possibly quicker execution speeds due to matching the native architecture of the operating system---however this depends on the types of tasks that the program executes. It has been reported that 64 bit Swarm executables run quicker than 32 bit Swarm executables on Linux.&lt;br /&gt;
&lt;br /&gt;
Currently, no attempt has been made to compile Swarm 2.4.1 with the 64 bit MinGW compilers. If a successful attempt is made, please report it on the [http://www.swarm.org/mailman/listinfo/support Swarm mailing list].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Emacs ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/emacs&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 23.3&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://ftp.gnu.org/gnu/emacs/windows&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GNU Emacs is a text editor that is used by many programmers to edit code. However, Emacs can also be scripted to perform a variety of complicated transformations on text files. The scripts that build the Swarm libraries use Emacs to automate the process of generating some source files. Thus Emacs has to be installed in order to build Swarm from source.&lt;br /&gt;
&lt;br /&gt;
=== Installing Emacs ===&lt;br /&gt;
&lt;br /&gt;
Install Emacs by downloading one of the &amp;lt;tt&amp;gt;emacs-&amp;amp;amp;lt;version&lt;br /&gt;
number&amp;amp;amp;gt;-bin-i386.zip&amp;lt;/tt&amp;gt; files from the download area. Don't use any of the&lt;br /&gt;
files containing &amp;lt;tt&amp;gt;barebin&amp;lt;/tt&amp;gt;. After extracting the ZIP archive there will&lt;br /&gt;
be an Emacs folder containing a subfolder called &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt;. Add this folder&lt;br /&gt;
to your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. [[#RapidEE|RapidEE]] can help edit the&lt;br /&gt;
&amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GPerf ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/gperf/&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/gnuwin32/files/gperf&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 3.0.1&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GPerf is a program that produces C code containing hash functions. The scripts&lt;br /&gt;
that build the Swarm libraries use GPerf to generate some source code files.&lt;br /&gt;
Download &amp;lt;tt&amp;gt;gperf.exe&amp;lt;/tt&amp;gt; from the GnuWin32 site on Sourceforge and place it&lt;br /&gt;
somewhere on your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. Again, [[#RapidEE|RapidEE]] can help set the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RapidEE ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.rapidee.com&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 5.0&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.rapidee.com/en/license Freeware]&lt;br /&gt;
&lt;br /&gt;
The Rapid Environment Editor (RapidEE) is a spiffy tool that makes it easy to inspect and alter the value of Windows environment variables, such as the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. RapidEE may be used to edit &amp;amp;quot;System Variables&amp;amp;quot; which will affect all user accounts or &amp;amp;quot;User Variables&amp;amp;quot; which will affect just the current account. Administrative privileges may be required to edit the System Variables.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_1.png|frame|none|alt=The different variables RapidEE can edit]]&lt;br /&gt;
&lt;br /&gt;
Right-clicking on the &amp;lt;tt&amp;gt;Path&amp;lt;/tt&amp;gt; variable in the System Variables or User Variables will bring up a menu that presents the option to &amp;amp;quot;Add value&amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_2.png|frame|none|alt=Adding a new value to the PATH]]&lt;br /&gt;
&lt;br /&gt;
Once the new entry has been added, RapidEE must be told to save the changes. Command line shells, such as &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;, must be restarted in order for them to notice the changes.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_3.png|frame|none|alt=Adding and saving a value]]&lt;br /&gt;
&lt;br /&gt;
== Depends ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.dependencywalker.com/&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 2.2&lt;br /&gt;
&lt;br /&gt;
'''License:''' Freeware&lt;br /&gt;
&lt;br /&gt;
Depends is a usefull utility that scans Windows executables and reports information concerning the Dynamic-link Libraries (DLLs) that those executables require in order to run.&lt;br /&gt;
&lt;br /&gt;
= Software Used to Compile Swarm 2.4.1 =&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!  Name&lt;br /&gt;
!  Verson Used&lt;br /&gt;
!  License&lt;br /&gt;
!  Homepage&lt;br /&gt;
!  Download Area&lt;br /&gt;
|-&lt;br /&gt;
|  ZLib&lt;br /&gt;
|  1.2.5&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG License]&lt;br /&gt;
|  [http://www.zlib.net http://www.zlib.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibFFI&lt;br /&gt;
|  3.0.9&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  [http://sourceware.org/libffi http://sourceware.org/libffi]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibPNG&lt;br /&gt;
|  1.5.4&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG]&lt;br /&gt;
|  [http://www.libpng.org/pub/png/libpng.html http://www.libpng.org/pub/png/libpng.html]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  XPM-NoX&lt;br /&gt;
|  4.2.0&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  unknown&lt;br /&gt;
|  [http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32 http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32]&lt;br /&gt;
|-&lt;br /&gt;
|  Tcl&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Tk&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  BLT&lt;br /&gt;
|  2.4z&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://blt.sourceforge.net http://blt.sourceforge.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  HDF5&lt;br /&gt;
|  1.8.7&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://www.hdfgroup.org/HDF5 http://www.hdfgroup.org/HDF5]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Swarm&lt;br /&gt;
|  2.4.1&lt;br /&gt;
|  [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
|  [http://www.swarm.org http://www.swarm.org]&lt;br /&gt;
|  [http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=File:RapidEE_3.png&amp;diff=2170</id>
		<title>File:RapidEE 3.png</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=File:RapidEE_3.png&amp;diff=2170"/>
				<updated>2015-12-03T01:48:26Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=File:RapidEE_2.png&amp;diff=2169</id>
		<title>File:RapidEE 2.png</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=File:RapidEE_2.png&amp;diff=2169"/>
				<updated>2015-12-03T01:48:06Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=File:RapidEE_1.png&amp;diff=2168</id>
		<title>File:RapidEE 1.png</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=File:RapidEE_1.png&amp;diff=2168"/>
				<updated>2015-12-03T01:47:48Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=File:MinGW_Shell.png&amp;diff=2167</id>
		<title>File:MinGW Shell.png</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=File:MinGW_Shell.png&amp;diff=2167"/>
				<updated>2015-12-03T01:47:18Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=File:MinGW_Setup.png&amp;diff=2166</id>
		<title>File:MinGW Setup.png</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=File:MinGW_Setup.png&amp;diff=2166"/>
				<updated>2015-12-03T01:46:41Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2164</id>
		<title>Swarm and MinGW</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2164"/>
				<updated>2015-12-03T01:42:35Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Installing MinGW */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This documentation provides information on how to use Swarm on Windows with [http://www.mingw.org MinGW] compilers. The following topics will be covered:&lt;br /&gt;
&lt;br /&gt;
* How to run a Swam model compiled with MinGW on Windows: Once you produce a Swarm model using MinGW (or someone gives one to you), how do you run it on other machines without installing Swarm there?&lt;br /&gt;
* How to use MinGW to compile your own Swarm models, either during model development or so you can distribute working models to others. This requires installing MinGW and our binary Swarm libraries.&lt;br /&gt;
* How to package a model compiled with MinGW so it can be installed and run by itself on Windows machines.&lt;br /&gt;
* How to use MinGW to compile the Swarm libraries, in case you want to build your own Swarm binaries.&lt;br /&gt;
&lt;br /&gt;
Each topic is more difficult than the one before it. However the topics are independent in that it is not necessary to know how to compile the Swarm library in order to run a pre-compiled Swarm model or compile your own model against a pre-compiled version of Swarm.&lt;br /&gt;
&lt;br /&gt;
= Using Swarm Models Compiled with MinGW =&lt;br /&gt;
&lt;br /&gt;
A model that has been compiled using MinGW can be installed and run from a Windows computer without installing MinGW or Swarm. An example code is this build of Heatbugs:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe]&lt;br /&gt;
&lt;br /&gt;
However, running a Swarm model requires some support programs and libraries. These are available as&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-win32.zip&amp;lt;/tt&amp;gt;, available here:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip]&lt;br /&gt;
&lt;br /&gt;
Unzipping that file will create a folder called &amp;lt;tt&amp;gt;swarm&amp;lt;/tt&amp;gt; which should be moved somewhere that is easy to remember. The rest of this tutorial will assume this Swarm folder has been placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before a Swarm model can be run, the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder must be added to the Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; so that Heatbugs can find necessary libraries when it runs. The &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder can be ''temporarily'' added to the path by executing the following in the Windows command line (the command line is accessed using the program &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;path=%PATH%;C:\swarm\bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, it is possible to have conflicts if other versions of libraries used by Swarm, such as HDF5, are already installed and in your path. And some Swarm programs require that the environment variable SWARMHOME be defined, which will typically not be true. These problems can be avoided by using the following statements instead of the above path command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
You can alternatively add the Swarm folder to your &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; permanently by editing the Windows PATH environment variable. A tool like [[#RapidEE|RapidEE]] makes doing so easy, or you can use use Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; to the PATH system variable.&lt;br /&gt;
&lt;br /&gt;
Once the path has been set to include the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder, Swarm models can be started through the Windows command line, or by double-clicking on them from the Windows Explorer.  &lt;br /&gt;
&lt;br /&gt;
The Heatbugs model can now be run by changing the directory of the command line to the folder holding &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; and then executing the program. For example, if &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is located in &amp;lt;tt&amp;gt;C:\Users\example_user\Downloads&amp;lt;/tt&amp;gt;, then the model may be run as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd C:\Users\example_user\Downloads&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(or you can just double-click on &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; from Windows Explorer, which temporarily opens a Windows command terminal while the model runs.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Running_Heatbugs.png|frame|none|alt=Running the Heatbugs model]]&lt;br /&gt;
&lt;br /&gt;
You can also create a simple Windows batch file that sets SWARMHOME and the path and then executes the model. Create a file called, for example &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; in the same directory where &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is, containing these lines: &lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, just double-clicking on &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; will start the model.&lt;br /&gt;
&lt;br /&gt;
If you try this and get an error that some .dll file is not found, then the problem is likely that the path is not set correctly to include the swarm\bin folder. If instead the program crashes without an error statement, then the problem is more likely that SWARMHOME needs to be set.&lt;br /&gt;
&lt;br /&gt;
= Installing Swarm and MinGW to compile models =&lt;br /&gt;
&lt;br /&gt;
To compile Swarm models from source using MinGW, the following simple steps need to be taken to set up the build environment:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|Install MinGW using instructions here]]. Currently only 32-bit MinGW can be used with Swarm. Install all components of MinGW.&lt;br /&gt;
* Download compiled Swarm binaries, archived as [http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip swarm-2.4.1-win32.zip]. Unzip the archive and place the extracted folder at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
The archived Swarm binaries '''MUST''' be placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt; to successfully compile Swarm models. This is because some paths had to be hard-coded by &amp;lt;tt&amp;gt;libtool&amp;lt;/tt&amp;gt; during the creation of the binaries.&lt;br /&gt;
&lt;br /&gt;
The final step before you can compile a Swarm model is to set the &amp;lt;tt&amp;gt;SWARMHOME&amp;lt;/tt&amp;gt; environment variable so that the &amp;amp;quot;make&amp;amp;quot; program knows where to find the Swarm libraries when compiling your code. There are several ways to do this.&lt;br /&gt;
*You can temporarily set SWARMHOME by entering this command in the MinGW shell: &amp;lt;pre&amp;gt;export SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*You can edit your Makefile so it starts with: &amp;lt;pre&amp;gt;SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Set SWARMHOME permanently as a Windows environment variable, either by using [[#RapidEE|RapidEE]] or Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add a new (User or System) variable called SWARMHOME with the value &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After MinGW has been installed and the Swarm binaries have been downloaded, Swarm models may be compiled using the MinGW shell. Start up the program MinGW Shell, cd to the directory containing your code and Makefile, and enter the command &amp;amp;quot;Make&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
An archive of official Swarm example programs can be downloaded from:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
&lt;br /&gt;
We will use the &amp;amp;quot;Heatbugs&amp;amp;quot; model as an example of how to compile a Swarm application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf /path/to/downloaded/swarmapps-2.3.0.tar.gz&lt;br /&gt;
cd swarmapps-2.3.0/objc/heatbugs&lt;br /&gt;
&lt;br /&gt;
make&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''VERY IMPORTANT NOTE: MinGW produces two executables called &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt;---one in the &amp;lt;tt&amp;gt;heatbugs&amp;lt;/tt&amp;gt; folder and another in the &amp;lt;tt&amp;gt;heatbugs/.libs&amp;lt;/tt&amp;gt; folder. You should ignore the executable in the top-level folder, &amp;lt;tt&amp;gt;heatbugs/heatbugs.exe&amp;lt;/tt&amp;gt;, as it is merely a compiled wrapper script that executes &amp;lt;tt&amp;gt;heatbugs/.libs/heatbugs.exe&amp;lt;/tt&amp;gt;. When distributing compiled models, only use binaries from the &amp;lt;tt&amp;gt;.libs&amp;lt;/tt&amp;gt; folder.'''&lt;br /&gt;
&lt;br /&gt;
The resulting executable, &amp;lt;tt&amp;gt;.libs/heatbugs.exe&amp;lt;/tt&amp;gt; may be executing by following the steps described above at ''Using Swarm Models Compiled with MinGW''. These steps must include setting the Windows Path to include &amp;lt;tt&amp;gt;C:\swarm\bin&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Distributing a Swarm Model for Windows Users =&lt;br /&gt;
&lt;br /&gt;
A major benefit of the MinGW version of Swarm is that models can be distributed for people to use without installing Swarm. A simple way to do this, after the model has been compiled and tested using methods in the previous section, is to create a ZIP archive that contains all the files to run the model.&lt;br /&gt;
&lt;br /&gt;
* Create a directory tree that includes the Swarm binary files. For example, create C:\MySwarmModel and add the Swarm binaries (as described [[Swarm_and_MinGW#Using_Swarm_Models_Compiled_with_MinGW|above]]) to it as a subdirectory tree.&lt;br /&gt;
* Create another subdirectory that includes just the compiled model.&lt;br /&gt;
* Create a third subdirectory that includes any input files that the model needs and a batch file that sets the path and executes the model. &lt;br /&gt;
* Zip the whole tree up for distribution.&lt;br /&gt;
&lt;br /&gt;
The directory tree in the zip file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\MySwarmModel\swarm&lt;br /&gt;
                      \bin&lt;br /&gt;
                      \etc&lt;br /&gt;
                      \include&lt;br /&gt;
                      \lib&lt;br /&gt;
                      \man&lt;br /&gt;
                      \share&lt;br /&gt;
               \executable\MySwarmModel.exe&lt;br /&gt;
               \Runfiles\MySwarmModel.bat (and any input files)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the file &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt; contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set SWARMHOME=C:\MySwarmModel\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
C:\MySwarmModel\executable\MySwarmModel.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then users can run the model just by double-clicking on &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Building Swarm Using MinGW =&lt;br /&gt;
&lt;br /&gt;
This tutorial provides directions and code for compiling your own Swarm libraries for Windows. It is a bit advanced---some familiarity with compiling software from source in a Linux environment and knowledge of the UNIX command line is assumed.&lt;br /&gt;
&lt;br /&gt;
== Install Required Tools ==&lt;br /&gt;
&lt;br /&gt;
The first step is to download and install tools required for compiling Swarm. These links provide directions:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|MinGW]]&lt;br /&gt;
* [[#Emacs|Emacs]]&lt;br /&gt;
* [[#GPerf|GPerf]]&lt;br /&gt;
&lt;br /&gt;
== Build Support Libraries ==&lt;br /&gt;
&lt;br /&gt;
The next steps are to build and install the libraries that Swarm depends on. A ZIP archive containing all the source code required can be found at:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip http://download.savannah.gnu.org/releases/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip]&lt;br /&gt;
&lt;br /&gt;
This archive contains two subdirectories:&lt;br /&gt;
&lt;br /&gt;
* sources: This folder contains the source code for each component.&lt;br /&gt;
* patches: This folder contains patchfiles that modfy source code so that MinGW can compile it.&lt;br /&gt;
&lt;br /&gt;
After downloading and extracting the source code archive, open up a MinGW shell and run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
mkdir build&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following steps will all assume your MinGW shell is operating out of the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory. All compiled software will be installed to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt; (The Windows Explorer will see the folder appear at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== ZLib ===&lt;br /&gt;
&lt;br /&gt;
ZLib will be the first library to be built as it is a common dependency for many of the other software components. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following to build Zlib:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/zlib-1.2.5.tar.gz&lt;br /&gt;
cd zlib-1.2.5&lt;br /&gt;
make -f win32/Makefile.gcc&amp;lt;/pre&amp;gt;&lt;br /&gt;
And then the following commands to install ZLib to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -p /c/swarm/bin&lt;br /&gt;
mkdir -p /c/swarm/include&lt;br /&gt;
mkdir -p /c/swarm/lib&lt;br /&gt;
&lt;br /&gt;
cp zlib1.dll /c/swarm/bin/&lt;br /&gt;
cp zconf.h zlib.h /c/swarm/include/&lt;br /&gt;
mv libzdll.a libz.dll.a&lt;br /&gt;
cp *.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LibPNG ===&lt;br /&gt;
&lt;br /&gt;
LibPNG will be built next as its only dependency is ZLib. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following steps to build and install LibPNG:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/libpng-1.5.4.tar.bz2&lt;br /&gt;
cd libpng-1.5.4&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm --with-zlib-prefix=/c/swarm&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XPM ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, the XPM library can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/xpm-nox-4.2.0.tar.bz2&lt;br /&gt;
cd xpm-nox-4.2.0&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/xpm-nox-4.2.0-mingw-tcl.patch&lt;br /&gt;
&lt;br /&gt;
make CC=gcc&lt;br /&gt;
make install prefix=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
The patchfile is inherited from the SUSE builds of XPM for MinGW and adds Makefiles and other critical components.&lt;br /&gt;
&lt;br /&gt;
One major modification has been made to the SUSE patchfile---&amp;lt;tt&amp;gt;tcl.h&amp;lt;/tt&amp;gt; is included in &amp;lt;tt&amp;gt;xpm.h&amp;lt;/tt&amp;gt;. This is required in order to use XPM while Tk is installed. Conversely, this means that this build of XPM cannot be used without having Tk installed.&lt;br /&gt;
&lt;br /&gt;
=== LibFFI ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, LibFFI can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/libffi-3.0.9.tar.gz&lt;br /&gt;
cd libffi-3.0.9&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
The LibFFI headers get installed in a weird place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mv /c/swarm/lib/libffi-3.0.9/include/*.h /c/swarm/include&lt;br /&gt;
rm -rf /c/swarm/lib/libffi-3.0.9&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tcl ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tcl can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tcl8.4.19-src.tar.gz&lt;br /&gt;
cd tcl8.4.19&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/tcl-8.4.19-fix-lvalues.patch&lt;br /&gt;
cd win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
At two places in the TCL source code, an assignment is made while simultaneously performing a typecast. The typecast and the assignment had to be split into separate operations in order to be acceptable to the MinGW compilers.&lt;br /&gt;
&lt;br /&gt;
=== Tk ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tk can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tk8.4.19-src.tar.gz&lt;br /&gt;
cd tk8.4.19/win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BLT ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, BLT can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/BLT2.4z.tar.gz&lt;br /&gt;
cd blt2.4z&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm --without-x&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDF5 (Optional) ===&lt;br /&gt;
&lt;br /&gt;
Getting HDF5 to work with MinGW is a little tricky. It is an optional dependency, so if support for reading and writing &amp;lt;tt&amp;gt;.hdf&amp;lt;/tt&amp;gt; files is not needed this section can be skipped.&lt;br /&gt;
&lt;br /&gt;
As of version 1.8.7, HDF5 currently does not compile under MinGW. So, we must wrap pre-compiled binaries for use with MinGW. In order to wrap the binaries, we will need an additional tool called &amp;lt;tt&amp;gt;pexports&amp;lt;/tt&amp;gt;. This can be installed using &amp;lt;tt&amp;gt;mingw-get&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mingw-utils&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download 32-bit Windows binaries from the HDF website compiled for use with the Visual Studio compilers (these files have &amp;amp;amp;quot;VS&amp;amp;amp;quot; listed under the ''Compilers'' section). After extracting the archive, the HDF5 libraries can be wrapped for use with MinGW by executing the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd path/to/where/HDF5/was/extracted&lt;br /&gt;
&lt;br /&gt;
for dll in `ls dll/*dll`; do&lt;br /&gt;
  def_file=`basename $dll .dll`.def&lt;br /&gt;
  lib_file=lib`basename $dll dll.dll`.a&lt;br /&gt;
  pexports $dll &amp;amp;amp;gt; $def_file&lt;br /&gt;
  dlltool -d $def_file -l lib/$lib_file&lt;br /&gt;
done&amp;lt;/pre&amp;gt;&lt;br /&gt;
Next, move the libraries and header files needed to use HDF5 from C into &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp dll/hdf5dll.dll dll/szip.dll /c/swarm/bin&lt;br /&gt;
cp include/* /c/swarm/include&lt;br /&gt;
cp lib/libhdf5.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, a patch must be applied to the HDF header file &amp;lt;tt&amp;gt;H5public.h&amp;lt;/tt&amp;gt; so that it doesn't define &amp;lt;tt&amp;gt;ssize_t&amp;lt;/tt&amp;gt;---a constant already defined by MinGW. The required patch is contained in the Swarm MinGW source archive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
patch -p1 -d /c/swarm &amp;amp;amp;lt; patches/hdf5-1.8.7-mingw.patch&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Swarm ==&lt;br /&gt;
&lt;br /&gt;
Finally, the Swarm libraries themselves can be built. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/swarm-2.4.1.tar.gz&lt;br /&gt;
cd swarm-2.4.1&lt;br /&gt;
patch -p1 ../../patches/swarm-2.4.1-mingw.patch&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm \&lt;br /&gt;
  --with-zlibdir=/c/swarm \&lt;br /&gt;
  --with-pngdir=/c/swarm \&lt;br /&gt;
  --with-xpmdir=/c/swarm \&lt;br /&gt;
  --with-ffidir=/c/swarm \&lt;br /&gt;
  --with-tcl=/c/swarm/lib \&lt;br /&gt;
  --with-tk=/c/swarm/lib \&lt;br /&gt;
  --with-bltdir=/c/swarm&lt;br /&gt;
&lt;br /&gt;
cd avcall&lt;br /&gt;
gcc -S avcall-i386.c&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you wrapped HDF5 up for use with MinGW, add &amp;lt;tt&amp;gt;--with-hdf5dir=/c/swarm&amp;lt;/tt&amp;gt; to the list of arguments passed to &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-mingw.patch&amp;lt;/tt&amp;gt; modifies the Swarm source code in the following ways:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;gettimeofday&amp;lt;/tt&amp;gt; is no longer defined in the Swarm sources as MinGW includes this function in its standard library.&lt;br /&gt;
* Swarm GUI functions are updated to be compatible with LibPNG 1.5.&lt;br /&gt;
* The Swarm &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt; script defines &amp;lt;tt&amp;gt;DATADIR&amp;lt;/tt&amp;gt; as a preprocessor macro---this conflicts with variables in the GCC Objective-C library. &amp;lt;tt&amp;gt;DATDIR&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;undef&amp;lt;/tt&amp;gt;ed in critical parts of the source code.&lt;br /&gt;
* The &amp;lt;tt&amp;gt;sleep&amp;lt;/tt&amp;gt; function is aliased to &amp;lt;tt&amp;gt;usleep&amp;lt;/tt&amp;gt;---which is the name of the MinGW implementation.&lt;br /&gt;
* The way in which Makefiles invoke &amp;lt;tt&amp;gt;gperf&amp;lt;/tt&amp;gt; is amended so that it actually produces output.&lt;br /&gt;
* NULL checks are added to `zstrdup` in src/defobj/internal.m. Some functions in the Swarm library may attempt to call `zstrdup` on a NULL pointer. (This happens if the SWARMHOME environment variable is not set.) Failing to check for this condition can lead to segfaults. `zstrdup` now returns NULL if passed a NULL string or if `alloc` fails to allocate memory for a duplicate.&lt;br /&gt;
&lt;br /&gt;
Full details are contained in the patchfile.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
&lt;br /&gt;
== MinGW ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.mingw.org&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/mingw/files&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 20110530&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org MinGW] is a set of software that aims to provide an environment where software developed on UNIX-like systems can be easily compiled for Windows. Since Swarm is primarily developed on Linux (a UNIX clone), MinGW can ease the task of creating Swarm models that run on Windows.&lt;br /&gt;
&lt;br /&gt;
MinGW is similar to the [http://www.cygwin.org Cygwin] project. The major difference is that MinGW produces executables that depend only on native Windows libraries while Cygwin executables require special compatibility libraries that are part of the Cygwin distribution.&lt;br /&gt;
&lt;br /&gt;
=== Installing MinGW ===&lt;br /&gt;
&lt;br /&gt;
MinGW can be installed by downloading the &amp;amp;quot;Automated MinGW Installer&amp;amp;quot;, which usually has a name like &amp;lt;tt&amp;gt;mingw-get-inst-&amp;amp;amp;lt;date&amp;amp;amp;gt;.exe&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;&amp;amp;amp;lt;date&amp;amp;amp;gt;&amp;lt;/tt&amp;gt; is the datestamp for when the installer was packaged. Running this executable will start the installation process. The installer lets you select which optional components to install; make sure all boxes are checked so you '''install all components'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Setup.png|frame|none|alt=Install all available MinGW components]]&lt;br /&gt;
&lt;br /&gt;
The installer downloads all components from the internet. This will take a while, so have a cup of coffee or walk the dog.&lt;br /&gt;
&lt;br /&gt;
See the following section about also installing an optional, more-functional shell window for MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Using MinGW ===&lt;br /&gt;
&lt;br /&gt;
The MinGW compilers are accessible through the &amp;amp;amp;quot;MinGW Shell&amp;amp;amp;quot; which should be located under the MinGW folder in the Start Menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Shell.png|frame|none|alt=Location of MinGW Shell]]&lt;br /&gt;
&lt;br /&gt;
or by running &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; (if MinGW was installed to its default location).&lt;br /&gt;
&lt;br /&gt;
By default the MinGW shell executes inside of a Windows &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt; terminal. There are a couple major drawbacks to this:&lt;br /&gt;
&lt;br /&gt;
* You cannot resize the window to full-screen.&lt;br /&gt;
* The shell provides limited history scrollback.&lt;br /&gt;
&lt;br /&gt;
MinGW provides a couple of alternative terminals for the MinGW shell which do not have these drawbacks; one of which is called MinTTY. To install MinTTY execute the following in a MinGW shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mintty&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then the &amp;lt;tt&amp;gt;mintty&amp;lt;/tt&amp;gt; command can be used to launch a MinTTY terminal. The MinGW Shell can also be set to launch MinTTY by default by editing the file &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; and changing the following line (approximately line 58):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=sh.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=mintty.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A Note About Paths ===&lt;br /&gt;
&lt;br /&gt;
The MinGW Shell emulates a UNIX &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell and thus uses UNIX-style paths, &amp;lt;tt&amp;gt;/path/to/file&amp;lt;/tt&amp;gt;, instead of Windows-style paths, &amp;lt;tt&amp;gt;C:\path\to\file&amp;lt;/tt&amp;gt;. One peculiarity of this process is that the shell must deal with the fact that Windows filesystems have multiple roots (&amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt;, etc.) while a UNIX filesystem only has one root called &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;. The way this is reconciled by the &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell provided with MinGW is that &amp;lt;tt&amp;gt;/c&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt; drive, &amp;lt;tt&amp;gt;/d&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt; drive and so on and so forth.&lt;br /&gt;
&lt;br /&gt;
The root of the filesystem itself, &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;, also has some caveats. &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt; refers to the &amp;lt;tt&amp;gt;mysy&amp;lt;/tt&amp;gt; folder, &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0&amp;lt;/tt&amp;gt; in a default installation. &amp;lt;tt&amp;gt;/usr&amp;lt;/tt&amp;gt; also refers to the same location. Thus, &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/local&amp;lt;/tt&amp;gt; both refer to &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0/local&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== A Note About MinGW-64 ===&lt;br /&gt;
&lt;br /&gt;
Currently Swarm has been developed and tested against the 32-bit version of MinGW. Hence Swarm models produced this way should run in any version of Windows.&lt;br /&gt;
&lt;br /&gt;
The [MinGW-w64][mingw_65] project produces 64-bit MinGW compilers that can produce 64-bit executables that will only run on 64-bit versions of Windows. These executables benefit from:&lt;br /&gt;
&lt;br /&gt;
* Access to more memory. A 32-bit executable will only be able to allocate ~3 GB of RAM---even if the system has more RAM available.&lt;br /&gt;
* Possibly quicker execution speeds due to matching the native architecture of the operating system---however this depends on the types of tasks that the program executes. It has been reported that 64 bit Swarm executables run quicker than 32 bit Swarm executables on Linux.&lt;br /&gt;
&lt;br /&gt;
Currently, no attempt has been made to compile Swarm 2.4.1 with the 64 bit MinGW compilers. If a successful attempt is made, please report it on the [http://www.swarm.org/mailman/listinfo/support Swarm mailing list].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Emacs ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/emacs&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 23.3&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://ftp.gnu.org/gnu/emacs/windows&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GNU Emacs is a text editor that is used by many programmers to edit code. However, Emacs can also be scripted to perform a variety of complicated transformations on text files. The scripts that build the Swarm libraries use Emacs to automate the process of generating some source files. Thus Emacs has to be installed in order to build Swarm from source.&lt;br /&gt;
&lt;br /&gt;
=== Installing Emacs ===&lt;br /&gt;
&lt;br /&gt;
Install Emacs by downloading one of the &amp;lt;tt&amp;gt;emacs-&amp;amp;amp;lt;version&lt;br /&gt;
number&amp;amp;amp;gt;-bin-i386.zip&amp;lt;/tt&amp;gt; files from the download area. Don't use any of the&lt;br /&gt;
files containing &amp;lt;tt&amp;gt;barebin&amp;lt;/tt&amp;gt;. After extracting the ZIP archive there will&lt;br /&gt;
be an Emacs folder containing a subfolder called &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt;. Add this folder&lt;br /&gt;
to your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. [[#RapidEE|RapidEE]] can help edit the&lt;br /&gt;
&amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GPerf ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/gperf/&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/gnuwin32/files/gperf&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 3.0.1&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GPerf is a program that produces C code containing hash functions. The scripts&lt;br /&gt;
that build the Swarm libraries use GPerf to generate some source code files.&lt;br /&gt;
Download &amp;lt;tt&amp;gt;gperf.exe&amp;lt;/tt&amp;gt; from the GnuWin32 site on Sourceforge and place it&lt;br /&gt;
somewhere on your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. Again, [[#RapidEE|RapidEE]] can help set the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RapidEE ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.rapidee.com&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 5.0&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.rapidee.com/en/license Freeware]&lt;br /&gt;
&lt;br /&gt;
The Rapid Environment Editor (RapidEE) is a spiffy tool that makes it easy to inspect and alter the value of Windows environment variables, such as the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. RapidEE may be used to edit &amp;amp;amp;quot;System Variables&amp;amp;amp;quot; which will affect all user accounts or &amp;amp;amp;quot;User Variables&amp;amp;amp;quot; which will affect just the current account. Administrative privileges may be required to edit the System Variables.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_1.png|frame|none|alt=The different variables RapidEE can edit]]&lt;br /&gt;
&lt;br /&gt;
Right-clicking on the &amp;lt;tt&amp;gt;Path&amp;lt;/tt&amp;gt; variable in the System Variables or User Variables will bring up a menu that presents the option to &amp;amp;amp;quot;Add value&amp;amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_2.png|frame|none|alt=Adding a new value to the PATH]]&lt;br /&gt;
&lt;br /&gt;
Once the new entry has been added, RapidEE must be told to save the changes. Command line shells, such as &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;, must be restarted in order for them to notice the changes.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_3.png|frame|none|alt=Adding and saving a value]]&lt;br /&gt;
&lt;br /&gt;
== Depends ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.dependencywalker.com/&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 2.2&lt;br /&gt;
&lt;br /&gt;
'''License:''' Freeware&lt;br /&gt;
&lt;br /&gt;
Depends is a usefull utility that scans Windows executables and reports information concerning the Dynamic-link Libraries (DLLs) that those executables require in order to run.&lt;br /&gt;
&lt;br /&gt;
= Software Used to Compile Swarm 2.4.1 =&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!  Name&lt;br /&gt;
!  Verson Used&lt;br /&gt;
!  License&lt;br /&gt;
!  Homepage&lt;br /&gt;
!  Download Area&lt;br /&gt;
|-&lt;br /&gt;
|  ZLib&lt;br /&gt;
|  1.2.5&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG License]&lt;br /&gt;
|  [http://www.zlib.net http://www.zlib.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibFFI&lt;br /&gt;
|  3.0.9&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  [http://sourceware.org/libffi http://sourceware.org/libffi]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibPNG&lt;br /&gt;
|  1.5.4&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG]&lt;br /&gt;
|  [http://www.libpng.org/pub/png/libpng.html http://www.libpng.org/pub/png/libpng.html]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  XPM-NoX&lt;br /&gt;
|  4.2.0&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  unknown&lt;br /&gt;
|  [http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32 http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32]&lt;br /&gt;
|-&lt;br /&gt;
|  Tcl&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Tk&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  BLT&lt;br /&gt;
|  2.4z&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://blt.sourceforge.net http://blt.sourceforge.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  HDF5&lt;br /&gt;
|  1.8.7&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://www.hdfgroup.org/HDF5 http://www.hdfgroup.org/HDF5]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Swarm&lt;br /&gt;
|  2.4.1&lt;br /&gt;
|  [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
|  [http://www.swarm.org http://www.swarm.org]&lt;br /&gt;
|  [http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2163</id>
		<title>Swarm and MinGW</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2163"/>
				<updated>2015-12-03T01:40:36Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Build Support Libraries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This documentation provides information on how to use Swarm on Windows with [http://www.mingw.org MinGW] compilers. The following topics will be covered:&lt;br /&gt;
&lt;br /&gt;
* How to run a Swam model compiled with MinGW on Windows: Once you produce a Swarm model using MinGW (or someone gives one to you), how do you run it on other machines without installing Swarm there?&lt;br /&gt;
* How to use MinGW to compile your own Swarm models, either during model development or so you can distribute working models to others. This requires installing MinGW and our binary Swarm libraries.&lt;br /&gt;
* How to package a model compiled with MinGW so it can be installed and run by itself on Windows machines.&lt;br /&gt;
* How to use MinGW to compile the Swarm libraries, in case you want to build your own Swarm binaries.&lt;br /&gt;
&lt;br /&gt;
Each topic is more difficult than the one before it. However the topics are independent in that it is not necessary to know how to compile the Swarm library in order to run a pre-compiled Swarm model or compile your own model against a pre-compiled version of Swarm.&lt;br /&gt;
&lt;br /&gt;
= Using Swarm Models Compiled with MinGW =&lt;br /&gt;
&lt;br /&gt;
A model that has been compiled using MinGW can be installed and run from a Windows computer without installing MinGW or Swarm. An example code is this build of Heatbugs:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe]&lt;br /&gt;
&lt;br /&gt;
However, running a Swarm model requires some support programs and libraries. These are available as&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-win32.zip&amp;lt;/tt&amp;gt;, available here:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip]&lt;br /&gt;
&lt;br /&gt;
Unzipping that file will create a folder called &amp;lt;tt&amp;gt;swarm&amp;lt;/tt&amp;gt; which should be moved somewhere that is easy to remember. The rest of this tutorial will assume this Swarm folder has been placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before a Swarm model can be run, the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder must be added to the Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; so that Heatbugs can find necessary libraries when it runs. The &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder can be ''temporarily'' added to the path by executing the following in the Windows command line (the command line is accessed using the program &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;path=%PATH%;C:\swarm\bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, it is possible to have conflicts if other versions of libraries used by Swarm, such as HDF5, are already installed and in your path. And some Swarm programs require that the environment variable SWARMHOME be defined, which will typically not be true. These problems can be avoided by using the following statements instead of the above path command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
You can alternatively add the Swarm folder to your &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; permanently by editing the Windows PATH environment variable. A tool like [[#RapidEE|RapidEE]] makes doing so easy, or you can use use Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; to the PATH system variable.&lt;br /&gt;
&lt;br /&gt;
Once the path has been set to include the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder, Swarm models can be started through the Windows command line, or by double-clicking on them from the Windows Explorer.  &lt;br /&gt;
&lt;br /&gt;
The Heatbugs model can now be run by changing the directory of the command line to the folder holding &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; and then executing the program. For example, if &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is located in &amp;lt;tt&amp;gt;C:\Users\example_user\Downloads&amp;lt;/tt&amp;gt;, then the model may be run as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd C:\Users\example_user\Downloads&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(or you can just double-click on &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; from Windows Explorer, which temporarily opens a Windows command terminal while the model runs.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Running_Heatbugs.png|frame|none|alt=Running the Heatbugs model]]&lt;br /&gt;
&lt;br /&gt;
You can also create a simple Windows batch file that sets SWARMHOME and the path and then executes the model. Create a file called, for example &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; in the same directory where &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is, containing these lines: &lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, just double-clicking on &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; will start the model.&lt;br /&gt;
&lt;br /&gt;
If you try this and get an error that some .dll file is not found, then the problem is likely that the path is not set correctly to include the swarm\bin folder. If instead the program crashes without an error statement, then the problem is more likely that SWARMHOME needs to be set.&lt;br /&gt;
&lt;br /&gt;
= Installing Swarm and MinGW to compile models =&lt;br /&gt;
&lt;br /&gt;
To compile Swarm models from source using MinGW, the following simple steps need to be taken to set up the build environment:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|Install MinGW using instructions here]]. Currently only 32-bit MinGW can be used with Swarm. Install all components of MinGW.&lt;br /&gt;
* Download compiled Swarm binaries, archived as [http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip swarm-2.4.1-win32.zip]. Unzip the archive and place the extracted folder at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
The archived Swarm binaries '''MUST''' be placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt; to successfully compile Swarm models. This is because some paths had to be hard-coded by &amp;lt;tt&amp;gt;libtool&amp;lt;/tt&amp;gt; during the creation of the binaries.&lt;br /&gt;
&lt;br /&gt;
The final step before you can compile a Swarm model is to set the &amp;lt;tt&amp;gt;SWARMHOME&amp;lt;/tt&amp;gt; environment variable so that the &amp;amp;quot;make&amp;amp;quot; program knows where to find the Swarm libraries when compiling your code. There are several ways to do this.&lt;br /&gt;
*You can temporarily set SWARMHOME by entering this command in the MinGW shell: &amp;lt;pre&amp;gt;export SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*You can edit your Makefile so it starts with: &amp;lt;pre&amp;gt;SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Set SWARMHOME permanently as a Windows environment variable, either by using [[#RapidEE|RapidEE]] or Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add a new (User or System) variable called SWARMHOME with the value &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After MinGW has been installed and the Swarm binaries have been downloaded, Swarm models may be compiled using the MinGW shell. Start up the program MinGW Shell, cd to the directory containing your code and Makefile, and enter the command &amp;amp;quot;Make&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
An archive of official Swarm example programs can be downloaded from:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
&lt;br /&gt;
We will use the &amp;amp;quot;Heatbugs&amp;amp;quot; model as an example of how to compile a Swarm application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf /path/to/downloaded/swarmapps-2.3.0.tar.gz&lt;br /&gt;
cd swarmapps-2.3.0/objc/heatbugs&lt;br /&gt;
&lt;br /&gt;
make&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''VERY IMPORTANT NOTE: MinGW produces two executables called &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt;---one in the &amp;lt;tt&amp;gt;heatbugs&amp;lt;/tt&amp;gt; folder and another in the &amp;lt;tt&amp;gt;heatbugs/.libs&amp;lt;/tt&amp;gt; folder. You should ignore the executable in the top-level folder, &amp;lt;tt&amp;gt;heatbugs/heatbugs.exe&amp;lt;/tt&amp;gt;, as it is merely a compiled wrapper script that executes &amp;lt;tt&amp;gt;heatbugs/.libs/heatbugs.exe&amp;lt;/tt&amp;gt;. When distributing compiled models, only use binaries from the &amp;lt;tt&amp;gt;.libs&amp;lt;/tt&amp;gt; folder.'''&lt;br /&gt;
&lt;br /&gt;
The resulting executable, &amp;lt;tt&amp;gt;.libs/heatbugs.exe&amp;lt;/tt&amp;gt; may be executing by following the steps described above at ''Using Swarm Models Compiled with MinGW''. These steps must include setting the Windows Path to include &amp;lt;tt&amp;gt;C:\swarm\bin&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Distributing a Swarm Model for Windows Users =&lt;br /&gt;
&lt;br /&gt;
A major benefit of the MinGW version of Swarm is that models can be distributed for people to use without installing Swarm. A simple way to do this, after the model has been compiled and tested using methods in the previous section, is to create a ZIP archive that contains all the files to run the model.&lt;br /&gt;
&lt;br /&gt;
* Create a directory tree that includes the Swarm binary files. For example, create C:\MySwarmModel and add the Swarm binaries (as described [[Swarm_and_MinGW#Using_Swarm_Models_Compiled_with_MinGW|above]]) to it as a subdirectory tree.&lt;br /&gt;
* Create another subdirectory that includes just the compiled model.&lt;br /&gt;
* Create a third subdirectory that includes any input files that the model needs and a batch file that sets the path and executes the model. &lt;br /&gt;
* Zip the whole tree up for distribution.&lt;br /&gt;
&lt;br /&gt;
The directory tree in the zip file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\MySwarmModel\swarm&lt;br /&gt;
                      \bin&lt;br /&gt;
                      \etc&lt;br /&gt;
                      \include&lt;br /&gt;
                      \lib&lt;br /&gt;
                      \man&lt;br /&gt;
                      \share&lt;br /&gt;
               \executable\MySwarmModel.exe&lt;br /&gt;
               \Runfiles\MySwarmModel.bat (and any input files)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the file &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt; contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set SWARMHOME=C:\MySwarmModel\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
C:\MySwarmModel\executable\MySwarmModel.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then users can run the model just by double-clicking on &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Building Swarm Using MinGW =&lt;br /&gt;
&lt;br /&gt;
This tutorial provides directions and code for compiling your own Swarm libraries for Windows. It is a bit advanced---some familiarity with compiling software from source in a Linux environment and knowledge of the UNIX command line is assumed.&lt;br /&gt;
&lt;br /&gt;
== Install Required Tools ==&lt;br /&gt;
&lt;br /&gt;
The first step is to download and install tools required for compiling Swarm. These links provide directions:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|MinGW]]&lt;br /&gt;
* [[#Emacs|Emacs]]&lt;br /&gt;
* [[#GPerf|GPerf]]&lt;br /&gt;
&lt;br /&gt;
== Build Support Libraries ==&lt;br /&gt;
&lt;br /&gt;
The next steps are to build and install the libraries that Swarm depends on. A ZIP archive containing all the source code required can be found at:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip http://download.savannah.gnu.org/releases/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip]&lt;br /&gt;
&lt;br /&gt;
This archive contains two subdirectories:&lt;br /&gt;
&lt;br /&gt;
* sources: This folder contains the source code for each component.&lt;br /&gt;
* patches: This folder contains patchfiles that modfy source code so that MinGW can compile it.&lt;br /&gt;
&lt;br /&gt;
After downloading and extracting the source code archive, open up a MinGW shell and run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
mkdir build&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following steps will all assume your MinGW shell is operating out of the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory. All compiled software will be installed to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt; (The Windows Explorer will see the folder appear at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== ZLib ===&lt;br /&gt;
&lt;br /&gt;
ZLib will be the first library to be built as it is a common dependency for many of the other software components. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following to build Zlib:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/zlib-1.2.5.tar.gz&lt;br /&gt;
cd zlib-1.2.5&lt;br /&gt;
make -f win32/Makefile.gcc&amp;lt;/pre&amp;gt;&lt;br /&gt;
And then the following commands to install ZLib to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -p /c/swarm/bin&lt;br /&gt;
mkdir -p /c/swarm/include&lt;br /&gt;
mkdir -p /c/swarm/lib&lt;br /&gt;
&lt;br /&gt;
cp zlib1.dll /c/swarm/bin/&lt;br /&gt;
cp zconf.h zlib.h /c/swarm/include/&lt;br /&gt;
mv libzdll.a libz.dll.a&lt;br /&gt;
cp *.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LibPNG ===&lt;br /&gt;
&lt;br /&gt;
LibPNG will be built next as its only dependency is ZLib. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following steps to build and install LibPNG:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/libpng-1.5.4.tar.bz2&lt;br /&gt;
cd libpng-1.5.4&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm --with-zlib-prefix=/c/swarm&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XPM ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, the XPM library can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/xpm-nox-4.2.0.tar.bz2&lt;br /&gt;
cd xpm-nox-4.2.0&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/xpm-nox-4.2.0-mingw-tcl.patch&lt;br /&gt;
&lt;br /&gt;
make CC=gcc&lt;br /&gt;
make install prefix=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
The patchfile is inherited from the SUSE builds of XPM for MinGW and adds Makefiles and other critical components.&lt;br /&gt;
&lt;br /&gt;
One major modification has been made to the SUSE patchfile---&amp;lt;tt&amp;gt;tcl.h&amp;lt;/tt&amp;gt; is included in &amp;lt;tt&amp;gt;xpm.h&amp;lt;/tt&amp;gt;. This is required in order to use XPM while Tk is installed. Conversely, this means that this build of XPM cannot be used without having Tk installed.&lt;br /&gt;
&lt;br /&gt;
=== LibFFI ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, LibFFI can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/libffi-3.0.9.tar.gz&lt;br /&gt;
cd libffi-3.0.9&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
The LibFFI headers get installed in a weird place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mv /c/swarm/lib/libffi-3.0.9/include/*.h /c/swarm/include&lt;br /&gt;
rm -rf /c/swarm/lib/libffi-3.0.9&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tcl ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tcl can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tcl8.4.19-src.tar.gz&lt;br /&gt;
cd tcl8.4.19&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/tcl-8.4.19-fix-lvalues.patch&lt;br /&gt;
cd win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
At two places in the TCL source code, an assignment is made while simultaneously performing a typecast. The typecast and the assignment had to be split into separate operations in order to be acceptable to the MinGW compilers.&lt;br /&gt;
&lt;br /&gt;
=== Tk ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tk can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tk8.4.19-src.tar.gz&lt;br /&gt;
cd tk8.4.19/win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BLT ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, BLT can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/BLT2.4z.tar.gz&lt;br /&gt;
cd blt2.4z&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm --without-x&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDF5 (Optional) ===&lt;br /&gt;
&lt;br /&gt;
Getting HDF5 to work with MinGW is a little tricky. It is an optional dependency, so if support for reading and writing &amp;lt;tt&amp;gt;.hdf&amp;lt;/tt&amp;gt; files is not needed this section can be skipped.&lt;br /&gt;
&lt;br /&gt;
As of version 1.8.7, HDF5 currently does not compile under MinGW. So, we must wrap pre-compiled binaries for use with MinGW. In order to wrap the binaries, we will need an additional tool called &amp;lt;tt&amp;gt;pexports&amp;lt;/tt&amp;gt;. This can be installed using &amp;lt;tt&amp;gt;mingw-get&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mingw-utils&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download 32-bit Windows binaries from the HDF website compiled for use with the Visual Studio compilers (these files have &amp;amp;amp;quot;VS&amp;amp;amp;quot; listed under the ''Compilers'' section). After extracting the archive, the HDF5 libraries can be wrapped for use with MinGW by executing the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd path/to/where/HDF5/was/extracted&lt;br /&gt;
&lt;br /&gt;
for dll in `ls dll/*dll`; do&lt;br /&gt;
  def_file=`basename $dll .dll`.def&lt;br /&gt;
  lib_file=lib`basename $dll dll.dll`.a&lt;br /&gt;
  pexports $dll &amp;amp;amp;gt; $def_file&lt;br /&gt;
  dlltool -d $def_file -l lib/$lib_file&lt;br /&gt;
done&amp;lt;/pre&amp;gt;&lt;br /&gt;
Next, move the libraries and header files needed to use HDF5 from C into &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp dll/hdf5dll.dll dll/szip.dll /c/swarm/bin&lt;br /&gt;
cp include/* /c/swarm/include&lt;br /&gt;
cp lib/libhdf5.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, a patch must be applied to the HDF header file &amp;lt;tt&amp;gt;H5public.h&amp;lt;/tt&amp;gt; so that it doesn't define &amp;lt;tt&amp;gt;ssize_t&amp;lt;/tt&amp;gt;---a constant already defined by MinGW. The required patch is contained in the Swarm MinGW source archive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
patch -p1 -d /c/swarm &amp;amp;amp;lt; patches/hdf5-1.8.7-mingw.patch&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Swarm ==&lt;br /&gt;
&lt;br /&gt;
Finally, the Swarm libraries themselves can be built. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/swarm-2.4.1.tar.gz&lt;br /&gt;
cd swarm-2.4.1&lt;br /&gt;
patch -p1 ../../patches/swarm-2.4.1-mingw.patch&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm \&lt;br /&gt;
  --with-zlibdir=/c/swarm \&lt;br /&gt;
  --with-pngdir=/c/swarm \&lt;br /&gt;
  --with-xpmdir=/c/swarm \&lt;br /&gt;
  --with-ffidir=/c/swarm \&lt;br /&gt;
  --with-tcl=/c/swarm/lib \&lt;br /&gt;
  --with-tk=/c/swarm/lib \&lt;br /&gt;
  --with-bltdir=/c/swarm&lt;br /&gt;
&lt;br /&gt;
cd avcall&lt;br /&gt;
gcc -S avcall-i386.c&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you wrapped HDF5 up for use with MinGW, add &amp;lt;tt&amp;gt;--with-hdf5dir=/c/swarm&amp;lt;/tt&amp;gt; to the list of arguments passed to &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-mingw.patch&amp;lt;/tt&amp;gt; modifies the Swarm source code in the following ways:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;gettimeofday&amp;lt;/tt&amp;gt; is no longer defined in the Swarm sources as MinGW includes this function in its standard library.&lt;br /&gt;
* Swarm GUI functions are updated to be compatible with LibPNG 1.5.&lt;br /&gt;
* The Swarm &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt; script defines &amp;lt;tt&amp;gt;DATADIR&amp;lt;/tt&amp;gt; as a preprocessor macro---this conflicts with variables in the GCC Objective-C library. &amp;lt;tt&amp;gt;DATDIR&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;undef&amp;lt;/tt&amp;gt;ed in critical parts of the source code.&lt;br /&gt;
* The &amp;lt;tt&amp;gt;sleep&amp;lt;/tt&amp;gt; function is aliased to &amp;lt;tt&amp;gt;usleep&amp;lt;/tt&amp;gt;---which is the name of the MinGW implementation.&lt;br /&gt;
* The way in which Makefiles invoke &amp;lt;tt&amp;gt;gperf&amp;lt;/tt&amp;gt; is amended so that it actually produces output.&lt;br /&gt;
* NULL checks are added to `zstrdup` in src/defobj/internal.m. Some functions in the Swarm library may attempt to call `zstrdup` on a NULL pointer. (This happens if the SWARMHOME environment variable is not set.) Failing to check for this condition can lead to segfaults. `zstrdup` now returns NULL if passed a NULL string or if `alloc` fails to allocate memory for a duplicate.&lt;br /&gt;
&lt;br /&gt;
Full details are contained in the patchfile.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
&lt;br /&gt;
== MinGW ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.mingw.org&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/mingw/files&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 20110530&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org MinGW] is a set of software that aims to provide an environment where software developed on UNIX-like systems can be easily compiled for Windows. Since Swarm is primarily developed on Linux (a UNIX clone), MinGW can ease the task of creating Swarm models that run on Windows.&lt;br /&gt;
&lt;br /&gt;
MinGW is similar to the [http://www.cygwin.org Cygwin] project. The major difference is that MinGW produces executables that depend only on native Windows libraries while Cygwin executables require special compatibility libraries that are part of the Cygwin distribution.&lt;br /&gt;
&lt;br /&gt;
=== Installing MinGW ===&lt;br /&gt;
&lt;br /&gt;
MinGW can be installed by downloading the &amp;amp;amp;quot;Automated MinGW Installer&amp;amp;amp;quot;, which usually has a name like &amp;lt;tt&amp;gt;mingw-get-inst-&amp;amp;amp;lt;date&amp;amp;amp;gt;.exe&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;&amp;amp;amp;lt;date&amp;amp;amp;gt;&amp;lt;/tt&amp;gt; is the datestamp for when the installer was packaged. Running this executable will start the installation process. The installer lets you select which optional components to install; make sure all boxes are checked so you '''install all components'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Setup.png|frame|none|alt=Install all available MinGW components]]&lt;br /&gt;
&lt;br /&gt;
The installer downloads all components from the internet. This will take a while, so have a cup of coffee or walk the dog.&lt;br /&gt;
&lt;br /&gt;
See the following section about also installing an optional, more-functional shell window for MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Using MinGW ===&lt;br /&gt;
&lt;br /&gt;
The MinGW compilers are accessible through the &amp;amp;amp;quot;MinGW Shell&amp;amp;amp;quot; which should be located under the MinGW folder in the Start Menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Shell.png|frame|none|alt=Location of MinGW Shell]]&lt;br /&gt;
&lt;br /&gt;
or by running &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; (if MinGW was installed to its default location).&lt;br /&gt;
&lt;br /&gt;
By default the MinGW shell executes inside of a Windows &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt; terminal. There are a couple major drawbacks to this:&lt;br /&gt;
&lt;br /&gt;
* You cannot resize the window to full-screen.&lt;br /&gt;
* The shell provides limited history scrollback.&lt;br /&gt;
&lt;br /&gt;
MinGW provides a couple of alternative terminals for the MinGW shell which do not have these drawbacks; one of which is called MinTTY. To install MinTTY execute the following in a MinGW shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mintty&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then the &amp;lt;tt&amp;gt;mintty&amp;lt;/tt&amp;gt; command can be used to launch a MinTTY terminal. The MinGW Shell can also be set to launch MinTTY by default by editing the file &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; and changing the following line (approximately line 58):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=sh.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=mintty.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A Note About Paths ===&lt;br /&gt;
&lt;br /&gt;
The MinGW Shell emulates a UNIX &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell and thus uses UNIX-style paths, &amp;lt;tt&amp;gt;/path/to/file&amp;lt;/tt&amp;gt;, instead of Windows-style paths, &amp;lt;tt&amp;gt;C:\path\to\file&amp;lt;/tt&amp;gt;. One peculiarity of this process is that the shell must deal with the fact that Windows filesystems have multiple roots (&amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt;, etc.) while a UNIX filesystem only has one root called &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;. The way this is reconciled by the &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell provided with MinGW is that &amp;lt;tt&amp;gt;/c&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt; drive, &amp;lt;tt&amp;gt;/d&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt; drive and so on and so forth.&lt;br /&gt;
&lt;br /&gt;
The root of the filesystem itself, &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;, also has some caveats. &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt; refers to the &amp;lt;tt&amp;gt;mysy&amp;lt;/tt&amp;gt; folder, &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0&amp;lt;/tt&amp;gt; in a default installation. &amp;lt;tt&amp;gt;/usr&amp;lt;/tt&amp;gt; also refers to the same location. Thus, &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/local&amp;lt;/tt&amp;gt; both refer to &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0/local&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== A Note About MinGW-64 ===&lt;br /&gt;
&lt;br /&gt;
Currently Swarm has been developed and tested against the 32-bit version of MinGW. Hence Swarm models produced this way should run in any version of Windows.&lt;br /&gt;
&lt;br /&gt;
The [MinGW-w64][mingw_65] project produces 64-bit MinGW compilers that can produce 64-bit executables that will only run on 64-bit versions of Windows. These executables benefit from:&lt;br /&gt;
&lt;br /&gt;
* Access to more memory. A 32-bit executable will only be able to allocate ~3 GB of RAM---even if the system has more RAM available.&lt;br /&gt;
* Possibly quicker execution speeds due to matching the native architecture of the operating system---however this depends on the types of tasks that the program executes. It has been reported that 64 bit Swarm executables run quicker than 32 bit Swarm executables on Linux.&lt;br /&gt;
&lt;br /&gt;
Currently, no attempt has been made to compile Swarm 2.4.1 with the 64 bit MinGW compilers. If a successful attempt is made, please report it on the [http://www.swarm.org/mailman/listinfo/support Swarm mailing list].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Emacs ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/emacs&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 23.3&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://ftp.gnu.org/gnu/emacs/windows&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GNU Emacs is a text editor that is used by many programmers to edit code. However, Emacs can also be scripted to perform a variety of complicated transformations on text files. The scripts that build the Swarm libraries use Emacs to automate the process of generating some source files. Thus Emacs has to be installed in order to build Swarm from source.&lt;br /&gt;
&lt;br /&gt;
=== Installing Emacs ===&lt;br /&gt;
&lt;br /&gt;
Install Emacs by downloading one of the &amp;lt;tt&amp;gt;emacs-&amp;amp;amp;lt;version&lt;br /&gt;
number&amp;amp;amp;gt;-bin-i386.zip&amp;lt;/tt&amp;gt; files from the download area. Don't use any of the&lt;br /&gt;
files containing &amp;lt;tt&amp;gt;barebin&amp;lt;/tt&amp;gt;. After extracting the ZIP archive there will&lt;br /&gt;
be an Emacs folder containing a subfolder called &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt;. Add this folder&lt;br /&gt;
to your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. [[#RapidEE|RapidEE]] can help edit the&lt;br /&gt;
&amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GPerf ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/gperf/&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/gnuwin32/files/gperf&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 3.0.1&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GPerf is a program that produces C code containing hash functions. The scripts&lt;br /&gt;
that build the Swarm libraries use GPerf to generate some source code files.&lt;br /&gt;
Download &amp;lt;tt&amp;gt;gperf.exe&amp;lt;/tt&amp;gt; from the GnuWin32 site on Sourceforge and place it&lt;br /&gt;
somewhere on your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. Again, [[#RapidEE|RapidEE]] can help set the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RapidEE ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.rapidee.com&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 5.0&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.rapidee.com/en/license Freeware]&lt;br /&gt;
&lt;br /&gt;
The Rapid Environment Editor (RapidEE) is a spiffy tool that makes it easy to inspect and alter the value of Windows environment variables, such as the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. RapidEE may be used to edit &amp;amp;amp;quot;System Variables&amp;amp;amp;quot; which will affect all user accounts or &amp;amp;amp;quot;User Variables&amp;amp;amp;quot; which will affect just the current account. Administrative privileges may be required to edit the System Variables.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_1.png|frame|none|alt=The different variables RapidEE can edit]]&lt;br /&gt;
&lt;br /&gt;
Right-clicking on the &amp;lt;tt&amp;gt;Path&amp;lt;/tt&amp;gt; variable in the System Variables or User Variables will bring up a menu that presents the option to &amp;amp;amp;quot;Add value&amp;amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_2.png|frame|none|alt=Adding a new value to the PATH]]&lt;br /&gt;
&lt;br /&gt;
Once the new entry has been added, RapidEE must be told to save the changes. Command line shells, such as &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;, must be restarted in order for them to notice the changes.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_3.png|frame|none|alt=Adding and saving a value]]&lt;br /&gt;
&lt;br /&gt;
== Depends ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.dependencywalker.com/&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 2.2&lt;br /&gt;
&lt;br /&gt;
'''License:''' Freeware&lt;br /&gt;
&lt;br /&gt;
Depends is a usefull utility that scans Windows executables and reports information concerning the Dynamic-link Libraries (DLLs) that those executables require in order to run.&lt;br /&gt;
&lt;br /&gt;
= Software Used to Compile Swarm 2.4.1 =&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!  Name&lt;br /&gt;
!  Verson Used&lt;br /&gt;
!  License&lt;br /&gt;
!  Homepage&lt;br /&gt;
!  Download Area&lt;br /&gt;
|-&lt;br /&gt;
|  ZLib&lt;br /&gt;
|  1.2.5&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG License]&lt;br /&gt;
|  [http://www.zlib.net http://www.zlib.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibFFI&lt;br /&gt;
|  3.0.9&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  [http://sourceware.org/libffi http://sourceware.org/libffi]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibPNG&lt;br /&gt;
|  1.5.4&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG]&lt;br /&gt;
|  [http://www.libpng.org/pub/png/libpng.html http://www.libpng.org/pub/png/libpng.html]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  XPM-NoX&lt;br /&gt;
|  4.2.0&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  unknown&lt;br /&gt;
|  [http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32 http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32]&lt;br /&gt;
|-&lt;br /&gt;
|  Tcl&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Tk&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  BLT&lt;br /&gt;
|  2.4z&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://blt.sourceforge.net http://blt.sourceforge.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  HDF5&lt;br /&gt;
|  1.8.7&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://www.hdfgroup.org/HDF5 http://www.hdfgroup.org/HDF5]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Swarm&lt;br /&gt;
|  2.4.1&lt;br /&gt;
|  [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
|  [http://www.swarm.org http://www.swarm.org]&lt;br /&gt;
|  [http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2162</id>
		<title>Swarm and MinGW</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2162"/>
				<updated>2015-12-03T01:38:02Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Installing Swarm and MinGW to compile models */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This documentation provides information on how to use Swarm on Windows with [http://www.mingw.org MinGW] compilers. The following topics will be covered:&lt;br /&gt;
&lt;br /&gt;
* How to run a Swam model compiled with MinGW on Windows: Once you produce a Swarm model using MinGW (or someone gives one to you), how do you run it on other machines without installing Swarm there?&lt;br /&gt;
* How to use MinGW to compile your own Swarm models, either during model development or so you can distribute working models to others. This requires installing MinGW and our binary Swarm libraries.&lt;br /&gt;
* How to package a model compiled with MinGW so it can be installed and run by itself on Windows machines.&lt;br /&gt;
* How to use MinGW to compile the Swarm libraries, in case you want to build your own Swarm binaries.&lt;br /&gt;
&lt;br /&gt;
Each topic is more difficult than the one before it. However the topics are independent in that it is not necessary to know how to compile the Swarm library in order to run a pre-compiled Swarm model or compile your own model against a pre-compiled version of Swarm.&lt;br /&gt;
&lt;br /&gt;
= Using Swarm Models Compiled with MinGW =&lt;br /&gt;
&lt;br /&gt;
A model that has been compiled using MinGW can be installed and run from a Windows computer without installing MinGW or Swarm. An example code is this build of Heatbugs:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe]&lt;br /&gt;
&lt;br /&gt;
However, running a Swarm model requires some support programs and libraries. These are available as&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-win32.zip&amp;lt;/tt&amp;gt;, available here:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip]&lt;br /&gt;
&lt;br /&gt;
Unzipping that file will create a folder called &amp;lt;tt&amp;gt;swarm&amp;lt;/tt&amp;gt; which should be moved somewhere that is easy to remember. The rest of this tutorial will assume this Swarm folder has been placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before a Swarm model can be run, the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder must be added to the Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; so that Heatbugs can find necessary libraries when it runs. The &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder can be ''temporarily'' added to the path by executing the following in the Windows command line (the command line is accessed using the program &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;path=%PATH%;C:\swarm\bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, it is possible to have conflicts if other versions of libraries used by Swarm, such as HDF5, are already installed and in your path. And some Swarm programs require that the environment variable SWARMHOME be defined, which will typically not be true. These problems can be avoided by using the following statements instead of the above path command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
You can alternatively add the Swarm folder to your &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; permanently by editing the Windows PATH environment variable. A tool like [[#RapidEE|RapidEE]] makes doing so easy, or you can use use Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; to the PATH system variable.&lt;br /&gt;
&lt;br /&gt;
Once the path has been set to include the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder, Swarm models can be started through the Windows command line, or by double-clicking on them from the Windows Explorer.  &lt;br /&gt;
&lt;br /&gt;
The Heatbugs model can now be run by changing the directory of the command line to the folder holding &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; and then executing the program. For example, if &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is located in &amp;lt;tt&amp;gt;C:\Users\example_user\Downloads&amp;lt;/tt&amp;gt;, then the model may be run as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd C:\Users\example_user\Downloads&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(or you can just double-click on &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; from Windows Explorer, which temporarily opens a Windows command terminal while the model runs.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Running_Heatbugs.png|frame|none|alt=Running the Heatbugs model]]&lt;br /&gt;
&lt;br /&gt;
You can also create a simple Windows batch file that sets SWARMHOME and the path and then executes the model. Create a file called, for example &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; in the same directory where &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is, containing these lines: &lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, just double-clicking on &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; will start the model.&lt;br /&gt;
&lt;br /&gt;
If you try this and get an error that some .dll file is not found, then the problem is likely that the path is not set correctly to include the swarm\bin folder. If instead the program crashes without an error statement, then the problem is more likely that SWARMHOME needs to be set.&lt;br /&gt;
&lt;br /&gt;
= Installing Swarm and MinGW to compile models =&lt;br /&gt;
&lt;br /&gt;
To compile Swarm models from source using MinGW, the following simple steps need to be taken to set up the build environment:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|Install MinGW using instructions here]]. Currently only 32-bit MinGW can be used with Swarm. Install all components of MinGW.&lt;br /&gt;
* Download compiled Swarm binaries, archived as [http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip swarm-2.4.1-win32.zip]. Unzip the archive and place the extracted folder at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
The archived Swarm binaries '''MUST''' be placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt; to successfully compile Swarm models. This is because some paths had to be hard-coded by &amp;lt;tt&amp;gt;libtool&amp;lt;/tt&amp;gt; during the creation of the binaries.&lt;br /&gt;
&lt;br /&gt;
The final step before you can compile a Swarm model is to set the &amp;lt;tt&amp;gt;SWARMHOME&amp;lt;/tt&amp;gt; environment variable so that the &amp;amp;quot;make&amp;amp;quot; program knows where to find the Swarm libraries when compiling your code. There are several ways to do this.&lt;br /&gt;
*You can temporarily set SWARMHOME by entering this command in the MinGW shell: &amp;lt;pre&amp;gt;export SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*You can edit your Makefile so it starts with: &amp;lt;pre&amp;gt;SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Set SWARMHOME permanently as a Windows environment variable, either by using [[#RapidEE|RapidEE]] or Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add a new (User or System) variable called SWARMHOME with the value &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After MinGW has been installed and the Swarm binaries have been downloaded, Swarm models may be compiled using the MinGW shell. Start up the program MinGW Shell, cd to the directory containing your code and Makefile, and enter the command &amp;amp;quot;Make&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
An archive of official Swarm example programs can be downloaded from:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://download.savannah.gnu.org/releases/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
&lt;br /&gt;
We will use the &amp;amp;quot;Heatbugs&amp;amp;quot; model as an example of how to compile a Swarm application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf /path/to/downloaded/swarmapps-2.3.0.tar.gz&lt;br /&gt;
cd swarmapps-2.3.0/objc/heatbugs&lt;br /&gt;
&lt;br /&gt;
make&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''VERY IMPORTANT NOTE: MinGW produces two executables called &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt;---one in the &amp;lt;tt&amp;gt;heatbugs&amp;lt;/tt&amp;gt; folder and another in the &amp;lt;tt&amp;gt;heatbugs/.libs&amp;lt;/tt&amp;gt; folder. You should ignore the executable in the top-level folder, &amp;lt;tt&amp;gt;heatbugs/heatbugs.exe&amp;lt;/tt&amp;gt;, as it is merely a compiled wrapper script that executes &amp;lt;tt&amp;gt;heatbugs/.libs/heatbugs.exe&amp;lt;/tt&amp;gt;. When distributing compiled models, only use binaries from the &amp;lt;tt&amp;gt;.libs&amp;lt;/tt&amp;gt; folder.'''&lt;br /&gt;
&lt;br /&gt;
The resulting executable, &amp;lt;tt&amp;gt;.libs/heatbugs.exe&amp;lt;/tt&amp;gt; may be executing by following the steps described above at ''Using Swarm Models Compiled with MinGW''. These steps must include setting the Windows Path to include &amp;lt;tt&amp;gt;C:\swarm\bin&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Distributing a Swarm Model for Windows Users =&lt;br /&gt;
&lt;br /&gt;
A major benefit of the MinGW version of Swarm is that models can be distributed for people to use without installing Swarm. A simple way to do this, after the model has been compiled and tested using methods in the previous section, is to create a ZIP archive that contains all the files to run the model.&lt;br /&gt;
&lt;br /&gt;
* Create a directory tree that includes the Swarm binary files. For example, create C:\MySwarmModel and add the Swarm binaries (as described [[Swarm_and_MinGW#Using_Swarm_Models_Compiled_with_MinGW|above]]) to it as a subdirectory tree.&lt;br /&gt;
* Create another subdirectory that includes just the compiled model.&lt;br /&gt;
* Create a third subdirectory that includes any input files that the model needs and a batch file that sets the path and executes the model. &lt;br /&gt;
* Zip the whole tree up for distribution.&lt;br /&gt;
&lt;br /&gt;
The directory tree in the zip file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\MySwarmModel\swarm&lt;br /&gt;
                      \bin&lt;br /&gt;
                      \etc&lt;br /&gt;
                      \include&lt;br /&gt;
                      \lib&lt;br /&gt;
                      \man&lt;br /&gt;
                      \share&lt;br /&gt;
               \executable\MySwarmModel.exe&lt;br /&gt;
               \Runfiles\MySwarmModel.bat (and any input files)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the file &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt; contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set SWARMHOME=C:\MySwarmModel\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
C:\MySwarmModel\executable\MySwarmModel.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then users can run the model just by double-clicking on &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Building Swarm Using MinGW =&lt;br /&gt;
&lt;br /&gt;
This tutorial provides directions and code for compiling your own Swarm libraries for Windows. It is a bit advanced---some familiarity with compiling software from source in a Linux environment and knowledge of the UNIX command line is assumed.&lt;br /&gt;
&lt;br /&gt;
== Install Required Tools ==&lt;br /&gt;
&lt;br /&gt;
The first step is to download and install tools required for compiling Swarm. These links provide directions:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|MinGW]]&lt;br /&gt;
* [[#Emacs|Emacs]]&lt;br /&gt;
* [[#GPerf|GPerf]]&lt;br /&gt;
&lt;br /&gt;
== Build Support Libraries ==&lt;br /&gt;
&lt;br /&gt;
The next steps are to build and install the libraries that Swarm depends on. A ZIP archive containing all the source code required can be found at:&lt;br /&gt;
&lt;br /&gt;
[http://ftp.swarm.org/pub/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip http://ftp.swarm.org/pub/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip]&lt;br /&gt;
&lt;br /&gt;
This archive contains two subdirectories:&lt;br /&gt;
&lt;br /&gt;
* sources: This folder contains the source code for each component.&lt;br /&gt;
* patches: This folder contains patchfiles that modfy source code so that MinGW can compile it.&lt;br /&gt;
&lt;br /&gt;
After downloading and extracting the source code archive, open up a MinGW shell and run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
mkdir build&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following steps will all assume your MinGW shell is operating out of the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory. All compiled software will be installed to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt; (The Windows Explorer will see the folder appear at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== ZLib ===&lt;br /&gt;
&lt;br /&gt;
ZLib will be the first library to be built as it is a common dependency for many of the other software components. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following to build Zlib:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/zlib-1.2.5.tar.gz&lt;br /&gt;
cd zlib-1.2.5&lt;br /&gt;
make -f win32/Makefile.gcc&amp;lt;/pre&amp;gt;&lt;br /&gt;
And then the following commands to install ZLib to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -p /c/swarm/bin&lt;br /&gt;
mkdir -p /c/swarm/include&lt;br /&gt;
mkdir -p /c/swarm/lib&lt;br /&gt;
&lt;br /&gt;
cp zlib1.dll /c/swarm/bin/&lt;br /&gt;
cp zconf.h zlib.h /c/swarm/include/&lt;br /&gt;
mv libzdll.a libz.dll.a&lt;br /&gt;
cp *.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LibPNG ===&lt;br /&gt;
&lt;br /&gt;
LibPNG will be built next as its only dependency is ZLib. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following steps to build and install LibPNG:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/libpng-1.5.4.tar.bz2&lt;br /&gt;
cd libpng-1.5.4&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm --with-zlib-prefix=/c/swarm&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XPM ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, the XPM library can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/xpm-nox-4.2.0.tar.bz2&lt;br /&gt;
cd xpm-nox-4.2.0&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/xpm-nox-4.2.0-mingw-tcl.patch&lt;br /&gt;
&lt;br /&gt;
make CC=gcc&lt;br /&gt;
make install prefix=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
The patchfile is inherited from the SUSE builds of XPM for MinGW and adds Makefiles and other critical components.&lt;br /&gt;
&lt;br /&gt;
One major modification has been made to the SUSE patchfile---&amp;lt;tt&amp;gt;tcl.h&amp;lt;/tt&amp;gt; is included in &amp;lt;tt&amp;gt;xpm.h&amp;lt;/tt&amp;gt;. This is required in order to use XPM while Tk is installed. Conversely, this means that this build of XPM cannot be used without having Tk installed.&lt;br /&gt;
&lt;br /&gt;
=== LibFFI ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, LibFFI can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/libffi-3.0.9.tar.gz&lt;br /&gt;
cd libffi-3.0.9&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
The LibFFI headers get installed in a weird place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mv /c/swarm/lib/libffi-3.0.9/include/*.h /c/swarm/include&lt;br /&gt;
rm -rf /c/swarm/lib/libffi-3.0.9&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tcl ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tcl can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tcl8.4.19-src.tar.gz&lt;br /&gt;
cd tcl8.4.19&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/tcl-8.4.19-fix-lvalues.patch&lt;br /&gt;
cd win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
At two places in the TCL source code, an assignment is made while simultaneously performing a typecast. The typecast and the assignment had to be split into separate operations in order to be acceptable to the MinGW compilers.&lt;br /&gt;
&lt;br /&gt;
=== Tk ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tk can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tk8.4.19-src.tar.gz&lt;br /&gt;
cd tk8.4.19/win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BLT ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, BLT can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/BLT2.4z.tar.gz&lt;br /&gt;
cd blt2.4z&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm --without-x&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDF5 (Optional) ===&lt;br /&gt;
&lt;br /&gt;
Getting HDF5 to work with MinGW is a little tricky. It is an optional dependency, so if support for reading and writing &amp;lt;tt&amp;gt;.hdf&amp;lt;/tt&amp;gt; files is not needed this section can be skipped.&lt;br /&gt;
&lt;br /&gt;
As of version 1.8.7, HDF5 currently does not compile under MinGW. So, we must wrap pre-compiled binaries for use with MinGW. In order to wrap the binaries, we will need an additional tool called &amp;lt;tt&amp;gt;pexports&amp;lt;/tt&amp;gt;. This can be installed using &amp;lt;tt&amp;gt;mingw-get&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mingw-utils&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download 32-bit Windows binaries from the HDF website compiled for use with the Visual Studio compilers (these files have &amp;amp;amp;quot;VS&amp;amp;amp;quot; listed under the ''Compilers'' section). After extracting the archive, the HDF5 libraries can be wrapped for use with MinGW by executing the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd path/to/where/HDF5/was/extracted&lt;br /&gt;
&lt;br /&gt;
for dll in `ls dll/*dll`; do&lt;br /&gt;
  def_file=`basename $dll .dll`.def&lt;br /&gt;
  lib_file=lib`basename $dll dll.dll`.a&lt;br /&gt;
  pexports $dll &amp;amp;amp;gt; $def_file&lt;br /&gt;
  dlltool -d $def_file -l lib/$lib_file&lt;br /&gt;
done&amp;lt;/pre&amp;gt;&lt;br /&gt;
Next, move the libraries and header files needed to use HDF5 from C into &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp dll/hdf5dll.dll dll/szip.dll /c/swarm/bin&lt;br /&gt;
cp include/* /c/swarm/include&lt;br /&gt;
cp lib/libhdf5.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, a patch must be applied to the HDF header file &amp;lt;tt&amp;gt;H5public.h&amp;lt;/tt&amp;gt; so that it doesn't define &amp;lt;tt&amp;gt;ssize_t&amp;lt;/tt&amp;gt;---a constant already defined by MinGW. The required patch is contained in the Swarm MinGW source archive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
patch -p1 -d /c/swarm &amp;amp;amp;lt; patches/hdf5-1.8.7-mingw.patch&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Swarm ==&lt;br /&gt;
&lt;br /&gt;
Finally, the Swarm libraries themselves can be built. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/swarm-2.4.1.tar.gz&lt;br /&gt;
cd swarm-2.4.1&lt;br /&gt;
patch -p1 ../../patches/swarm-2.4.1-mingw.patch&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm \&lt;br /&gt;
  --with-zlibdir=/c/swarm \&lt;br /&gt;
  --with-pngdir=/c/swarm \&lt;br /&gt;
  --with-xpmdir=/c/swarm \&lt;br /&gt;
  --with-ffidir=/c/swarm \&lt;br /&gt;
  --with-tcl=/c/swarm/lib \&lt;br /&gt;
  --with-tk=/c/swarm/lib \&lt;br /&gt;
  --with-bltdir=/c/swarm&lt;br /&gt;
&lt;br /&gt;
cd avcall&lt;br /&gt;
gcc -S avcall-i386.c&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you wrapped HDF5 up for use with MinGW, add &amp;lt;tt&amp;gt;--with-hdf5dir=/c/swarm&amp;lt;/tt&amp;gt; to the list of arguments passed to &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-mingw.patch&amp;lt;/tt&amp;gt; modifies the Swarm source code in the following ways:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;gettimeofday&amp;lt;/tt&amp;gt; is no longer defined in the Swarm sources as MinGW includes this function in its standard library.&lt;br /&gt;
* Swarm GUI functions are updated to be compatible with LibPNG 1.5.&lt;br /&gt;
* The Swarm &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt; script defines &amp;lt;tt&amp;gt;DATADIR&amp;lt;/tt&amp;gt; as a preprocessor macro---this conflicts with variables in the GCC Objective-C library. &amp;lt;tt&amp;gt;DATDIR&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;undef&amp;lt;/tt&amp;gt;ed in critical parts of the source code.&lt;br /&gt;
* The &amp;lt;tt&amp;gt;sleep&amp;lt;/tt&amp;gt; function is aliased to &amp;lt;tt&amp;gt;usleep&amp;lt;/tt&amp;gt;---which is the name of the MinGW implementation.&lt;br /&gt;
* The way in which Makefiles invoke &amp;lt;tt&amp;gt;gperf&amp;lt;/tt&amp;gt; is amended so that it actually produces output.&lt;br /&gt;
* NULL checks are added to `zstrdup` in src/defobj/internal.m. Some functions in the Swarm library may attempt to call `zstrdup` on a NULL pointer. (This happens if the SWARMHOME environment variable is not set.) Failing to check for this condition can lead to segfaults. `zstrdup` now returns NULL if passed a NULL string or if `alloc` fails to allocate memory for a duplicate.&lt;br /&gt;
&lt;br /&gt;
Full details are contained in the patchfile.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
&lt;br /&gt;
== MinGW ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.mingw.org&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/mingw/files&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 20110530&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org MinGW] is a set of software that aims to provide an environment where software developed on UNIX-like systems can be easily compiled for Windows. Since Swarm is primarily developed on Linux (a UNIX clone), MinGW can ease the task of creating Swarm models that run on Windows.&lt;br /&gt;
&lt;br /&gt;
MinGW is similar to the [http://www.cygwin.org Cygwin] project. The major difference is that MinGW produces executables that depend only on native Windows libraries while Cygwin executables require special compatibility libraries that are part of the Cygwin distribution.&lt;br /&gt;
&lt;br /&gt;
=== Installing MinGW ===&lt;br /&gt;
&lt;br /&gt;
MinGW can be installed by downloading the &amp;amp;amp;quot;Automated MinGW Installer&amp;amp;amp;quot;, which usually has a name like &amp;lt;tt&amp;gt;mingw-get-inst-&amp;amp;amp;lt;date&amp;amp;amp;gt;.exe&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;&amp;amp;amp;lt;date&amp;amp;amp;gt;&amp;lt;/tt&amp;gt; is the datestamp for when the installer was packaged. Running this executable will start the installation process. The installer lets you select which optional components to install; make sure all boxes are checked so you '''install all components'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Setup.png|frame|none|alt=Install all available MinGW components]]&lt;br /&gt;
&lt;br /&gt;
The installer downloads all components from the internet. This will take a while, so have a cup of coffee or walk the dog.&lt;br /&gt;
&lt;br /&gt;
See the following section about also installing an optional, more-functional shell window for MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Using MinGW ===&lt;br /&gt;
&lt;br /&gt;
The MinGW compilers are accessible through the &amp;amp;amp;quot;MinGW Shell&amp;amp;amp;quot; which should be located under the MinGW folder in the Start Menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Shell.png|frame|none|alt=Location of MinGW Shell]]&lt;br /&gt;
&lt;br /&gt;
or by running &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; (if MinGW was installed to its default location).&lt;br /&gt;
&lt;br /&gt;
By default the MinGW shell executes inside of a Windows &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt; terminal. There are a couple major drawbacks to this:&lt;br /&gt;
&lt;br /&gt;
* You cannot resize the window to full-screen.&lt;br /&gt;
* The shell provides limited history scrollback.&lt;br /&gt;
&lt;br /&gt;
MinGW provides a couple of alternative terminals for the MinGW shell which do not have these drawbacks; one of which is called MinTTY. To install MinTTY execute the following in a MinGW shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mintty&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then the &amp;lt;tt&amp;gt;mintty&amp;lt;/tt&amp;gt; command can be used to launch a MinTTY terminal. The MinGW Shell can also be set to launch MinTTY by default by editing the file &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; and changing the following line (approximately line 58):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=sh.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=mintty.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A Note About Paths ===&lt;br /&gt;
&lt;br /&gt;
The MinGW Shell emulates a UNIX &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell and thus uses UNIX-style paths, &amp;lt;tt&amp;gt;/path/to/file&amp;lt;/tt&amp;gt;, instead of Windows-style paths, &amp;lt;tt&amp;gt;C:\path\to\file&amp;lt;/tt&amp;gt;. One peculiarity of this process is that the shell must deal with the fact that Windows filesystems have multiple roots (&amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt;, etc.) while a UNIX filesystem only has one root called &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;. The way this is reconciled by the &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell provided with MinGW is that &amp;lt;tt&amp;gt;/c&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt; drive, &amp;lt;tt&amp;gt;/d&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt; drive and so on and so forth.&lt;br /&gt;
&lt;br /&gt;
The root of the filesystem itself, &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;, also has some caveats. &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt; refers to the &amp;lt;tt&amp;gt;mysy&amp;lt;/tt&amp;gt; folder, &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0&amp;lt;/tt&amp;gt; in a default installation. &amp;lt;tt&amp;gt;/usr&amp;lt;/tt&amp;gt; also refers to the same location. Thus, &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/local&amp;lt;/tt&amp;gt; both refer to &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0/local&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== A Note About MinGW-64 ===&lt;br /&gt;
&lt;br /&gt;
Currently Swarm has been developed and tested against the 32-bit version of MinGW. Hence Swarm models produced this way should run in any version of Windows.&lt;br /&gt;
&lt;br /&gt;
The [MinGW-w64][mingw_65] project produces 64-bit MinGW compilers that can produce 64-bit executables that will only run on 64-bit versions of Windows. These executables benefit from:&lt;br /&gt;
&lt;br /&gt;
* Access to more memory. A 32-bit executable will only be able to allocate ~3 GB of RAM---even if the system has more RAM available.&lt;br /&gt;
* Possibly quicker execution speeds due to matching the native architecture of the operating system---however this depends on the types of tasks that the program executes. It has been reported that 64 bit Swarm executables run quicker than 32 bit Swarm executables on Linux.&lt;br /&gt;
&lt;br /&gt;
Currently, no attempt has been made to compile Swarm 2.4.1 with the 64 bit MinGW compilers. If a successful attempt is made, please report it on the [http://www.swarm.org/mailman/listinfo/support Swarm mailing list].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Emacs ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/emacs&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 23.3&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://ftp.gnu.org/gnu/emacs/windows&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GNU Emacs is a text editor that is used by many programmers to edit code. However, Emacs can also be scripted to perform a variety of complicated transformations on text files. The scripts that build the Swarm libraries use Emacs to automate the process of generating some source files. Thus Emacs has to be installed in order to build Swarm from source.&lt;br /&gt;
&lt;br /&gt;
=== Installing Emacs ===&lt;br /&gt;
&lt;br /&gt;
Install Emacs by downloading one of the &amp;lt;tt&amp;gt;emacs-&amp;amp;amp;lt;version&lt;br /&gt;
number&amp;amp;amp;gt;-bin-i386.zip&amp;lt;/tt&amp;gt; files from the download area. Don't use any of the&lt;br /&gt;
files containing &amp;lt;tt&amp;gt;barebin&amp;lt;/tt&amp;gt;. After extracting the ZIP archive there will&lt;br /&gt;
be an Emacs folder containing a subfolder called &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt;. Add this folder&lt;br /&gt;
to your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. [[#RapidEE|RapidEE]] can help edit the&lt;br /&gt;
&amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GPerf ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/gperf/&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/gnuwin32/files/gperf&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 3.0.1&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GPerf is a program that produces C code containing hash functions. The scripts&lt;br /&gt;
that build the Swarm libraries use GPerf to generate some source code files.&lt;br /&gt;
Download &amp;lt;tt&amp;gt;gperf.exe&amp;lt;/tt&amp;gt; from the GnuWin32 site on Sourceforge and place it&lt;br /&gt;
somewhere on your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. Again, [[#RapidEE|RapidEE]] can help set the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RapidEE ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.rapidee.com&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 5.0&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.rapidee.com/en/license Freeware]&lt;br /&gt;
&lt;br /&gt;
The Rapid Environment Editor (RapidEE) is a spiffy tool that makes it easy to inspect and alter the value of Windows environment variables, such as the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. RapidEE may be used to edit &amp;amp;amp;quot;System Variables&amp;amp;amp;quot; which will affect all user accounts or &amp;amp;amp;quot;User Variables&amp;amp;amp;quot; which will affect just the current account. Administrative privileges may be required to edit the System Variables.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_1.png|frame|none|alt=The different variables RapidEE can edit]]&lt;br /&gt;
&lt;br /&gt;
Right-clicking on the &amp;lt;tt&amp;gt;Path&amp;lt;/tt&amp;gt; variable in the System Variables or User Variables will bring up a menu that presents the option to &amp;amp;amp;quot;Add value&amp;amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_2.png|frame|none|alt=Adding a new value to the PATH]]&lt;br /&gt;
&lt;br /&gt;
Once the new entry has been added, RapidEE must be told to save the changes. Command line shells, such as &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;, must be restarted in order for them to notice the changes.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_3.png|frame|none|alt=Adding and saving a value]]&lt;br /&gt;
&lt;br /&gt;
== Depends ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.dependencywalker.com/&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 2.2&lt;br /&gt;
&lt;br /&gt;
'''License:''' Freeware&lt;br /&gt;
&lt;br /&gt;
Depends is a usefull utility that scans Windows executables and reports information concerning the Dynamic-link Libraries (DLLs) that those executables require in order to run.&lt;br /&gt;
&lt;br /&gt;
= Software Used to Compile Swarm 2.4.1 =&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!  Name&lt;br /&gt;
!  Verson Used&lt;br /&gt;
!  License&lt;br /&gt;
!  Homepage&lt;br /&gt;
!  Download Area&lt;br /&gt;
|-&lt;br /&gt;
|  ZLib&lt;br /&gt;
|  1.2.5&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG License]&lt;br /&gt;
|  [http://www.zlib.net http://www.zlib.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibFFI&lt;br /&gt;
|  3.0.9&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  [http://sourceware.org/libffi http://sourceware.org/libffi]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibPNG&lt;br /&gt;
|  1.5.4&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG]&lt;br /&gt;
|  [http://www.libpng.org/pub/png/libpng.html http://www.libpng.org/pub/png/libpng.html]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  XPM-NoX&lt;br /&gt;
|  4.2.0&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  unknown&lt;br /&gt;
|  [http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32 http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32]&lt;br /&gt;
|-&lt;br /&gt;
|  Tcl&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Tk&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  BLT&lt;br /&gt;
|  2.4z&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://blt.sourceforge.net http://blt.sourceforge.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  HDF5&lt;br /&gt;
|  1.8.7&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://www.hdfgroup.org/HDF5 http://www.hdfgroup.org/HDF5]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Swarm&lt;br /&gt;
|  2.4.1&lt;br /&gt;
|  [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
|  [http://www.swarm.org http://www.swarm.org]&lt;br /&gt;
|  [http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2161</id>
		<title>Swarm and MinGW</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2161"/>
				<updated>2015-12-03T01:33:50Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Installing Swarm and MinGW to compile models */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This documentation provides information on how to use Swarm on Windows with [http://www.mingw.org MinGW] compilers. The following topics will be covered:&lt;br /&gt;
&lt;br /&gt;
* How to run a Swam model compiled with MinGW on Windows: Once you produce a Swarm model using MinGW (or someone gives one to you), how do you run it on other machines without installing Swarm there?&lt;br /&gt;
* How to use MinGW to compile your own Swarm models, either during model development or so you can distribute working models to others. This requires installing MinGW and our binary Swarm libraries.&lt;br /&gt;
* How to package a model compiled with MinGW so it can be installed and run by itself on Windows machines.&lt;br /&gt;
* How to use MinGW to compile the Swarm libraries, in case you want to build your own Swarm binaries.&lt;br /&gt;
&lt;br /&gt;
Each topic is more difficult than the one before it. However the topics are independent in that it is not necessary to know how to compile the Swarm library in order to run a pre-compiled Swarm model or compile your own model against a pre-compiled version of Swarm.&lt;br /&gt;
&lt;br /&gt;
= Using Swarm Models Compiled with MinGW =&lt;br /&gt;
&lt;br /&gt;
A model that has been compiled using MinGW can be installed and run from a Windows computer without installing MinGW or Swarm. An example code is this build of Heatbugs:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe]&lt;br /&gt;
&lt;br /&gt;
However, running a Swarm model requires some support programs and libraries. These are available as&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-win32.zip&amp;lt;/tt&amp;gt;, available here:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip]&lt;br /&gt;
&lt;br /&gt;
Unzipping that file will create a folder called &amp;lt;tt&amp;gt;swarm&amp;lt;/tt&amp;gt; which should be moved somewhere that is easy to remember. The rest of this tutorial will assume this Swarm folder has been placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before a Swarm model can be run, the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder must be added to the Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; so that Heatbugs can find necessary libraries when it runs. The &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder can be ''temporarily'' added to the path by executing the following in the Windows command line (the command line is accessed using the program &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;path=%PATH%;C:\swarm\bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, it is possible to have conflicts if other versions of libraries used by Swarm, such as HDF5, are already installed and in your path. And some Swarm programs require that the environment variable SWARMHOME be defined, which will typically not be true. These problems can be avoided by using the following statements instead of the above path command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
You can alternatively add the Swarm folder to your &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; permanently by editing the Windows PATH environment variable. A tool like [[#RapidEE|RapidEE]] makes doing so easy, or you can use use Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; to the PATH system variable.&lt;br /&gt;
&lt;br /&gt;
Once the path has been set to include the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder, Swarm models can be started through the Windows command line, or by double-clicking on them from the Windows Explorer.  &lt;br /&gt;
&lt;br /&gt;
The Heatbugs model can now be run by changing the directory of the command line to the folder holding &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; and then executing the program. For example, if &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is located in &amp;lt;tt&amp;gt;C:\Users\example_user\Downloads&amp;lt;/tt&amp;gt;, then the model may be run as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd C:\Users\example_user\Downloads&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(or you can just double-click on &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; from Windows Explorer, which temporarily opens a Windows command terminal while the model runs.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Running_Heatbugs.png|frame|none|alt=Running the Heatbugs model]]&lt;br /&gt;
&lt;br /&gt;
You can also create a simple Windows batch file that sets SWARMHOME and the path and then executes the model. Create a file called, for example &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; in the same directory where &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is, containing these lines: &lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, just double-clicking on &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; will start the model.&lt;br /&gt;
&lt;br /&gt;
If you try this and get an error that some .dll file is not found, then the problem is likely that the path is not set correctly to include the swarm\bin folder. If instead the program crashes without an error statement, then the problem is more likely that SWARMHOME needs to be set.&lt;br /&gt;
&lt;br /&gt;
= Installing Swarm and MinGW to compile models =&lt;br /&gt;
&lt;br /&gt;
To compile Swarm models from source using MinGW, the following simple steps need to be taken to set up the build environment:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|Install MinGW using instructions here]]. Currently only 32-bit MinGW can be used with Swarm. Install all components of MinGW.&lt;br /&gt;
* Download compiled Swarm binaries, archived as [http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip swarm-2.4.1-win32.zip]. Unzip the archive and place the extracted folder at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
The archived Swarm binaries '''MUST''' be placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt; to successfully compile Swarm models. This is because some paths had to be hard-coded by &amp;lt;tt&amp;gt;libtool&amp;lt;/tt&amp;gt; during the creation of the binaries.&lt;br /&gt;
&lt;br /&gt;
The final step before you can compile a Swarm model is to set the &amp;lt;tt&amp;gt;SWARMHOME&amp;lt;/tt&amp;gt; environment variable so that the &amp;amp;quot;make&amp;amp;quot; program knows where to find the Swarm libraries when compiling your code. There are several ways to do this.&lt;br /&gt;
*You can temporarily set SWARMHOME by entering this command in the MinGW shell: &amp;lt;pre&amp;gt;export SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*You can edit your Makefile so it starts with: &amp;lt;pre&amp;gt;SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Set SWARMHOME permanently as a Windows environment variable, either by using [[#RapidEE|RapidEE]] or Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add a new (User or System) variable called SWARMHOME with the value &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After MinGW has been installed and the Swarm binaries have been downloaded, Swarm models may be compiled using the MinGW shell. Start up the program MinGW Shell, cd to the directory containing your code and Makefile, and enter the command &amp;amp;quot;Make&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
An archive of official Swarm example programs can be downloaded from:&lt;br /&gt;
&lt;br /&gt;
[http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
&lt;br /&gt;
We will use the &amp;amp;amp;quot;Heatbugs&amp;amp;amp;quot; model as an example of how to compile a Swarm application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf /path/to/downloaded/swarmapps-2.3.0.tar.gz&lt;br /&gt;
cd swarmapps-2.3.0/objc/heatbugs&lt;br /&gt;
&lt;br /&gt;
make&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''VERY IMPORTANT NOTE: MinGW produces two executables called &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt;---one in the &amp;lt;tt&amp;gt;heatbugs&amp;lt;/tt&amp;gt; folder and another in the &amp;lt;tt&amp;gt;heatbugs/.libs&amp;lt;/tt&amp;gt; folder. You should ignore the executable in the top-level folder, &amp;lt;tt&amp;gt;heatbugs/heatbugs.exe&amp;lt;/tt&amp;gt;, as it is merely a compiled wrapper script that executes &amp;lt;tt&amp;gt;heatbugs/.libs/heatbugs.exe&amp;lt;/tt&amp;gt;. When distributing compiled models, only use binaries from the &amp;lt;tt&amp;gt;.libs&amp;lt;/tt&amp;gt; folder.'''&lt;br /&gt;
&lt;br /&gt;
The resulting executable, &amp;lt;tt&amp;gt;.libs/heatbugs.exe&amp;lt;/tt&amp;gt; may be executing by following the steps described above at ''Using Swarm Models Compiled with MinGW''. These steps must include setting the Windows Path to include &amp;lt;tt&amp;gt;C:\swarm\bin&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Distributing a Swarm Model for Windows Users =&lt;br /&gt;
&lt;br /&gt;
A major benefit of the MinGW version of Swarm is that models can be distributed for people to use without installing Swarm. A simple way to do this, after the model has been compiled and tested using methods in the previous section, is to create a ZIP archive that contains all the files to run the model.&lt;br /&gt;
&lt;br /&gt;
* Create a directory tree that includes the Swarm binary files. For example, create C:\MySwarmModel and add the Swarm binaries (as described [[Swarm_and_MinGW#Using_Swarm_Models_Compiled_with_MinGW|above]]) to it as a subdirectory tree.&lt;br /&gt;
* Create another subdirectory that includes just the compiled model.&lt;br /&gt;
* Create a third subdirectory that includes any input files that the model needs and a batch file that sets the path and executes the model. &lt;br /&gt;
* Zip the whole tree up for distribution.&lt;br /&gt;
&lt;br /&gt;
The directory tree in the zip file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\MySwarmModel\swarm&lt;br /&gt;
                      \bin&lt;br /&gt;
                      \etc&lt;br /&gt;
                      \include&lt;br /&gt;
                      \lib&lt;br /&gt;
                      \man&lt;br /&gt;
                      \share&lt;br /&gt;
               \executable\MySwarmModel.exe&lt;br /&gt;
               \Runfiles\MySwarmModel.bat (and any input files)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the file &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt; contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set SWARMHOME=C:\MySwarmModel\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
C:\MySwarmModel\executable\MySwarmModel.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then users can run the model just by double-clicking on &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Building Swarm Using MinGW =&lt;br /&gt;
&lt;br /&gt;
This tutorial provides directions and code for compiling your own Swarm libraries for Windows. It is a bit advanced---some familiarity with compiling software from source in a Linux environment and knowledge of the UNIX command line is assumed.&lt;br /&gt;
&lt;br /&gt;
== Install Required Tools ==&lt;br /&gt;
&lt;br /&gt;
The first step is to download and install tools required for compiling Swarm. These links provide directions:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|MinGW]]&lt;br /&gt;
* [[#Emacs|Emacs]]&lt;br /&gt;
* [[#GPerf|GPerf]]&lt;br /&gt;
&lt;br /&gt;
== Build Support Libraries ==&lt;br /&gt;
&lt;br /&gt;
The next steps are to build and install the libraries that Swarm depends on. A ZIP archive containing all the source code required can be found at:&lt;br /&gt;
&lt;br /&gt;
[http://ftp.swarm.org/pub/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip http://ftp.swarm.org/pub/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip]&lt;br /&gt;
&lt;br /&gt;
This archive contains two subdirectories:&lt;br /&gt;
&lt;br /&gt;
* sources: This folder contains the source code for each component.&lt;br /&gt;
* patches: This folder contains patchfiles that modfy source code so that MinGW can compile it.&lt;br /&gt;
&lt;br /&gt;
After downloading and extracting the source code archive, open up a MinGW shell and run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
mkdir build&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following steps will all assume your MinGW shell is operating out of the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory. All compiled software will be installed to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt; (The Windows Explorer will see the folder appear at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== ZLib ===&lt;br /&gt;
&lt;br /&gt;
ZLib will be the first library to be built as it is a common dependency for many of the other software components. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following to build Zlib:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/zlib-1.2.5.tar.gz&lt;br /&gt;
cd zlib-1.2.5&lt;br /&gt;
make -f win32/Makefile.gcc&amp;lt;/pre&amp;gt;&lt;br /&gt;
And then the following commands to install ZLib to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -p /c/swarm/bin&lt;br /&gt;
mkdir -p /c/swarm/include&lt;br /&gt;
mkdir -p /c/swarm/lib&lt;br /&gt;
&lt;br /&gt;
cp zlib1.dll /c/swarm/bin/&lt;br /&gt;
cp zconf.h zlib.h /c/swarm/include/&lt;br /&gt;
mv libzdll.a libz.dll.a&lt;br /&gt;
cp *.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LibPNG ===&lt;br /&gt;
&lt;br /&gt;
LibPNG will be built next as its only dependency is ZLib. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following steps to build and install LibPNG:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/libpng-1.5.4.tar.bz2&lt;br /&gt;
cd libpng-1.5.4&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm --with-zlib-prefix=/c/swarm&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XPM ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, the XPM library can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/xpm-nox-4.2.0.tar.bz2&lt;br /&gt;
cd xpm-nox-4.2.0&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/xpm-nox-4.2.0-mingw-tcl.patch&lt;br /&gt;
&lt;br /&gt;
make CC=gcc&lt;br /&gt;
make install prefix=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
The patchfile is inherited from the SUSE builds of XPM for MinGW and adds Makefiles and other critical components.&lt;br /&gt;
&lt;br /&gt;
One major modification has been made to the SUSE patchfile---&amp;lt;tt&amp;gt;tcl.h&amp;lt;/tt&amp;gt; is included in &amp;lt;tt&amp;gt;xpm.h&amp;lt;/tt&amp;gt;. This is required in order to use XPM while Tk is installed. Conversely, this means that this build of XPM cannot be used without having Tk installed.&lt;br /&gt;
&lt;br /&gt;
=== LibFFI ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, LibFFI can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/libffi-3.0.9.tar.gz&lt;br /&gt;
cd libffi-3.0.9&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
The LibFFI headers get installed in a weird place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mv /c/swarm/lib/libffi-3.0.9/include/*.h /c/swarm/include&lt;br /&gt;
rm -rf /c/swarm/lib/libffi-3.0.9&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tcl ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tcl can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tcl8.4.19-src.tar.gz&lt;br /&gt;
cd tcl8.4.19&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/tcl-8.4.19-fix-lvalues.patch&lt;br /&gt;
cd win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
At two places in the TCL source code, an assignment is made while simultaneously performing a typecast. The typecast and the assignment had to be split into separate operations in order to be acceptable to the MinGW compilers.&lt;br /&gt;
&lt;br /&gt;
=== Tk ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tk can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tk8.4.19-src.tar.gz&lt;br /&gt;
cd tk8.4.19/win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BLT ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, BLT can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/BLT2.4z.tar.gz&lt;br /&gt;
cd blt2.4z&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm --without-x&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDF5 (Optional) ===&lt;br /&gt;
&lt;br /&gt;
Getting HDF5 to work with MinGW is a little tricky. It is an optional dependency, so if support for reading and writing &amp;lt;tt&amp;gt;.hdf&amp;lt;/tt&amp;gt; files is not needed this section can be skipped.&lt;br /&gt;
&lt;br /&gt;
As of version 1.8.7, HDF5 currently does not compile under MinGW. So, we must wrap pre-compiled binaries for use with MinGW. In order to wrap the binaries, we will need an additional tool called &amp;lt;tt&amp;gt;pexports&amp;lt;/tt&amp;gt;. This can be installed using &amp;lt;tt&amp;gt;mingw-get&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mingw-utils&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download 32-bit Windows binaries from the HDF website compiled for use with the Visual Studio compilers (these files have &amp;amp;amp;quot;VS&amp;amp;amp;quot; listed under the ''Compilers'' section). After extracting the archive, the HDF5 libraries can be wrapped for use with MinGW by executing the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd path/to/where/HDF5/was/extracted&lt;br /&gt;
&lt;br /&gt;
for dll in `ls dll/*dll`; do&lt;br /&gt;
  def_file=`basename $dll .dll`.def&lt;br /&gt;
  lib_file=lib`basename $dll dll.dll`.a&lt;br /&gt;
  pexports $dll &amp;amp;amp;gt; $def_file&lt;br /&gt;
  dlltool -d $def_file -l lib/$lib_file&lt;br /&gt;
done&amp;lt;/pre&amp;gt;&lt;br /&gt;
Next, move the libraries and header files needed to use HDF5 from C into &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp dll/hdf5dll.dll dll/szip.dll /c/swarm/bin&lt;br /&gt;
cp include/* /c/swarm/include&lt;br /&gt;
cp lib/libhdf5.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, a patch must be applied to the HDF header file &amp;lt;tt&amp;gt;H5public.h&amp;lt;/tt&amp;gt; so that it doesn't define &amp;lt;tt&amp;gt;ssize_t&amp;lt;/tt&amp;gt;---a constant already defined by MinGW. The required patch is contained in the Swarm MinGW source archive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
patch -p1 -d /c/swarm &amp;amp;amp;lt; patches/hdf5-1.8.7-mingw.patch&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Swarm ==&lt;br /&gt;
&lt;br /&gt;
Finally, the Swarm libraries themselves can be built. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/swarm-2.4.1.tar.gz&lt;br /&gt;
cd swarm-2.4.1&lt;br /&gt;
patch -p1 ../../patches/swarm-2.4.1-mingw.patch&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm \&lt;br /&gt;
  --with-zlibdir=/c/swarm \&lt;br /&gt;
  --with-pngdir=/c/swarm \&lt;br /&gt;
  --with-xpmdir=/c/swarm \&lt;br /&gt;
  --with-ffidir=/c/swarm \&lt;br /&gt;
  --with-tcl=/c/swarm/lib \&lt;br /&gt;
  --with-tk=/c/swarm/lib \&lt;br /&gt;
  --with-bltdir=/c/swarm&lt;br /&gt;
&lt;br /&gt;
cd avcall&lt;br /&gt;
gcc -S avcall-i386.c&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you wrapped HDF5 up for use with MinGW, add &amp;lt;tt&amp;gt;--with-hdf5dir=/c/swarm&amp;lt;/tt&amp;gt; to the list of arguments passed to &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-mingw.patch&amp;lt;/tt&amp;gt; modifies the Swarm source code in the following ways:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;gettimeofday&amp;lt;/tt&amp;gt; is no longer defined in the Swarm sources as MinGW includes this function in its standard library.&lt;br /&gt;
* Swarm GUI functions are updated to be compatible with LibPNG 1.5.&lt;br /&gt;
* The Swarm &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt; script defines &amp;lt;tt&amp;gt;DATADIR&amp;lt;/tt&amp;gt; as a preprocessor macro---this conflicts with variables in the GCC Objective-C library. &amp;lt;tt&amp;gt;DATDIR&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;undef&amp;lt;/tt&amp;gt;ed in critical parts of the source code.&lt;br /&gt;
* The &amp;lt;tt&amp;gt;sleep&amp;lt;/tt&amp;gt; function is aliased to &amp;lt;tt&amp;gt;usleep&amp;lt;/tt&amp;gt;---which is the name of the MinGW implementation.&lt;br /&gt;
* The way in which Makefiles invoke &amp;lt;tt&amp;gt;gperf&amp;lt;/tt&amp;gt; is amended so that it actually produces output.&lt;br /&gt;
* NULL checks are added to `zstrdup` in src/defobj/internal.m. Some functions in the Swarm library may attempt to call `zstrdup` on a NULL pointer. (This happens if the SWARMHOME environment variable is not set.) Failing to check for this condition can lead to segfaults. `zstrdup` now returns NULL if passed a NULL string or if `alloc` fails to allocate memory for a duplicate.&lt;br /&gt;
&lt;br /&gt;
Full details are contained in the patchfile.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
&lt;br /&gt;
== MinGW ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.mingw.org&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/mingw/files&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 20110530&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org MinGW] is a set of software that aims to provide an environment where software developed on UNIX-like systems can be easily compiled for Windows. Since Swarm is primarily developed on Linux (a UNIX clone), MinGW can ease the task of creating Swarm models that run on Windows.&lt;br /&gt;
&lt;br /&gt;
MinGW is similar to the [http://www.cygwin.org Cygwin] project. The major difference is that MinGW produces executables that depend only on native Windows libraries while Cygwin executables require special compatibility libraries that are part of the Cygwin distribution.&lt;br /&gt;
&lt;br /&gt;
=== Installing MinGW ===&lt;br /&gt;
&lt;br /&gt;
MinGW can be installed by downloading the &amp;amp;amp;quot;Automated MinGW Installer&amp;amp;amp;quot;, which usually has a name like &amp;lt;tt&amp;gt;mingw-get-inst-&amp;amp;amp;lt;date&amp;amp;amp;gt;.exe&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;&amp;amp;amp;lt;date&amp;amp;amp;gt;&amp;lt;/tt&amp;gt; is the datestamp for when the installer was packaged. Running this executable will start the installation process. The installer lets you select which optional components to install; make sure all boxes are checked so you '''install all components'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Setup.png|frame|none|alt=Install all available MinGW components]]&lt;br /&gt;
&lt;br /&gt;
The installer downloads all components from the internet. This will take a while, so have a cup of coffee or walk the dog.&lt;br /&gt;
&lt;br /&gt;
See the following section about also installing an optional, more-functional shell window for MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Using MinGW ===&lt;br /&gt;
&lt;br /&gt;
The MinGW compilers are accessible through the &amp;amp;amp;quot;MinGW Shell&amp;amp;amp;quot; which should be located under the MinGW folder in the Start Menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Shell.png|frame|none|alt=Location of MinGW Shell]]&lt;br /&gt;
&lt;br /&gt;
or by running &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; (if MinGW was installed to its default location).&lt;br /&gt;
&lt;br /&gt;
By default the MinGW shell executes inside of a Windows &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt; terminal. There are a couple major drawbacks to this:&lt;br /&gt;
&lt;br /&gt;
* You cannot resize the window to full-screen.&lt;br /&gt;
* The shell provides limited history scrollback.&lt;br /&gt;
&lt;br /&gt;
MinGW provides a couple of alternative terminals for the MinGW shell which do not have these drawbacks; one of which is called MinTTY. To install MinTTY execute the following in a MinGW shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mintty&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then the &amp;lt;tt&amp;gt;mintty&amp;lt;/tt&amp;gt; command can be used to launch a MinTTY terminal. The MinGW Shell can also be set to launch MinTTY by default by editing the file &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; and changing the following line (approximately line 58):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=sh.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=mintty.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A Note About Paths ===&lt;br /&gt;
&lt;br /&gt;
The MinGW Shell emulates a UNIX &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell and thus uses UNIX-style paths, &amp;lt;tt&amp;gt;/path/to/file&amp;lt;/tt&amp;gt;, instead of Windows-style paths, &amp;lt;tt&amp;gt;C:\path\to\file&amp;lt;/tt&amp;gt;. One peculiarity of this process is that the shell must deal with the fact that Windows filesystems have multiple roots (&amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt;, etc.) while a UNIX filesystem only has one root called &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;. The way this is reconciled by the &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell provided with MinGW is that &amp;lt;tt&amp;gt;/c&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt; drive, &amp;lt;tt&amp;gt;/d&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt; drive and so on and so forth.&lt;br /&gt;
&lt;br /&gt;
The root of the filesystem itself, &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;, also has some caveats. &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt; refers to the &amp;lt;tt&amp;gt;mysy&amp;lt;/tt&amp;gt; folder, &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0&amp;lt;/tt&amp;gt; in a default installation. &amp;lt;tt&amp;gt;/usr&amp;lt;/tt&amp;gt; also refers to the same location. Thus, &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/local&amp;lt;/tt&amp;gt; both refer to &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0/local&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== A Note About MinGW-64 ===&lt;br /&gt;
&lt;br /&gt;
Currently Swarm has been developed and tested against the 32-bit version of MinGW. Hence Swarm models produced this way should run in any version of Windows.&lt;br /&gt;
&lt;br /&gt;
The [MinGW-w64][mingw_65] project produces 64-bit MinGW compilers that can produce 64-bit executables that will only run on 64-bit versions of Windows. These executables benefit from:&lt;br /&gt;
&lt;br /&gt;
* Access to more memory. A 32-bit executable will only be able to allocate ~3 GB of RAM---even if the system has more RAM available.&lt;br /&gt;
* Possibly quicker execution speeds due to matching the native architecture of the operating system---however this depends on the types of tasks that the program executes. It has been reported that 64 bit Swarm executables run quicker than 32 bit Swarm executables on Linux.&lt;br /&gt;
&lt;br /&gt;
Currently, no attempt has been made to compile Swarm 2.4.1 with the 64 bit MinGW compilers. If a successful attempt is made, please report it on the [http://www.swarm.org/mailman/listinfo/support Swarm mailing list].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Emacs ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/emacs&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 23.3&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://ftp.gnu.org/gnu/emacs/windows&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GNU Emacs is a text editor that is used by many programmers to edit code. However, Emacs can also be scripted to perform a variety of complicated transformations on text files. The scripts that build the Swarm libraries use Emacs to automate the process of generating some source files. Thus Emacs has to be installed in order to build Swarm from source.&lt;br /&gt;
&lt;br /&gt;
=== Installing Emacs ===&lt;br /&gt;
&lt;br /&gt;
Install Emacs by downloading one of the &amp;lt;tt&amp;gt;emacs-&amp;amp;amp;lt;version&lt;br /&gt;
number&amp;amp;amp;gt;-bin-i386.zip&amp;lt;/tt&amp;gt; files from the download area. Don't use any of the&lt;br /&gt;
files containing &amp;lt;tt&amp;gt;barebin&amp;lt;/tt&amp;gt;. After extracting the ZIP archive there will&lt;br /&gt;
be an Emacs folder containing a subfolder called &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt;. Add this folder&lt;br /&gt;
to your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. [[#RapidEE|RapidEE]] can help edit the&lt;br /&gt;
&amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GPerf ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/gperf/&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/gnuwin32/files/gperf&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 3.0.1&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GPerf is a program that produces C code containing hash functions. The scripts&lt;br /&gt;
that build the Swarm libraries use GPerf to generate some source code files.&lt;br /&gt;
Download &amp;lt;tt&amp;gt;gperf.exe&amp;lt;/tt&amp;gt; from the GnuWin32 site on Sourceforge and place it&lt;br /&gt;
somewhere on your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. Again, [[#RapidEE|RapidEE]] can help set the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RapidEE ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.rapidee.com&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 5.0&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.rapidee.com/en/license Freeware]&lt;br /&gt;
&lt;br /&gt;
The Rapid Environment Editor (RapidEE) is a spiffy tool that makes it easy to inspect and alter the value of Windows environment variables, such as the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. RapidEE may be used to edit &amp;amp;amp;quot;System Variables&amp;amp;amp;quot; which will affect all user accounts or &amp;amp;amp;quot;User Variables&amp;amp;amp;quot; which will affect just the current account. Administrative privileges may be required to edit the System Variables.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_1.png|frame|none|alt=The different variables RapidEE can edit]]&lt;br /&gt;
&lt;br /&gt;
Right-clicking on the &amp;lt;tt&amp;gt;Path&amp;lt;/tt&amp;gt; variable in the System Variables or User Variables will bring up a menu that presents the option to &amp;amp;amp;quot;Add value&amp;amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_2.png|frame|none|alt=Adding a new value to the PATH]]&lt;br /&gt;
&lt;br /&gt;
Once the new entry has been added, RapidEE must be told to save the changes. Command line shells, such as &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;, must be restarted in order for them to notice the changes.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_3.png|frame|none|alt=Adding and saving a value]]&lt;br /&gt;
&lt;br /&gt;
== Depends ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.dependencywalker.com/&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 2.2&lt;br /&gt;
&lt;br /&gt;
'''License:''' Freeware&lt;br /&gt;
&lt;br /&gt;
Depends is a usefull utility that scans Windows executables and reports information concerning the Dynamic-link Libraries (DLLs) that those executables require in order to run.&lt;br /&gt;
&lt;br /&gt;
= Software Used to Compile Swarm 2.4.1 =&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!  Name&lt;br /&gt;
!  Verson Used&lt;br /&gt;
!  License&lt;br /&gt;
!  Homepage&lt;br /&gt;
!  Download Area&lt;br /&gt;
|-&lt;br /&gt;
|  ZLib&lt;br /&gt;
|  1.2.5&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG License]&lt;br /&gt;
|  [http://www.zlib.net http://www.zlib.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibFFI&lt;br /&gt;
|  3.0.9&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  [http://sourceware.org/libffi http://sourceware.org/libffi]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibPNG&lt;br /&gt;
|  1.5.4&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG]&lt;br /&gt;
|  [http://www.libpng.org/pub/png/libpng.html http://www.libpng.org/pub/png/libpng.html]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  XPM-NoX&lt;br /&gt;
|  4.2.0&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  unknown&lt;br /&gt;
|  [http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32 http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32]&lt;br /&gt;
|-&lt;br /&gt;
|  Tcl&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Tk&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  BLT&lt;br /&gt;
|  2.4z&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://blt.sourceforge.net http://blt.sourceforge.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  HDF5&lt;br /&gt;
|  1.8.7&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://www.hdfgroup.org/HDF5 http://www.hdfgroup.org/HDF5]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Swarm&lt;br /&gt;
|  2.4.1&lt;br /&gt;
|  [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
|  [http://www.swarm.org http://www.swarm.org]&lt;br /&gt;
|  [http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=File:Running_Heatbugs.png&amp;diff=2160</id>
		<title>File:Running Heatbugs.png</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=File:Running_Heatbugs.png&amp;diff=2160"/>
				<updated>2015-12-03T01:32:01Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2159</id>
		<title>Swarm and MinGW</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2159"/>
				<updated>2015-12-02T23:23:55Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This documentation provides information on how to use Swarm on Windows with [http://www.mingw.org MinGW] compilers. The following topics will be covered:&lt;br /&gt;
&lt;br /&gt;
* How to run a Swam model compiled with MinGW on Windows: Once you produce a Swarm model using MinGW (or someone gives one to you), how do you run it on other machines without installing Swarm there?&lt;br /&gt;
* How to use MinGW to compile your own Swarm models, either during model development or so you can distribute working models to others. This requires installing MinGW and our binary Swarm libraries.&lt;br /&gt;
* How to package a model compiled with MinGW so it can be installed and run by itself on Windows machines.&lt;br /&gt;
* How to use MinGW to compile the Swarm libraries, in case you want to build your own Swarm binaries.&lt;br /&gt;
&lt;br /&gt;
Each topic is more difficult than the one before it. However the topics are independent in that it is not necessary to know how to compile the Swarm library in order to run a pre-compiled Swarm model or compile your own model against a pre-compiled version of Swarm.&lt;br /&gt;
&lt;br /&gt;
= Using Swarm Models Compiled with MinGW =&lt;br /&gt;
&lt;br /&gt;
A model that has been compiled using MinGW can be installed and run from a Windows computer without installing MinGW or Swarm. An example code is this build of Heatbugs:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe]&lt;br /&gt;
&lt;br /&gt;
However, running a Swarm model requires some support programs and libraries. These are available as&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-win32.zip&amp;lt;/tt&amp;gt;, available here:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip]&lt;br /&gt;
&lt;br /&gt;
Unzipping that file will create a folder called &amp;lt;tt&amp;gt;swarm&amp;lt;/tt&amp;gt; which should be moved somewhere that is easy to remember. The rest of this tutorial will assume this Swarm folder has been placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before a Swarm model can be run, the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder must be added to the Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; so that Heatbugs can find necessary libraries when it runs. The &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder can be ''temporarily'' added to the path by executing the following in the Windows command line (the command line is accessed using the program &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;path=%PATH%;C:\swarm\bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, it is possible to have conflicts if other versions of libraries used by Swarm, such as HDF5, are already installed and in your path. And some Swarm programs require that the environment variable SWARMHOME be defined, which will typically not be true. These problems can be avoided by using the following statements instead of the above path command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
You can alternatively add the Swarm folder to your &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; permanently by editing the Windows PATH environment variable. A tool like [[#RapidEE|RapidEE]] makes doing so easy, or you can use use Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; to the PATH system variable.&lt;br /&gt;
&lt;br /&gt;
Once the path has been set to include the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder, Swarm models can be started through the Windows command line, or by double-clicking on them from the Windows Explorer.  &lt;br /&gt;
&lt;br /&gt;
The Heatbugs model can now be run by changing the directory of the command line to the folder holding &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; and then executing the program. For example, if &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is located in &amp;lt;tt&amp;gt;C:\Users\example_user\Downloads&amp;lt;/tt&amp;gt;, then the model may be run as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd C:\Users\example_user\Downloads&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(or you can just double-click on &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; from Windows Explorer, which temporarily opens a Windows command terminal while the model runs.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Running_Heatbugs.png|frame|none|alt=Running the Heatbugs model]]&lt;br /&gt;
&lt;br /&gt;
You can also create a simple Windows batch file that sets SWARMHOME and the path and then executes the model. Create a file called, for example &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; in the same directory where &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is, containing these lines: &lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, just double-clicking on &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; will start the model.&lt;br /&gt;
&lt;br /&gt;
If you try this and get an error that some .dll file is not found, then the problem is likely that the path is not set correctly to include the swarm\bin folder. If instead the program crashes without an error statement, then the problem is more likely that SWARMHOME needs to be set.&lt;br /&gt;
&lt;br /&gt;
= Installing Swarm and MinGW to compile models =&lt;br /&gt;
&lt;br /&gt;
To compile Swarm models from source using MinGW, the following simple steps need to be taken to set up the build environment:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|Install MinGW using instructions here]]. Currently only 32-bit MinGW can be used with Swarm. Install all components of MinGW.&lt;br /&gt;
* Download compiled Swarm binaries, archived as [http://ftp.swarm.org/pub/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip swarm-2.4.1-win32.zip]. Unzip the archive and place the extracted folder at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
The archived Swarm binaries '''MUST''' be placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt; to successfully compile Swarm models. This is because some paths had to be hard-coded by &amp;lt;tt&amp;gt;libtool&amp;lt;/tt&amp;gt; during the creation of the binaries.&lt;br /&gt;
&lt;br /&gt;
The final step before you can compile a Swarm model is to set the &amp;lt;tt&amp;gt;SWARMHOME&amp;lt;/tt&amp;gt; environment variable so that the &amp;amp;quot;make&amp;amp;quot; program knows where to find the Swarm libraries when compiling your code. There are several ways to do this.&lt;br /&gt;
*You can temporarily set SWARMHOME by entering this command in the MinGW shell: &amp;lt;pre&amp;gt;export SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*You can edit your Makefile so it starts with: &amp;lt;pre&amp;gt;SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Set SWARMHOME permanently as a Windows environment variable, either by using [[#RapidEE|RapidEE]] or Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add a new (User or System) variable called SWARMHOME with the value &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After MinGW has been installed and the Swarm binaries have been downloaded, Swarm models may be compiled using the MinGW shell. Start up the program MinGW Shell, cd to the directory containing your code and Makefile, and enter the command &amp;amp;quot;Make&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
An archive of official Swarm example programs can be downloaded from:&lt;br /&gt;
&lt;br /&gt;
[http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
&lt;br /&gt;
We will use the &amp;amp;amp;quot;Heatbugs&amp;amp;amp;quot; model as an example of how to compile a Swarm application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf /path/to/downloaded/swarmapps-2.3.0.tar.gz&lt;br /&gt;
cd swarmapps-2.3.0/objc/heatbugs&lt;br /&gt;
&lt;br /&gt;
make&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''VERY IMPORTANT NOTE: MinGW produces two executables called &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt;---one in the &amp;lt;tt&amp;gt;heatbugs&amp;lt;/tt&amp;gt; folder and another in the &amp;lt;tt&amp;gt;heatbugs/.libs&amp;lt;/tt&amp;gt; folder. You should ignore the executable in the top-level folder, &amp;lt;tt&amp;gt;heatbugs/heatbugs.exe&amp;lt;/tt&amp;gt;, as it is merely a compiled wrapper script that executes &amp;lt;tt&amp;gt;heatbugs/.libs/heatbugs.exe&amp;lt;/tt&amp;gt;. When distributing compiled models, only use binaries from the &amp;lt;tt&amp;gt;.libs&amp;lt;/tt&amp;gt; folder.'''&lt;br /&gt;
&lt;br /&gt;
The resulting executable, &amp;lt;tt&amp;gt;.libs/heatbugs.exe&amp;lt;/tt&amp;gt; may be executing by following the steps described above at ''Using Swarm Models Compiled with MinGW''. These steps must include setting the Windows Path to include &amp;lt;tt&amp;gt;C:\swarm\bin&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Distributing a Swarm Model for Windows Users =&lt;br /&gt;
&lt;br /&gt;
A major benefit of the MinGW version of Swarm is that models can be distributed for people to use without installing Swarm. A simple way to do this, after the model has been compiled and tested using methods in the previous section, is to create a ZIP archive that contains all the files to run the model.&lt;br /&gt;
&lt;br /&gt;
* Create a directory tree that includes the Swarm binary files. For example, create C:\MySwarmModel and add the Swarm binaries (as described [[Swarm_and_MinGW#Using_Swarm_Models_Compiled_with_MinGW|above]]) to it as a subdirectory tree.&lt;br /&gt;
* Create another subdirectory that includes just the compiled model.&lt;br /&gt;
* Create a third subdirectory that includes any input files that the model needs and a batch file that sets the path and executes the model. &lt;br /&gt;
* Zip the whole tree up for distribution.&lt;br /&gt;
&lt;br /&gt;
The directory tree in the zip file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\MySwarmModel\swarm&lt;br /&gt;
                      \bin&lt;br /&gt;
                      \etc&lt;br /&gt;
                      \include&lt;br /&gt;
                      \lib&lt;br /&gt;
                      \man&lt;br /&gt;
                      \share&lt;br /&gt;
               \executable\MySwarmModel.exe&lt;br /&gt;
               \Runfiles\MySwarmModel.bat (and any input files)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the file &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt; contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set SWARMHOME=C:\MySwarmModel\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
C:\MySwarmModel\executable\MySwarmModel.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then users can run the model just by double-clicking on &amp;lt;tt&amp;gt;MySwarmModel.bat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Building Swarm Using MinGW =&lt;br /&gt;
&lt;br /&gt;
This tutorial provides directions and code for compiling your own Swarm libraries for Windows. It is a bit advanced---some familiarity with compiling software from source in a Linux environment and knowledge of the UNIX command line is assumed.&lt;br /&gt;
&lt;br /&gt;
== Install Required Tools ==&lt;br /&gt;
&lt;br /&gt;
The first step is to download and install tools required for compiling Swarm. These links provide directions:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|MinGW]]&lt;br /&gt;
* [[#Emacs|Emacs]]&lt;br /&gt;
* [[#GPerf|GPerf]]&lt;br /&gt;
&lt;br /&gt;
== Build Support Libraries ==&lt;br /&gt;
&lt;br /&gt;
The next steps are to build and install the libraries that Swarm depends on. A ZIP archive containing all the source code required can be found at:&lt;br /&gt;
&lt;br /&gt;
[http://ftp.swarm.org/pub/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip http://ftp.swarm.org/pub/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip]&lt;br /&gt;
&lt;br /&gt;
This archive contains two subdirectories:&lt;br /&gt;
&lt;br /&gt;
* sources: This folder contains the source code for each component.&lt;br /&gt;
* patches: This folder contains patchfiles that modfy source code so that MinGW can compile it.&lt;br /&gt;
&lt;br /&gt;
After downloading and extracting the source code archive, open up a MinGW shell and run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
mkdir build&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following steps will all assume your MinGW shell is operating out of the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory. All compiled software will be installed to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt; (The Windows Explorer will see the folder appear at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== ZLib ===&lt;br /&gt;
&lt;br /&gt;
ZLib will be the first library to be built as it is a common dependency for many of the other software components. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following to build Zlib:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/zlib-1.2.5.tar.gz&lt;br /&gt;
cd zlib-1.2.5&lt;br /&gt;
make -f win32/Makefile.gcc&amp;lt;/pre&amp;gt;&lt;br /&gt;
And then the following commands to install ZLib to &amp;lt;tt&amp;gt;/c/swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -p /c/swarm/bin&lt;br /&gt;
mkdir -p /c/swarm/include&lt;br /&gt;
mkdir -p /c/swarm/lib&lt;br /&gt;
&lt;br /&gt;
cp zlib1.dll /c/swarm/bin/&lt;br /&gt;
cp zconf.h zlib.h /c/swarm/include/&lt;br /&gt;
mv libzdll.a libz.dll.a&lt;br /&gt;
cp *.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LibPNG ===&lt;br /&gt;
&lt;br /&gt;
LibPNG will be built next as its only dependency is ZLib. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following steps to build and install LibPNG:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/libpng-1.5.4.tar.bz2&lt;br /&gt;
cd libpng-1.5.4&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm --with-zlib-prefix=/c/swarm&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XPM ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, the XPM library can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/xpm-nox-4.2.0.tar.bz2&lt;br /&gt;
cd xpm-nox-4.2.0&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/xpm-nox-4.2.0-mingw-tcl.patch&lt;br /&gt;
&lt;br /&gt;
make CC=gcc&lt;br /&gt;
make install prefix=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
The patchfile is inherited from the SUSE builds of XPM for MinGW and adds Makefiles and other critical components.&lt;br /&gt;
&lt;br /&gt;
One major modification has been made to the SUSE patchfile---&amp;lt;tt&amp;gt;tcl.h&amp;lt;/tt&amp;gt; is included in &amp;lt;tt&amp;gt;xpm.h&amp;lt;/tt&amp;gt;. This is required in order to use XPM while Tk is installed. Conversely, this means that this build of XPM cannot be used without having Tk installed.&lt;br /&gt;
&lt;br /&gt;
=== LibFFI ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, LibFFI can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/libffi-3.0.9.tar.gz&lt;br /&gt;
cd libffi-3.0.9&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
The LibFFI headers get installed in a weird place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mv /c/swarm/lib/libffi-3.0.9/include/*.h /c/swarm/include&lt;br /&gt;
rm -rf /c/swarm/lib/libffi-3.0.9&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tcl ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tcl can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tcl8.4.19-src.tar.gz&lt;br /&gt;
cd tcl8.4.19&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/tcl-8.4.19-fix-lvalues.patch&lt;br /&gt;
cd win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
At two places in the TCL source code, an assignment is made while simultaneously performing a typecast. The typecast and the assignment had to be split into separate operations in order to be acceptable to the MinGW compilers.&lt;br /&gt;
&lt;br /&gt;
=== Tk ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, Tk can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tk8.4.19-src.tar.gz&lt;br /&gt;
cd tk8.4.19/win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BLT ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, BLT can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/BLT2.4z.tar.gz&lt;br /&gt;
cd blt2.4z&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm --without-x&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDF5 (Optional) ===&lt;br /&gt;
&lt;br /&gt;
Getting HDF5 to work with MinGW is a little tricky. It is an optional dependency, so if support for reading and writing &amp;lt;tt&amp;gt;.hdf&amp;lt;/tt&amp;gt; files is not needed this section can be skipped.&lt;br /&gt;
&lt;br /&gt;
As of version 1.8.7, HDF5 currently does not compile under MinGW. So, we must wrap pre-compiled binaries for use with MinGW. In order to wrap the binaries, we will need an additional tool called &amp;lt;tt&amp;gt;pexports&amp;lt;/tt&amp;gt;. This can be installed using &amp;lt;tt&amp;gt;mingw-get&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mingw-utils&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download 32-bit Windows binaries from the HDF website compiled for use with the Visual Studio compilers (these files have &amp;amp;amp;quot;VS&amp;amp;amp;quot; listed under the ''Compilers'' section). After extracting the archive, the HDF5 libraries can be wrapped for use with MinGW by executing the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd path/to/where/HDF5/was/extracted&lt;br /&gt;
&lt;br /&gt;
for dll in `ls dll/*dll`; do&lt;br /&gt;
  def_file=`basename $dll .dll`.def&lt;br /&gt;
  lib_file=lib`basename $dll dll.dll`.a&lt;br /&gt;
  pexports $dll &amp;amp;amp;gt; $def_file&lt;br /&gt;
  dlltool -d $def_file -l lib/$lib_file&lt;br /&gt;
done&amp;lt;/pre&amp;gt;&lt;br /&gt;
Next, move the libraries and header files needed to use HDF5 from C into &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp dll/hdf5dll.dll dll/szip.dll /c/swarm/bin&lt;br /&gt;
cp include/* /c/swarm/include&lt;br /&gt;
cp lib/libhdf5.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, a patch must be applied to the HDF header file &amp;lt;tt&amp;gt;H5public.h&amp;lt;/tt&amp;gt; so that it doesn't define &amp;lt;tt&amp;gt;ssize_t&amp;lt;/tt&amp;gt;---a constant already defined by MinGW. The required patch is contained in the Swarm MinGW source archive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
patch -p1 -d /c/swarm &amp;amp;amp;lt; patches/hdf5-1.8.7-mingw.patch&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Swarm ==&lt;br /&gt;
&lt;br /&gt;
Finally, the Swarm libraries themselves can be built. From the &amp;lt;tt&amp;gt;build&amp;lt;/tt&amp;gt; directory, execute the following&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/swarm-2.4.1.tar.gz&lt;br /&gt;
cd swarm-2.4.1&lt;br /&gt;
patch -p1 ../../patches/swarm-2.4.1-mingw.patch&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm \&lt;br /&gt;
  --with-zlibdir=/c/swarm \&lt;br /&gt;
  --with-pngdir=/c/swarm \&lt;br /&gt;
  --with-xpmdir=/c/swarm \&lt;br /&gt;
  --with-ffidir=/c/swarm \&lt;br /&gt;
  --with-tcl=/c/swarm/lib \&lt;br /&gt;
  --with-tk=/c/swarm/lib \&lt;br /&gt;
  --with-bltdir=/c/swarm&lt;br /&gt;
&lt;br /&gt;
cd avcall&lt;br /&gt;
gcc -S avcall-i386.c&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you wrapped HDF5 up for use with MinGW, add &amp;lt;tt&amp;gt;--with-hdf5dir=/c/swarm&amp;lt;/tt&amp;gt; to the list of arguments passed to &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-mingw.patch&amp;lt;/tt&amp;gt; modifies the Swarm source code in the following ways:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt&amp;gt;gettimeofday&amp;lt;/tt&amp;gt; is no longer defined in the Swarm sources as MinGW includes this function in its standard library.&lt;br /&gt;
* Swarm GUI functions are updated to be compatible with LibPNG 1.5.&lt;br /&gt;
* The Swarm &amp;lt;tt&amp;gt;configure&amp;lt;/tt&amp;gt; script defines &amp;lt;tt&amp;gt;DATADIR&amp;lt;/tt&amp;gt; as a preprocessor macro---this conflicts with variables in the GCC Objective-C library. &amp;lt;tt&amp;gt;DATDIR&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;undef&amp;lt;/tt&amp;gt;ed in critical parts of the source code.&lt;br /&gt;
* The &amp;lt;tt&amp;gt;sleep&amp;lt;/tt&amp;gt; function is aliased to &amp;lt;tt&amp;gt;usleep&amp;lt;/tt&amp;gt;---which is the name of the MinGW implementation.&lt;br /&gt;
* The way in which Makefiles invoke &amp;lt;tt&amp;gt;gperf&amp;lt;/tt&amp;gt; is amended so that it actually produces output.&lt;br /&gt;
* NULL checks are added to `zstrdup` in src/defobj/internal.m. Some functions in the Swarm library may attempt to call `zstrdup` on a NULL pointer. (This happens if the SWARMHOME environment variable is not set.) Failing to check for this condition can lead to segfaults. `zstrdup` now returns NULL if passed a NULL string or if `alloc` fails to allocate memory for a duplicate.&lt;br /&gt;
&lt;br /&gt;
Full details are contained in the patchfile.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
&lt;br /&gt;
== MinGW ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.mingw.org&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/mingw/files&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 20110530&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org MinGW] is a set of software that aims to provide an environment where software developed on UNIX-like systems can be easily compiled for Windows. Since Swarm is primarily developed on Linux (a UNIX clone), MinGW can ease the task of creating Swarm models that run on Windows.&lt;br /&gt;
&lt;br /&gt;
MinGW is similar to the [http://www.cygwin.org Cygwin] project. The major difference is that MinGW produces executables that depend only on native Windows libraries while Cygwin executables require special compatibility libraries that are part of the Cygwin distribution.&lt;br /&gt;
&lt;br /&gt;
=== Installing MinGW ===&lt;br /&gt;
&lt;br /&gt;
MinGW can be installed by downloading the &amp;amp;amp;quot;Automated MinGW Installer&amp;amp;amp;quot;, which usually has a name like &amp;lt;tt&amp;gt;mingw-get-inst-&amp;amp;amp;lt;date&amp;amp;amp;gt;.exe&amp;lt;/tt&amp;gt; where &amp;lt;tt&amp;gt;&amp;amp;amp;lt;date&amp;amp;amp;gt;&amp;lt;/tt&amp;gt; is the datestamp for when the installer was packaged. Running this executable will start the installation process. The installer lets you select which optional components to install; make sure all boxes are checked so you '''install all components'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Setup.png|frame|none|alt=Install all available MinGW components]]&lt;br /&gt;
&lt;br /&gt;
The installer downloads all components from the internet. This will take a while, so have a cup of coffee or walk the dog.&lt;br /&gt;
&lt;br /&gt;
See the following section about also installing an optional, more-functional shell window for MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Using MinGW ===&lt;br /&gt;
&lt;br /&gt;
The MinGW compilers are accessible through the &amp;amp;amp;quot;MinGW Shell&amp;amp;amp;quot; which should be located under the MinGW folder in the Start Menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Shell.png|frame|none|alt=Location of MinGW Shell]]&lt;br /&gt;
&lt;br /&gt;
or by running &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; (if MinGW was installed to its default location).&lt;br /&gt;
&lt;br /&gt;
By default the MinGW shell executes inside of a Windows &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt; terminal. There are a couple major drawbacks to this:&lt;br /&gt;
&lt;br /&gt;
* You cannot resize the window to full-screen.&lt;br /&gt;
* The shell provides limited history scrollback.&lt;br /&gt;
&lt;br /&gt;
MinGW provides a couple of alternative terminals for the MinGW shell which do not have these drawbacks; one of which is called MinTTY. To install MinTTY execute the following in a MinGW shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mintty&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then the &amp;lt;tt&amp;gt;mintty&amp;lt;/tt&amp;gt; command can be used to launch a MinTTY terminal. The MinGW Shell can also be set to launch MinTTY by default by editing the file &amp;lt;tt&amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;lt;/tt&amp;gt; and changing the following line (approximately line 58):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=sh.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=mintty.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A Note About Paths ===&lt;br /&gt;
&lt;br /&gt;
The MinGW Shell emulates a UNIX &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell and thus uses UNIX-style paths, &amp;lt;tt&amp;gt;/path/to/file&amp;lt;/tt&amp;gt;, instead of Windows-style paths, &amp;lt;tt&amp;gt;C:\path\to\file&amp;lt;/tt&amp;gt;. One peculiarity of this process is that the shell must deal with the fact that Windows filesystems have multiple roots (&amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt;, etc.) while a UNIX filesystem only has one root called &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;. The way this is reconciled by the &amp;lt;tt&amp;gt;bash&amp;lt;/tt&amp;gt; shell provided with MinGW is that &amp;lt;tt&amp;gt;/c&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;C:&amp;lt;/tt&amp;gt; drive, &amp;lt;tt&amp;gt;/d&amp;lt;/tt&amp;gt; refers to the root of the &amp;lt;tt&amp;gt;D:&amp;lt;/tt&amp;gt; drive and so on and so forth.&lt;br /&gt;
&lt;br /&gt;
The root of the filesystem itself, &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt;, also has some caveats. &amp;lt;tt&amp;gt;/&amp;lt;/tt&amp;gt; refers to the &amp;lt;tt&amp;gt;mysy&amp;lt;/tt&amp;gt; folder, &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0&amp;lt;/tt&amp;gt; in a default installation. &amp;lt;tt&amp;gt;/usr&amp;lt;/tt&amp;gt; also refers to the same location. Thus, &amp;lt;tt&amp;gt;/usr/local&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;/local&amp;lt;/tt&amp;gt; both refer to &amp;lt;tt&amp;gt;C:/MinGW/mysys/1.0/local&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== A Note About MinGW-64 ===&lt;br /&gt;
&lt;br /&gt;
Currently Swarm has been developed and tested against the 32-bit version of MinGW. Hence Swarm models produced this way should run in any version of Windows.&lt;br /&gt;
&lt;br /&gt;
The [MinGW-w64][mingw_65] project produces 64-bit MinGW compilers that can produce 64-bit executables that will only run on 64-bit versions of Windows. These executables benefit from:&lt;br /&gt;
&lt;br /&gt;
* Access to more memory. A 32-bit executable will only be able to allocate ~3 GB of RAM---even if the system has more RAM available.&lt;br /&gt;
* Possibly quicker execution speeds due to matching the native architecture of the operating system---however this depends on the types of tasks that the program executes. It has been reported that 64 bit Swarm executables run quicker than 32 bit Swarm executables on Linux.&lt;br /&gt;
&lt;br /&gt;
Currently, no attempt has been made to compile Swarm 2.4.1 with the 64 bit MinGW compilers. If a successful attempt is made, please report it on the [http://www.swarm.org/mailman/listinfo/support Swarm mailing list].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Emacs ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/emacs&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 23.3&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://ftp.gnu.org/gnu/emacs/windows&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GNU Emacs is a text editor that is used by many programmers to edit code. However, Emacs can also be scripted to perform a variety of complicated transformations on text files. The scripts that build the Swarm libraries use Emacs to automate the process of generating some source files. Thus Emacs has to be installed in order to build Swarm from source.&lt;br /&gt;
&lt;br /&gt;
=== Installing Emacs ===&lt;br /&gt;
&lt;br /&gt;
Install Emacs by downloading one of the &amp;lt;tt&amp;gt;emacs-&amp;amp;amp;lt;version&lt;br /&gt;
number&amp;amp;amp;gt;-bin-i386.zip&amp;lt;/tt&amp;gt; files from the download area. Don't use any of the&lt;br /&gt;
files containing &amp;lt;tt&amp;gt;barebin&amp;lt;/tt&amp;gt;. After extracting the ZIP archive there will&lt;br /&gt;
be an Emacs folder containing a subfolder called &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt;. Add this folder&lt;br /&gt;
to your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. [[#RapidEE|RapidEE]] can help edit the&lt;br /&gt;
&amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GPerf ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/gperf/&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/gnuwin32/files/gperf&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 3.0.1&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GPerf is a program that produces C code containing hash functions. The scripts&lt;br /&gt;
that build the Swarm libraries use GPerf to generate some source code files.&lt;br /&gt;
Download &amp;lt;tt&amp;gt;gperf.exe&amp;lt;/tt&amp;gt; from the GnuWin32 site on Sourceforge and place it&lt;br /&gt;
somewhere on your Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. Again, [[#RapidEE|RapidEE]] can help set the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RapidEE ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.rapidee.com&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 5.0&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.rapidee.com/en/license Freeware]&lt;br /&gt;
&lt;br /&gt;
The Rapid Environment Editor (RapidEE) is a spiffy tool that makes it easy to inspect and alter the value of Windows environment variables, such as the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. RapidEE may be used to edit &amp;amp;amp;quot;System Variables&amp;amp;amp;quot; which will affect all user accounts or &amp;amp;amp;quot;User Variables&amp;amp;amp;quot; which will affect just the current account. Administrative privileges may be required to edit the System Variables.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_1.png|frame|none|alt=The different variables RapidEE can edit]]&lt;br /&gt;
&lt;br /&gt;
Right-clicking on the &amp;lt;tt&amp;gt;Path&amp;lt;/tt&amp;gt; variable in the System Variables or User Variables will bring up a menu that presents the option to &amp;amp;amp;quot;Add value&amp;amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_2.png|frame|none|alt=Adding a new value to the PATH]]&lt;br /&gt;
&lt;br /&gt;
Once the new entry has been added, RapidEE must be told to save the changes. Command line shells, such as &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;, must be restarted in order for them to notice the changes.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_3.png|frame|none|alt=Adding and saving a value]]&lt;br /&gt;
&lt;br /&gt;
== Depends ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.dependencywalker.com/&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 2.2&lt;br /&gt;
&lt;br /&gt;
'''License:''' Freeware&lt;br /&gt;
&lt;br /&gt;
Depends is a usefull utility that scans Windows executables and reports information concerning the Dynamic-link Libraries (DLLs) that those executables require in order to run.&lt;br /&gt;
&lt;br /&gt;
= Software Used to Compile Swarm 2.4.1 =&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!  Name&lt;br /&gt;
!  Verson Used&lt;br /&gt;
!  License&lt;br /&gt;
!  Homepage&lt;br /&gt;
!  Download Area&lt;br /&gt;
|-&lt;br /&gt;
|  ZLib&lt;br /&gt;
|  1.2.5&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG License]&lt;br /&gt;
|  [http://www.zlib.net http://www.zlib.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibFFI&lt;br /&gt;
|  3.0.9&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  [http://sourceware.org/libffi http://sourceware.org/libffi]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibPNG&lt;br /&gt;
|  1.5.4&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG]&lt;br /&gt;
|  [http://www.libpng.org/pub/png/libpng.html http://www.libpng.org/pub/png/libpng.html]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  XPM-NoX&lt;br /&gt;
|  4.2.0&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  unknown&lt;br /&gt;
|  [http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32 http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32]&lt;br /&gt;
|-&lt;br /&gt;
|  Tcl&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Tk&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  BLT&lt;br /&gt;
|  2.4z&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://blt.sourceforge.net http://blt.sourceforge.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  HDF5&lt;br /&gt;
|  1.8.7&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://www.hdfgroup.org/HDF5 http://www.hdfgroup.org/HDF5]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Swarm&lt;br /&gt;
|  2.4.1&lt;br /&gt;
|  [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
|  [http://www.swarm.org http://www.swarm.org]&lt;br /&gt;
|  [http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2158</id>
		<title>Swarm and MinGW</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2158"/>
				<updated>2015-12-02T23:07:32Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This documentation provides information on how to use Swarm on Windows with [http://www.mingw.org MinGW] compilers. The following topics will be covered:&lt;br /&gt;
&lt;br /&gt;
* How to run a Swam model compiled with MinGW on Windows: Once you produce a Swarm model using MinGW (or someone gives one to you), how do you run it on other machines without installing Swarm there?&lt;br /&gt;
* How to use MinGW to compile your own Swarm models, either during model development or so you can distribute working models to others. This requires installing MinGW and our binary Swarm libraries.&lt;br /&gt;
* How to package a model compiled with MinGW so it can be installed and run by itself on Windows machines.&lt;br /&gt;
* How to use MinGW to compile the Swarm libraries, in case you want to build your own Swarm binaries.&lt;br /&gt;
&lt;br /&gt;
Each topic is more difficult than the one before it. However the topics are independent in that it is not necessary to know how to compile the Swarm library in order to run a pre-compiled Swarm model or compile your own model against a pre-compiled version of Swarm.&lt;br /&gt;
&lt;br /&gt;
= Using Swarm Models Compiled with MinGW =&lt;br /&gt;
&lt;br /&gt;
A model that has been compiled using MinGW can be installed and run from a Windows computer without installing MinGW or Swarm. An example code is this build of Heatbugs:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe]&lt;br /&gt;
&lt;br /&gt;
However, running a Swarm model requires some support programs and libraries. These are available as&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-win32.zip&amp;lt;/tt&amp;gt;, available here:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip]&lt;br /&gt;
&lt;br /&gt;
Unzipping that file will create a folder called &amp;lt;tt&amp;gt;swarm&amp;lt;/tt&amp;gt; which should be moved somewhere that is easy to remember. The rest of this tutorial will assume this Swarm folder has been placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before a Swarm model can be run, the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder must be added to the Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; so that Heatbugs can find necessary libraries when it runs. The &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder can be ''temporarily'' added to the path by executing the following in the Windows command line (the command line is accessed using the program &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;path=%PATH%;C:\swarm\bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, it is possible to have conflicts if other versions of libraries used by Swarm, such as HDF5, are already installed and in your path. And some Swarm programs require that the environment variable SWARMHOME be defined, which will typically not be true. These problems can be avoided by using the following statements instead of the above path command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
You can alternatively add the Swarm folder to your &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; permanently by editing the Windows PATH environment variable. A tool like [[#RapidEE|RapidEE]] makes doing so easy, or you can use use Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; to the PATH system variable.&lt;br /&gt;
&lt;br /&gt;
Once the path has been set to include the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder, Swarm models can be started through the Windows command line, or by double-clicking on them from the Windows Explorer.  &lt;br /&gt;
&lt;br /&gt;
The Heatbugs model can now be run by changing the directory of the command line to the folder holding &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; and then executing the program. For example, if &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is located in &amp;lt;tt&amp;gt;C:\Users\example_user\Downloads&amp;lt;/tt&amp;gt;, then the model may be run as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd C:\Users\example_user\Downloads&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(or you can just double-click on &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; from Windows Explorer, which temporarily opens a Windows command terminal while the model runs.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Running_Heatbugs.png|frame|none|alt=Running the Heatbugs model]]&lt;br /&gt;
&lt;br /&gt;
You can also create a simple Windows batch file that sets SWARMHOME and the path and then executes the model. Create a file called, for example &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; in the same directory where &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is, containing these lines: &lt;br /&gt;
&amp;lt;pre&amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
heatbugs.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, just double-clicking on &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; will start the model.&lt;br /&gt;
&lt;br /&gt;
If you try this and get an error that some .dll file is not found, then the problem is likely that the path is not set correctly to include the swarm\bin folder. If instead the program crashes without an error statement, then the problem is more likely that SWARMHOME needs to be set.&lt;br /&gt;
&lt;br /&gt;
= Installing Swarm and MinGW to compile models =&lt;br /&gt;
&lt;br /&gt;
To compile Swarm models from source using MinGW, the following simple steps need to be taken to set up the build environment:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|Install MinGW using instructions here]]. Currently only 32-bit MinGW can be used with Swarm. Install all components of MinGW.&lt;br /&gt;
* Download compiled Swarm binaries, archived as [http://ftp.swarm.org/pub/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip swarm-2.4.1-win32.zip]. Unzip the archive and place the extracted folder at &amp;amp;lt;tt&amp;amp;gt;C:\swarm&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
The archived Swarm binaries '''MUST''' be placed at &amp;amp;lt;tt&amp;amp;gt;C:\swarm&amp;amp;lt;/tt&amp;amp;gt; to successfully compile Swarm models. This is because some paths had to be hard-coded by &amp;amp;lt;tt&amp;amp;gt;libtool&amp;amp;lt;/tt&amp;amp;gt; during the creation of the binaries.&lt;br /&gt;
&lt;br /&gt;
The final step before you can compile a Swarm model is to set the &amp;amp;lt;tt&amp;amp;gt;SWARMHOME&amp;amp;lt;/tt&amp;amp;gt; environment variable so that the &amp;amp;quot;make&amp;amp;quot; program knows where to find the Swarm libraries when compiling your code. There are several ways to do this.&lt;br /&gt;
*You can temporarily set SWARMHOME by entering this command in the MinGW shell: &amp;lt;pre&amp;gt;export SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*You can edit your Makefile so it starts with: &amp;lt;pre&amp;gt;SWARMHOME=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Set SWARMHOME permanently as a Windows environment variable, either by using [[#RapidEE|RapidEE]] or Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add a new (User or System) variable called SWARMHOME with the value &amp;amp;lt;tt&amp;amp;gt;/c/swarm&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After MinGW has been installed and the Swarm binaries have been downloaded, Swarm models may be compiled using the MinGW shell. Start up the program MinGW Shell, cd to the directory containing your code and Makefile, and enter the command &amp;amp;quot;Make&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
An archive of official Swarm example programs can be downloaded from:&lt;br /&gt;
&lt;br /&gt;
[http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
&lt;br /&gt;
We will use the &amp;amp;amp;quot;Heatbugs&amp;amp;amp;quot; model as an example of how to compile a Swarm application:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf /path/to/downloaded/swarmapps-2.3.0.tar.gz&lt;br /&gt;
cd swarmapps-2.3.0/objc/heatbugs&lt;br /&gt;
&lt;br /&gt;
make&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''VERY IMPORTANT NOTE: MinGW produces two executables called &amp;amp;lt;tt&amp;amp;gt;heatbugs.exe&amp;amp;lt;/tt&amp;amp;gt;---one in the &amp;amp;lt;tt&amp;amp;gt;heatbugs&amp;amp;lt;/tt&amp;amp;gt; folder and another in the &amp;amp;lt;tt&amp;amp;gt;heatbugs/.libs&amp;amp;lt;/tt&amp;amp;gt; folder. You should ignore the executable in the top-level folder, &amp;amp;lt;tt&amp;amp;gt;heatbugs/heatbugs.exe&amp;amp;lt;/tt&amp;amp;gt;, as it is merely a compiled wrapper script that executes &amp;amp;lt;tt&amp;amp;gt;heatbugs/.libs/heatbugs.exe&amp;amp;lt;/tt&amp;amp;gt;. When distributing compiled models, only use binaries from the &amp;amp;lt;tt&amp;amp;gt;.libs&amp;amp;lt;/tt&amp;amp;gt; folder.'''&lt;br /&gt;
&lt;br /&gt;
The resulting executable, &amp;amp;lt;tt&amp;amp;gt;.libs/heatbugs.exe&amp;amp;lt;/tt&amp;amp;gt; may be executing by following the steps described above at ''Using Swarm Models Compiled with MinGW''. These steps must include setting the Windows Path to include &amp;amp;lt;tt&amp;amp;gt;C:\swarm\bin&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Distributing a Swarm Model for Windows Users =&lt;br /&gt;
&lt;br /&gt;
A major benefit of the MinGW version of Swarm is that models can be distributed for people to use without installing Swarm. A simple way to do this, after the model has been compiled and tested using methods in the previous section, is to create a ZIP archive that contains all the files to run the model.&lt;br /&gt;
&lt;br /&gt;
* Create a directory tree that includes the Swarm binary files. For example, create C:\MySwarmModel and add the Swarm binaries (as described [[Swarm_and_MinGW#Using_Swarm_Models_Compiled_with_MinGW|above]]) to it as a subdirectory tree.&lt;br /&gt;
* Create another subdirectory that includes just the compiled model.&lt;br /&gt;
* Create a third subdirectory that includes any input files that the model needs and a batch file that sets the path and executes the model. &lt;br /&gt;
* Zip the whole tree up for distribution.&lt;br /&gt;
&lt;br /&gt;
The directory tree in the zip file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
C:\MySwarmModel\swarm&lt;br /&gt;
                      \bin&lt;br /&gt;
                      \etc&lt;br /&gt;
                      \include&lt;br /&gt;
                      \lib&lt;br /&gt;
                      \man&lt;br /&gt;
                      \share&lt;br /&gt;
               \executable\MySwarmModel.exe&lt;br /&gt;
               \Runfiles\MySwarmModel.bat (and any input files)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the file &amp;amp;lt;tt&amp;amp;gt;MySwarmModel.bat&amp;amp;lt;/tt&amp;amp;gt; contains:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
set SWARMHOME=C:\MySwarmModel\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
C:\MySwarmModel\executable\MySwarmModel.exe&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then users can run the model just by double-clicking on &amp;amp;lt;tt&amp;amp;gt;MySwarmModel.bat&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Building Swarm Using MinGW =&lt;br /&gt;
&lt;br /&gt;
This tutorial provides directions and code for compiling your own Swarm libraries for Windows. It is a bit advanced---some familiarity with compiling software from source in a Linux environment and knowledge of the UNIX command line is assumed.&lt;br /&gt;
&lt;br /&gt;
== Install Required Tools ==&lt;br /&gt;
&lt;br /&gt;
The first step is to download and install tools required for compiling Swarm. These links provide directions:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|MinGW]]&lt;br /&gt;
* [[#Emacs|Emacs]]&lt;br /&gt;
* [[#GPerf|GPerf]]&lt;br /&gt;
&lt;br /&gt;
== Build Support Libraries ==&lt;br /&gt;
&lt;br /&gt;
The next steps are to build and install the libraries that Swarm depends on. A ZIP archive containing all the source code required can be found at:&lt;br /&gt;
&lt;br /&gt;
[http://ftp.swarm.org/pub/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip http://ftp.swarm.org/pub/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip]&lt;br /&gt;
&lt;br /&gt;
This archive contains two subdirectories:&lt;br /&gt;
&lt;br /&gt;
* sources: This folder contains the source code for each component.&lt;br /&gt;
* patches: This folder contains patchfiles that modfy source code so that MinGW can compile it.&lt;br /&gt;
&lt;br /&gt;
After downloading and extracting the source code archive, open up a MinGW shell and run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
mkdir build&amp;lt;/pre&amp;gt;&lt;br /&gt;
The following steps will all assume your MinGW shell is operating out of the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory. All compiled software will be installed to &amp;amp;lt;tt&amp;amp;gt;/c/swarm&amp;amp;lt;/tt&amp;amp;gt; (The Windows Explorer will see the folder appear at &amp;amp;lt;tt&amp;amp;gt;C:\swarm&amp;amp;lt;/tt&amp;amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== ZLib ===&lt;br /&gt;
&lt;br /&gt;
ZLib will be the first library to be built as it is a common dependency for many of the other software components. From the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, execute the following to build Zlib:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/zlib-1.2.5.tar.gz&lt;br /&gt;
cd zlib-1.2.5&lt;br /&gt;
make -f win32/Makefile.gcc&amp;lt;/pre&amp;gt;&lt;br /&gt;
And then the following commands to install ZLib to &amp;amp;lt;tt&amp;amp;gt;/c/swarm&amp;amp;lt;/tt&amp;amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir -p /c/swarm/bin&lt;br /&gt;
mkdir -p /c/swarm/include&lt;br /&gt;
mkdir -p /c/swarm/lib&lt;br /&gt;
&lt;br /&gt;
cp zlib1.dll /c/swarm/bin/&lt;br /&gt;
cp zconf.h zlib.h /c/swarm/include/&lt;br /&gt;
mv libzdll.a libz.dll.a&lt;br /&gt;
cp *.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LibPNG ===&lt;br /&gt;
&lt;br /&gt;
LibPNG will be built next as its only dependency is ZLib. From the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, execute the following steps to build and install LibPNG:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/libpng-1.5.4.tar.bz2&lt;br /&gt;
cd libpng-1.5.4&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm --with-zlib-prefix=/c/swarm&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XPM ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, the XPM library can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xjf ../sources/xpm-nox-4.2.0.tar.bz2&lt;br /&gt;
cd xpm-nox-4.2.0&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/xpm-nox-4.2.0-mingw-tcl.patch&lt;br /&gt;
&lt;br /&gt;
make CC=gcc&lt;br /&gt;
make install prefix=/c/swarm&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
The patchfile is inherited from the SUSE builds of XPM for MinGW and adds Makefiles and other critical components.&lt;br /&gt;
&lt;br /&gt;
One major modification has been made to the SUSE patchfile---&amp;amp;lt;tt&amp;amp;gt;tcl.h&amp;amp;lt;/tt&amp;amp;gt; is included in &amp;amp;lt;tt&amp;amp;gt;xpm.h&amp;amp;lt;/tt&amp;amp;gt;. This is required in order to use XPM while Tk is installed. Conversely, this means that this build of XPM cannot be used without having Tk installed.&lt;br /&gt;
&lt;br /&gt;
=== LibFFI ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, LibFFI can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/libffi-3.0.9.tar.gz&lt;br /&gt;
cd libffi-3.0.9&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
The LibFFI headers get installed in a weird place.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mv /c/swarm/lib/libffi-3.0.9/include/*.h /c/swarm/include&lt;br /&gt;
rm -rf /c/swarm/lib/libffi-3.0.9&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tcl ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, Tcl can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tcl8.4.19-src.tar.gz&lt;br /&gt;
cd tcl8.4.19&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/tcl-8.4.19-fix-lvalues.patch&lt;br /&gt;
cd win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
At two places in the TCL source code, an assignment is made while simultaneously performing a typecast. The typecast and the assignment had to be split into separate operations in order to be acceptable to the MinGW compilers.&lt;br /&gt;
&lt;br /&gt;
=== Tk ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, Tk can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/tk8.4.19-src.tar.gz&lt;br /&gt;
cd tk8.4.19/win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BLT ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, BLT can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/BLT2.4z.tar.gz&lt;br /&gt;
cd blt2.4z&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm --without-x&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDF5 (Optional) ===&lt;br /&gt;
&lt;br /&gt;
Getting HDF5 to work with MinGW is a little tricky. It is an optional dependency, so if support for reading and writing &amp;amp;lt;tt&amp;amp;gt;.hdf&amp;amp;lt;/tt&amp;amp;gt; files is not needed this section can be skipped.&lt;br /&gt;
&lt;br /&gt;
As of version 1.8.7, HDF5 currently does not compile under MinGW. So, we must wrap pre-compiled binaries for use with MinGW. In order to wrap the binaries, we will need an additional tool called &amp;amp;lt;tt&amp;amp;gt;pexports&amp;amp;lt;/tt&amp;amp;gt;. This can be installed using &amp;amp;lt;tt&amp;amp;gt;mingw-get&amp;amp;lt;/tt&amp;amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mingw-utils&amp;lt;/pre&amp;gt;&lt;br /&gt;
Download 32-bit Windows binaries from the HDF website compiled for use with the Visual Studio compilers (these files have &amp;amp;amp;quot;VS&amp;amp;amp;quot; listed under the ''Compilers'' section). After extracting the archive, the HDF5 libraries can be wrapped for use with MinGW by executing the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd path/to/where/HDF5/was/extracted&lt;br /&gt;
&lt;br /&gt;
for dll in `ls dll/*dll`; do&lt;br /&gt;
  def_file=`basename $dll .dll`.def&lt;br /&gt;
  lib_file=lib`basename $dll dll.dll`.a&lt;br /&gt;
  pexports $dll &amp;amp;amp;gt; $def_file&lt;br /&gt;
  dlltool -d $def_file -l lib/$lib_file&lt;br /&gt;
done&amp;lt;/pre&amp;gt;&lt;br /&gt;
Next, move the libraries and header files needed to use HDF5 from C into &amp;amp;lt;tt&amp;amp;gt;C:\swarm&amp;amp;lt;/tt&amp;amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cp dll/hdf5dll.dll dll/szip.dll /c/swarm/bin&lt;br /&gt;
cp include/* /c/swarm/include&lt;br /&gt;
cp lib/libhdf5.a /c/swarm/lib&amp;lt;/pre&amp;gt;&lt;br /&gt;
Finally, a patch must be applied to the HDF header file &amp;amp;lt;tt&amp;amp;gt;H5public.h&amp;amp;lt;/tt&amp;amp;gt; so that it doesn't define &amp;amp;lt;tt&amp;amp;gt;ssize_t&amp;amp;lt;/tt&amp;amp;gt;---a constant already defined by MinGW. The required patch is contained in the Swarm MinGW source archive:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
patch -p1 -d /c/swarm &amp;amp;amp;lt; patches/hdf5-1.8.7-mingw.patch&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Swarm ==&lt;br /&gt;
&lt;br /&gt;
Finally, the Swarm libraries themselves can be built. From the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, execute the following&lt;br /&gt;
&amp;lt;pre&amp;gt;tar xzf ../sources/swarm-2.4.1.tar.gz&lt;br /&gt;
cd swarm-2.4.1&lt;br /&gt;
patch -p1 ../../patches/swarm-2.4.1-mingw.patch&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm \&lt;br /&gt;
  --with-zlibdir=/c/swarm \&lt;br /&gt;
  --with-pngdir=/c/swarm \&lt;br /&gt;
  --with-xpmdir=/c/swarm \&lt;br /&gt;
  --with-ffidir=/c/swarm \&lt;br /&gt;
  --with-tcl=/c/swarm/lib \&lt;br /&gt;
  --with-tk=/c/swarm/lib \&lt;br /&gt;
  --with-bltdir=/c/swarm&lt;br /&gt;
&lt;br /&gt;
cd avcall&lt;br /&gt;
gcc -S avcall-i386.c&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you wrapped HDF5 up for use with MinGW, add &amp;amp;lt;tt&amp;amp;gt;--with-hdf5dir=/c/swarm&amp;amp;lt;/tt&amp;amp;gt; to the list of arguments passed to &amp;amp;lt;tt&amp;amp;gt;configure&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;tt&amp;amp;gt;swarm-2.4.1-mingw.patch&amp;amp;lt;/tt&amp;amp;gt; modifies the Swarm source code in the following ways:&lt;br /&gt;
&lt;br /&gt;
* &amp;amp;lt;tt&amp;amp;gt;gettimeofday&amp;amp;lt;/tt&amp;amp;gt; is no longer defined in the Swarm sources as MinGW includes this function in its standard library.&lt;br /&gt;
* Swarm GUI functions are updated to be compatible with LibPNG 1.5.&lt;br /&gt;
* The Swarm &amp;amp;lt;tt&amp;amp;gt;configure&amp;amp;lt;/tt&amp;amp;gt; script defines &amp;amp;lt;tt&amp;amp;gt;DATADIR&amp;amp;lt;/tt&amp;amp;gt; as a preprocessor macro---this conflicts with variables in the GCC Objective-C library. &amp;amp;lt;tt&amp;amp;gt;DATDIR&amp;amp;lt;/tt&amp;amp;gt; is &amp;amp;lt;tt&amp;amp;gt;undef&amp;amp;lt;/tt&amp;amp;gt;ed in critical parts of the source code.&lt;br /&gt;
* The &amp;amp;lt;tt&amp;amp;gt;sleep&amp;amp;lt;/tt&amp;amp;gt; function is aliased to &amp;amp;lt;tt&amp;amp;gt;usleep&amp;amp;lt;/tt&amp;amp;gt;---which is the name of the MinGW implementation.&lt;br /&gt;
* The way in which Makefiles invoke &amp;amp;lt;tt&amp;amp;gt;gperf&amp;amp;lt;/tt&amp;amp;gt; is amended so that it actually produces output.&lt;br /&gt;
* NULL checks are added to `zstrdup` in src/defobj/internal.m. Some functions in the Swarm library may attempt to call `zstrdup` on a NULL pointer. (This happens if the SWARMHOME environment variable is not set.) Failing to check for this condition can lead to segfaults. `zstrdup` now returns NULL if passed a NULL string or if `alloc` fails to allocate memory for a duplicate.&lt;br /&gt;
&lt;br /&gt;
Full details are contained in the patchfile.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
&lt;br /&gt;
== MinGW ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.mingw.org&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/mingw/files&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 20110530&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org MinGW] is a set of software that aims to provide an environment where software developed on UNIX-like systems can be easily compiled for Windows. Since Swarm is primarily developed on Linux (a UNIX clone), MinGW can ease the task of creating Swarm models that run on Windows.&lt;br /&gt;
&lt;br /&gt;
MinGW is similar to the [http://www.cygwin.org Cygwin] project. The major difference is that MinGW produces executables that depend only on native Windows libraries while Cygwin executables require special compatibility libraries that are part of the Cygwin distribution.&lt;br /&gt;
&lt;br /&gt;
=== Installing MinGW ===&lt;br /&gt;
&lt;br /&gt;
MinGW can be installed by downloading the &amp;amp;amp;quot;Automated MinGW Installer&amp;amp;amp;quot;, which usually has a name like &amp;amp;lt;tt&amp;amp;gt;mingw-get-inst-&amp;amp;amp;lt;date&amp;amp;amp;gt;.exe&amp;amp;lt;/tt&amp;amp;gt; where &amp;amp;lt;tt&amp;amp;gt;&amp;amp;amp;lt;date&amp;amp;amp;gt;&amp;amp;lt;/tt&amp;amp;gt; is the datestamp for when the installer was packaged. Running this executable will start the installation process. The installer lets you select which optional components to install; make sure all boxes are checked so you '''install all components'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Setup.png|frame|none|alt=Install all available MinGW components]]&lt;br /&gt;
&lt;br /&gt;
The installer downloads all components from the internet. This will take a while, so have a cup of coffee or walk the dog.&lt;br /&gt;
&lt;br /&gt;
See the following section about also installing an optional, more-functional shell window for MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Using MinGW ===&lt;br /&gt;
&lt;br /&gt;
The MinGW compilers are accessible through the &amp;amp;amp;quot;MinGW Shell&amp;amp;amp;quot; which should be located under the MinGW folder in the Start Menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Shell.png|frame|none|alt=Location of MinGW Shell]]&lt;br /&gt;
&lt;br /&gt;
or by running &amp;amp;lt;tt&amp;amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;amp;lt;/tt&amp;amp;gt; (if MinGW was installed to its default location).&lt;br /&gt;
&lt;br /&gt;
By default the MinGW shell executes inside of a Windows &amp;amp;lt;tt&amp;amp;gt;cmd.exe&amp;amp;lt;/tt&amp;amp;gt; terminal. There are a couple major drawbacks to this:&lt;br /&gt;
&lt;br /&gt;
* You cannot resize the window to full-screen.&lt;br /&gt;
* The shell provides limited history scrollback.&lt;br /&gt;
&lt;br /&gt;
MinGW provides a couple of alternative terminals for the MinGW shell which do not have these drawbacks; one of which is called MinTTY. To install MinTTY execute the following in a MinGW shell:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mingw-get install mintty&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then the &amp;amp;lt;tt&amp;amp;gt;mintty&amp;amp;lt;/tt&amp;amp;gt; command can be used to launch a MinTTY terminal. The MinGW Shell can also be set to launch MinTTY by default by editing the file &amp;amp;lt;tt&amp;amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;amp;lt;/tt&amp;amp;gt; and changing the following line (approximately line 58):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=sh.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=mintty.exe&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A Note About Paths ===&lt;br /&gt;
&lt;br /&gt;
The MinGW Shell emulates a UNIX &amp;amp;lt;tt&amp;amp;gt;bash&amp;amp;lt;/tt&amp;amp;gt; shell and thus uses UNIX-style paths, &amp;amp;lt;tt&amp;amp;gt;/path/to/file&amp;amp;lt;/tt&amp;amp;gt;, instead of Windows-style paths, &amp;amp;lt;tt&amp;amp;gt;C:\path\to\file&amp;amp;lt;/tt&amp;amp;gt;. One peculiarity of this process is that the shell must deal with the fact that Windows filesystems have multiple roots (&amp;amp;lt;tt&amp;amp;gt;C:&amp;amp;lt;/tt&amp;amp;gt;, &amp;amp;lt;tt&amp;amp;gt;D:&amp;amp;lt;/tt&amp;amp;gt;, etc.) while a UNIX filesystem only has one root called &amp;amp;lt;tt&amp;amp;gt;/&amp;amp;lt;/tt&amp;amp;gt;. The way this is reconciled by the &amp;amp;lt;tt&amp;amp;gt;bash&amp;amp;lt;/tt&amp;amp;gt; shell provided with MinGW is that &amp;amp;lt;tt&amp;amp;gt;/c&amp;amp;lt;/tt&amp;amp;gt; refers to the root of the &amp;amp;lt;tt&amp;amp;gt;C:&amp;amp;lt;/tt&amp;amp;gt; drive, &amp;amp;lt;tt&amp;amp;gt;/d&amp;amp;lt;/tt&amp;amp;gt; refers to the root of the &amp;amp;lt;tt&amp;amp;gt;D:&amp;amp;lt;/tt&amp;amp;gt; drive and so on and so forth.&lt;br /&gt;
&lt;br /&gt;
The root of the filesystem itself, &amp;amp;lt;tt&amp;amp;gt;/&amp;amp;lt;/tt&amp;amp;gt;, also has some caveats. &amp;amp;lt;tt&amp;amp;gt;/&amp;amp;lt;/tt&amp;amp;gt; refers to the &amp;amp;lt;tt&amp;amp;gt;mysy&amp;amp;lt;/tt&amp;amp;gt; folder, &amp;amp;lt;tt&amp;amp;gt;C:/MinGW/mysys/1.0&amp;amp;lt;/tt&amp;amp;gt; in a default installation. &amp;amp;lt;tt&amp;amp;gt;/usr&amp;amp;lt;/tt&amp;amp;gt; also refers to the same location. Thus, &amp;amp;lt;tt&amp;amp;gt;/usr/local&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;/local&amp;amp;lt;/tt&amp;amp;gt; both refer to &amp;amp;lt;tt&amp;amp;gt;C:/MinGW/mysys/1.0/local&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== A Note About MinGW-64 ===&lt;br /&gt;
&lt;br /&gt;
Currently Swarm has been developed and tested against the 32-bit version of MinGW. Hence Swarm models produced this way should run in any version of Windows.&lt;br /&gt;
&lt;br /&gt;
The [MinGW-w64][mingw_65] project produces 64-bit MinGW compilers that can produce 64-bit executables that will only run on 64-bit versions of Windows. These executables benefit from:&lt;br /&gt;
&lt;br /&gt;
* Access to more memory. A 32-bit executable will only be able to allocate ~3 GB of RAM---even if the system has more RAM available.&lt;br /&gt;
* Possibly quicker execution speeds due to matching the native architecture of the operating system---however this depends on the types of tasks that the program executes. It has been reported that 64 bit Swarm executables run quicker than 32 bit Swarm executables on Linux.&lt;br /&gt;
&lt;br /&gt;
Currently, no attempt has been made to compile Swarm 2.4.1 with the 64 bit MinGW compilers. If a successful attempt is made, please report it on the [http://www.swarm.org/mailman/listinfo/support Swarm mailing list].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Emacs ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/emacs&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 23.3&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://ftp.gnu.org/gnu/emacs/windows&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GNU Emacs is a text editor that is used by many programmers to edit code. However, Emacs can also be scripted to perform a variety of complicated transformations on text files. The scripts that build the Swarm libraries use Emacs to automate the process of generating some source files. Thus Emacs has to be installed in order to build Swarm from source.&lt;br /&gt;
&lt;br /&gt;
=== Installing Emacs ===&lt;br /&gt;
&lt;br /&gt;
Install Emacs by downloading one of the &amp;amp;lt;tt&amp;amp;gt;emacs-&amp;amp;amp;lt;version&lt;br /&gt;
number&amp;amp;amp;gt;-bin-i386.zip&amp;amp;lt;/tt&amp;amp;gt; files from the download area. Don't use any of the&lt;br /&gt;
files containing &amp;amp;lt;tt&amp;amp;gt;barebin&amp;amp;lt;/tt&amp;amp;gt;. After extracting the ZIP archive there will&lt;br /&gt;
be an Emacs folder containing a subfolder called &amp;amp;lt;tt&amp;amp;gt;bin&amp;amp;lt;/tt&amp;amp;gt;. Add this folder&lt;br /&gt;
to your Windows &amp;amp;lt;tt&amp;amp;gt;PATH&amp;amp;lt;/tt&amp;amp;gt;. [[#RapidEE|RapidEE]] can help edit the&lt;br /&gt;
&amp;amp;lt;tt&amp;amp;gt;PATH&amp;amp;lt;/tt&amp;amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GPerf ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/gperf/&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/gnuwin32/files/gperf&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 3.0.1&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GPerf is a program that produces C code containing hash functions. The scripts&lt;br /&gt;
that build the Swarm libraries use GPerf to generate some source code files.&lt;br /&gt;
Download &amp;amp;lt;tt&amp;amp;gt;gperf.exe&amp;amp;lt;/tt&amp;amp;gt; from the GnuWin32 site on Sourceforge and place it&lt;br /&gt;
somewhere on your Windows &amp;amp;lt;tt&amp;amp;gt;PATH&amp;amp;lt;/tt&amp;amp;gt;. Again, [[#RapidEE|RapidEE]] can help set the &amp;amp;lt;tt&amp;amp;gt;PATH&amp;amp;lt;/tt&amp;amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RapidEE ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.rapidee.com&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 5.0&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.rapidee.com/en/license Freeware]&lt;br /&gt;
&lt;br /&gt;
The Rapid Environment Editor (RapidEE) is a spiffy tool that makes it easy to inspect and alter the value of Windows environment variables, such as the &amp;amp;lt;tt&amp;amp;gt;PATH&amp;amp;lt;/tt&amp;amp;gt;. RapidEE may be used to edit &amp;amp;amp;quot;System Variables&amp;amp;amp;quot; which will affect all user accounts or &amp;amp;amp;quot;User Variables&amp;amp;amp;quot; which will affect just the current account. Administrative privileges may be required to edit the System Variables.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_1.png|frame|none|alt=The different variables RapidEE can edit]]&lt;br /&gt;
&lt;br /&gt;
Right-clicking on the &amp;amp;lt;tt&amp;amp;gt;Path&amp;amp;lt;/tt&amp;amp;gt; variable in the System Variables or User Variables will bring up a menu that presents the option to &amp;amp;amp;quot;Add value&amp;amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_2.png|frame|none|alt=Adding a new value to the PATH]]&lt;br /&gt;
&lt;br /&gt;
Once the new entry has been added, RapidEE must be told to save the changes. Command line shells, such as &amp;amp;lt;tt&amp;amp;gt;cmd.exe&amp;amp;lt;/tt&amp;amp;gt;, must be restarted in order for them to notice the changes.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_3.png|frame|none|alt=Adding and saving a value]]&lt;br /&gt;
&lt;br /&gt;
== Depends ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.dependencywalker.com/&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 2.2&lt;br /&gt;
&lt;br /&gt;
'''License:''' Freeware&lt;br /&gt;
&lt;br /&gt;
Depends is a usefull utility that scans Windows executables and reports information concerning the Dynamic-link Libraries (DLLs) that those executables require in order to run.&lt;br /&gt;
&lt;br /&gt;
= Software Used to Compile Swarm 2.4.1 =&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!  Name&lt;br /&gt;
!  Verson Used&lt;br /&gt;
!  License&lt;br /&gt;
!  Homepage&lt;br /&gt;
!  Download Area&lt;br /&gt;
|-&lt;br /&gt;
|  ZLib&lt;br /&gt;
|  1.2.5&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG License]&lt;br /&gt;
|  [http://www.zlib.net http://www.zlib.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibFFI&lt;br /&gt;
|  3.0.9&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  [http://sourceware.org/libffi http://sourceware.org/libffi]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibPNG&lt;br /&gt;
|  1.5.4&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG]&lt;br /&gt;
|  [http://www.libpng.org/pub/png/libpng.html http://www.libpng.org/pub/png/libpng.html]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  XPM-NoX&lt;br /&gt;
|  4.2.0&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  unknown&lt;br /&gt;
|  [http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32 http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32]&lt;br /&gt;
|-&lt;br /&gt;
|  Tcl&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Tk&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  BLT&lt;br /&gt;
|  2.4z&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://blt.sourceforge.net http://blt.sourceforge.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  HDF5&lt;br /&gt;
|  1.8.7&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://www.hdfgroup.org/HDF5 http://www.hdfgroup.org/HDF5]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Swarm&lt;br /&gt;
|  2.4.1&lt;br /&gt;
|  [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
|  [http://www.swarm.org http://www.swarm.org]&lt;br /&gt;
|  [http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2157</id>
		<title>Swarm and MinGW</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2157"/>
				<updated>2015-12-02T22:57:16Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Using Swarm Models Compiled with MinGW */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This documentation provides information on how to use Swarm on Windows with [http://www.mingw.org MinGW] compilers. The following topics will be covered:&lt;br /&gt;
&lt;br /&gt;
* How to run a Swam model compiled with MinGW on Windows: Once you produce a Swarm model using MinGW (or someone gives one to you), how do you run it on other machines without installing Swarm there?&lt;br /&gt;
* How to use MinGW to compile your own Swarm models, either during model development or so you can distribute working models to others. This requires installing MinGW and our binary Swarm libraries.&lt;br /&gt;
* How to package a model compiled with MinGW so it can be installed and run by itself on Windows machines.&lt;br /&gt;
* How to use MinGW to compile the Swarm libraries, in case you want to build your own Swarm binaries.&lt;br /&gt;
&lt;br /&gt;
Each topic is more difficult than the one before it. However the topics are independent in that it is not necessary to know how to compile the Swarm library in order to run a pre-compiled Swarm model or compile your own model against a pre-compiled version of Swarm.&lt;br /&gt;
&lt;br /&gt;
= Using Swarm Models Compiled with MinGW =&lt;br /&gt;
&lt;br /&gt;
A model that has been compiled using MinGW can be installed and run from a Windows computer without installing MinGW or Swarm. An example code is this build of Heatbugs:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe]&lt;br /&gt;
&lt;br /&gt;
However, running a Swarm model requires some support programs and libraries. These are available as&lt;br /&gt;
&amp;lt;tt&amp;gt;swarm-2.4.1-win32.zip&amp;lt;/tt&amp;gt;, available here:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip]&lt;br /&gt;
&lt;br /&gt;
Unzipping that file will create a folder called &amp;lt;tt&amp;gt;swarm&amp;lt;/tt&amp;gt; which should be moved somewhere that is easy to remember. The rest of this tutorial will assume this Swarm folder has been placed at &amp;lt;tt&amp;gt;C:\swarm&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before a Swarm model can be run, the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder must be added to the Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; so that Heatbugs can find necessary libraries when it runs. The &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder can be ''temporarily'' added to the path by executing the following in the Windows command line (the command line is accessed using the program &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;path=%PATH%;C:\swarm\bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, it is possible to have conflicts if other versions of libraries used by Swarm, such as HDF5, are already installed and in your path. And some Swarm programs require that the environment variable SWARMHOME be defined, which will typically not be true. These problems can be avoided by using the following statements instead of the above path command:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
You can alternatively add the Swarm folder to your &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; permanently by editing the Windows PATH environment variable. A tool like [[#RapidEE|RapidEE]] makes doing so easy, or you can use use Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; to the PATH system variable.&lt;br /&gt;
&lt;br /&gt;
Once the path has been set to include the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder, Swarm models can be started through the Windows command line, or by double-clicking on them from the Windows Explorer.  &lt;br /&gt;
&lt;br /&gt;
The Heatbugs model can now be run by changing the directory of the command line to the folder holding &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; and then executing the program. For example, if &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is located in &amp;lt;tt&amp;gt;C:\Users\example_user\Downloads&amp;lt;/tt&amp;gt;, then the model may be run as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;cd C:\Users\example_user\Downloads&lt;br /&gt;
heatbugs.exe&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
(or you can just double-click on &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; from Windows Explorer, which temporarily opens a Windows command terminal while the model runs.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Running_Heatbugs.png|frame|none|alt=Running the Heatbugs model]]&lt;br /&gt;
&lt;br /&gt;
You can also create a simple Windows batch file that sets SWARMHOME and the path and then executes the model. Create a file called, for example &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; in the same directory where &amp;lt;tt&amp;gt;heatbugs.exe&amp;lt;/tt&amp;gt; is, containing these lines: &lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
heatbugs.exe&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, just double-clicking on &amp;lt;tt&amp;gt;heatbugs.bat&amp;lt;/tt&amp;gt; will start the model.&lt;br /&gt;
&lt;br /&gt;
If you try this and get an error that some .dll file is not found, then the problem is likely that the path is not set correctly to include the swarm\bin folder. If instead the program crashes without an error statement, then the problem is more likely that SWARMHOME needs to be set.&lt;br /&gt;
&lt;br /&gt;
= Installing Swarm and MinGW to compile models =&lt;br /&gt;
&lt;br /&gt;
To compile Swarm models from source using MinGW, the following simple steps need to be taken to set up the build environment:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|Install MinGW using instructions here]]. Currently only 32-bit MinGW can be used with Swarm. Install all components of MinGW.&lt;br /&gt;
* Download compiled Swarm binaries, archived as [http://ftp.swarm.org/pub/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip swarm-2.4.1-win32.zip]. Unzip the archive and place the extracted folder at &amp;amp;lt;tt&amp;amp;gt;C:\swarm&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
The archived Swarm binaries '''MUST''' be placed at &amp;amp;lt;tt&amp;amp;gt;C:\swarm&amp;amp;lt;/tt&amp;amp;gt; to successfully compile Swarm models. This is because some paths had to be hard-coded by &amp;amp;lt;tt&amp;amp;gt;libtool&amp;amp;lt;/tt&amp;amp;gt; during the creation of the binaries.&lt;br /&gt;
&lt;br /&gt;
The final step before you can compile a Swarm model is to set the &amp;amp;lt;tt&amp;amp;gt;SWARMHOME&amp;amp;lt;/tt&amp;amp;gt; environment variable so that the &amp;amp;quot;make&amp;amp;quot; program knows where to find the Swarm libraries when compiling your code. There are several ways to do this.&lt;br /&gt;
*You can temporarily set SWARMHOME by entering this command in the MinGW shell: &amp;amp;lt;pre&amp;amp;gt;export SWARMHOME=/c/swarm&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
*You can edit your Makefile so it starts with: &amp;amp;lt;pre&amp;amp;gt;SWARMHOME=/c/swarm&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
*Set SWARMHOME permanently as a Windows environment variable, either by using [[#RapidEE|RapidEE]] or Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add a new (User or System) variable called SWARMHOME with the value &amp;amp;lt;tt&amp;amp;gt;/c/swarm&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After MinGW has been installed and the Swarm binaries have been downloaded, Swarm models may be compiled using the MinGW shell. Start up the program MinGW Shell, cd to the directory containing your code and Makefile, and enter the command &amp;amp;quot;Make&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
An archive of official Swarm example programs can be downloaded from:&lt;br /&gt;
&lt;br /&gt;
[http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
&lt;br /&gt;
We will use the &amp;amp;amp;quot;Heatbugs&amp;amp;amp;quot; model as an example of how to compile a Swarm application:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xzf /path/to/downloaded/swarmapps-2.3.0.tar.gz&lt;br /&gt;
cd swarmapps-2.3.0/objc/heatbugs&lt;br /&gt;
&lt;br /&gt;
make&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
'''VERY IMPORTANT NOTE: MinGW produces two executables called &amp;amp;lt;tt&amp;amp;gt;heatbugs.exe&amp;amp;lt;/tt&amp;amp;gt;---one in the &amp;amp;lt;tt&amp;amp;gt;heatbugs&amp;amp;lt;/tt&amp;amp;gt; folder and another in the &amp;amp;lt;tt&amp;amp;gt;heatbugs/.libs&amp;amp;lt;/tt&amp;amp;gt; folder. You should ignore the executable in the top-level folder, &amp;amp;lt;tt&amp;amp;gt;heatbugs/heatbugs.exe&amp;amp;lt;/tt&amp;amp;gt;, as it is merely a compiled wrapper script that executes &amp;amp;lt;tt&amp;amp;gt;heatbugs/.libs/heatbugs.exe&amp;amp;lt;/tt&amp;amp;gt;. When distributing compiled models, only use binaries from the &amp;amp;lt;tt&amp;amp;gt;.libs&amp;amp;lt;/tt&amp;amp;gt; folder.'''&lt;br /&gt;
&lt;br /&gt;
The resulting executable, &amp;amp;lt;tt&amp;amp;gt;.libs/heatbugs.exe&amp;amp;lt;/tt&amp;amp;gt; may be executing by following the steps described above at ''Using Swarm Models Compiled with MinGW''. These steps must include setting the Windows Path to include &amp;amp;lt;tt&amp;amp;gt;C:\swarm\bin&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Distributing a Swarm Model for Windows Users =&lt;br /&gt;
&lt;br /&gt;
A major benefit of the MinGW version of Swarm is that models can be distributed for people to use without installing Swarm. A simple way to do this, after the model has been compiled and tested using methods in the previous section, is to create a ZIP archive that contains all the files to run the model.&lt;br /&gt;
&lt;br /&gt;
* Create a directory tree that includes the Swarm binary files. For example, create C:\MySwarmModel and add the Swarm binaries (as described [[Swarm_and_MinGW#Using_Swarm_Models_Compiled_with_MinGW|above]]) to it as a subdirectory tree.&lt;br /&gt;
* Create another subdirectory that includes just the compiled model.&lt;br /&gt;
* Create a third subdirectory that includes any input files that the model needs and a batch file that sets the path and executes the model. &lt;br /&gt;
* Zip the whole tree up for distribution.&lt;br /&gt;
&lt;br /&gt;
The directory tree in the zip file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;&lt;br /&gt;
C:\MySwarmModel\swarm&lt;br /&gt;
                      \bin&lt;br /&gt;
                      \etc&lt;br /&gt;
                      \include&lt;br /&gt;
                      \lib&lt;br /&gt;
                      \man&lt;br /&gt;
                      \share&lt;br /&gt;
               \executable\MySwarmModel.exe&lt;br /&gt;
               \Runfiles\MySwarmModel.bat (and any input files)&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the file &amp;amp;lt;tt&amp;amp;gt;MySwarmModel.bat&amp;amp;lt;/tt&amp;amp;gt; contains:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;&lt;br /&gt;
set SWARMHOME=C:\MySwarmModel\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
C:\MySwarmModel\executable\MySwarmModel.exe&lt;br /&gt;
&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then users can run the model just by double-clicking on &amp;amp;lt;tt&amp;amp;gt;MySwarmModel.bat&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Building Swarm Using MinGW =&lt;br /&gt;
&lt;br /&gt;
This tutorial provides directions and code for compiling your own Swarm libraries for Windows. It is a bit advanced---some familiarity with compiling software from source in a Linux environment and knowledge of the UNIX command line is assumed.&lt;br /&gt;
&lt;br /&gt;
== Install Required Tools ==&lt;br /&gt;
&lt;br /&gt;
The first step is to download and install tools required for compiling Swarm. These links provide directions:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|MinGW]]&lt;br /&gt;
* [[#Emacs|Emacs]]&lt;br /&gt;
* [[#GPerf|GPerf]]&lt;br /&gt;
&lt;br /&gt;
== Build Support Libraries ==&lt;br /&gt;
&lt;br /&gt;
The next steps are to build and install the libraries that Swarm depends on. A ZIP archive containing all the source code required can be found at:&lt;br /&gt;
&lt;br /&gt;
[http://ftp.swarm.org/pub/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip http://ftp.swarm.org/pub/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip]&lt;br /&gt;
&lt;br /&gt;
This archive contains two subdirectories:&lt;br /&gt;
&lt;br /&gt;
* sources: This folder contains the source code for each component.&lt;br /&gt;
* patches: This folder contains patchfiles that modfy source code so that MinGW can compile it.&lt;br /&gt;
&lt;br /&gt;
After downloading and extracting the source code archive, open up a MinGW shell and run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
mkdir build&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
The following steps will all assume your MinGW shell is operating out of the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory. All compiled software will be installed to &amp;amp;lt;tt&amp;amp;gt;/c/swarm&amp;amp;lt;/tt&amp;amp;gt; (The Windows Explorer will see the folder appear at &amp;amp;lt;tt&amp;amp;gt;C:\swarm&amp;amp;lt;/tt&amp;amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== ZLib ===&lt;br /&gt;
&lt;br /&gt;
ZLib will be the first library to be built as it is a common dependency for many of the other software components. From the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, execute the following to build Zlib:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xzf ../sources/zlib-1.2.5.tar.gz&lt;br /&gt;
cd zlib-1.2.5&lt;br /&gt;
make -f win32/Makefile.gcc&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
And then the following commands to install ZLib to &amp;amp;lt;tt&amp;amp;gt;/c/swarm&amp;amp;lt;/tt&amp;amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;mkdir -p /c/swarm/bin&lt;br /&gt;
mkdir -p /c/swarm/include&lt;br /&gt;
mkdir -p /c/swarm/lib&lt;br /&gt;
&lt;br /&gt;
cp zlib1.dll /c/swarm/bin/&lt;br /&gt;
cp zconf.h zlib.h /c/swarm/include/&lt;br /&gt;
mv libzdll.a libz.dll.a&lt;br /&gt;
cp *.a /c/swarm/lib&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LibPNG ===&lt;br /&gt;
&lt;br /&gt;
LibPNG will be built next as its only dependency is ZLib. From the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, execute the following steps to build and install LibPNG:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xjf ../sources/libpng-1.5.4.tar.bz2&lt;br /&gt;
cd libpng-1.5.4&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm --with-zlib-prefix=/c/swarm&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XPM ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, the XPM library can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xjf ../sources/xpm-nox-4.2.0.tar.bz2&lt;br /&gt;
cd xpm-nox-4.2.0&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/xpm-nox-4.2.0-mingw-tcl.patch&lt;br /&gt;
&lt;br /&gt;
make CC=gcc&lt;br /&gt;
make install prefix=/c/swarm&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
The patchfile is inherited from the SUSE builds of XPM for MinGW and adds Makefiles and other critical components.&lt;br /&gt;
&lt;br /&gt;
One major modification has been made to the SUSE patchfile---&amp;amp;lt;tt&amp;amp;gt;tcl.h&amp;amp;lt;/tt&amp;amp;gt; is included in &amp;amp;lt;tt&amp;amp;gt;xpm.h&amp;amp;lt;/tt&amp;amp;gt;. This is required in order to use XPM while Tk is installed. Conversely, this means that this build of XPM cannot be used without having Tk installed.&lt;br /&gt;
&lt;br /&gt;
=== LibFFI ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, LibFFI can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xzf ../sources/libffi-3.0.9.tar.gz&lt;br /&gt;
cd libffi-3.0.9&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
The LibFFI headers get installed in a weird place.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;mv /c/swarm/lib/libffi-3.0.9/include/*.h /c/swarm/include&lt;br /&gt;
rm -rf /c/swarm/lib/libffi-3.0.9&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tcl ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, Tcl can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xzf ../sources/tcl8.4.19-src.tar.gz&lt;br /&gt;
cd tcl8.4.19&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/tcl-8.4.19-fix-lvalues.patch&lt;br /&gt;
cd win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
At two places in the TCL source code, an assignment is made while simultaneously performing a typecast. The typecast and the assignment had to be split into separate operations in order to be acceptable to the MinGW compilers.&lt;br /&gt;
&lt;br /&gt;
=== Tk ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, Tk can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xzf ../sources/tk8.4.19-src.tar.gz&lt;br /&gt;
cd tk8.4.19/win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BLT ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, BLT can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xzf ../sources/BLT2.4z.tar.gz&lt;br /&gt;
cd blt2.4z&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm --without-x&lt;br /&gt;
make&lt;br /&gt;
make install&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDF5 (Optional) ===&lt;br /&gt;
&lt;br /&gt;
Getting HDF5 to work with MinGW is a little tricky. It is an optional dependency, so if support for reading and writing &amp;amp;lt;tt&amp;amp;gt;.hdf&amp;amp;lt;/tt&amp;amp;gt; files is not needed this section can be skipped.&lt;br /&gt;
&lt;br /&gt;
As of version 1.8.7, HDF5 currently does not compile under MinGW. So, we must wrap pre-compiled binaries for use with MinGW. In order to wrap the binaries, we will need an additional tool called &amp;amp;lt;tt&amp;amp;gt;pexports&amp;amp;lt;/tt&amp;amp;gt;. This can be installed using &amp;amp;lt;tt&amp;amp;gt;mingw-get&amp;amp;lt;/tt&amp;amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;mingw-get install mingw-utils&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
Download 32-bit Windows binaries from the HDF website compiled for use with the Visual Studio compilers (these files have &amp;amp;amp;quot;VS&amp;amp;amp;quot; listed under the ''Compilers'' section). After extracting the archive, the HDF5 libraries can be wrapped for use with MinGW by executing the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;cd path/to/where/HDF5/was/extracted&lt;br /&gt;
&lt;br /&gt;
for dll in `ls dll/*dll`; do&lt;br /&gt;
  def_file=`basename $dll .dll`.def&lt;br /&gt;
  lib_file=lib`basename $dll dll.dll`.a&lt;br /&gt;
  pexports $dll &amp;amp;amp;gt; $def_file&lt;br /&gt;
  dlltool -d $def_file -l lib/$lib_file&lt;br /&gt;
done&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
Next, move the libraries and header files needed to use HDF5 from C into &amp;amp;lt;tt&amp;amp;gt;C:\swarm&amp;amp;lt;/tt&amp;amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;cp dll/hdf5dll.dll dll/szip.dll /c/swarm/bin&lt;br /&gt;
cp include/* /c/swarm/include&lt;br /&gt;
cp lib/libhdf5.a /c/swarm/lib&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
Finally, a patch must be applied to the HDF header file &amp;amp;lt;tt&amp;amp;gt;H5public.h&amp;amp;lt;/tt&amp;amp;gt; so that it doesn't define &amp;amp;lt;tt&amp;amp;gt;ssize_t&amp;amp;lt;/tt&amp;amp;gt;---a constant already defined by MinGW. The required patch is contained in the Swarm MinGW source archive:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
patch -p1 -d /c/swarm &amp;amp;amp;lt; patches/hdf5-1.8.7-mingw.patch&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Swarm ==&lt;br /&gt;
&lt;br /&gt;
Finally, the Swarm libraries themselves can be built. From the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, execute the following&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xzf ../sources/swarm-2.4.1.tar.gz&lt;br /&gt;
cd swarm-2.4.1&lt;br /&gt;
patch -p1 ../../patches/swarm-2.4.1-mingw.patch&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm \&lt;br /&gt;
  --with-zlibdir=/c/swarm \&lt;br /&gt;
  --with-pngdir=/c/swarm \&lt;br /&gt;
  --with-xpmdir=/c/swarm \&lt;br /&gt;
  --with-ffidir=/c/swarm \&lt;br /&gt;
  --with-tcl=/c/swarm/lib \&lt;br /&gt;
  --with-tk=/c/swarm/lib \&lt;br /&gt;
  --with-bltdir=/c/swarm&lt;br /&gt;
&lt;br /&gt;
cd avcall&lt;br /&gt;
gcc -S avcall-i386.c&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
If you wrapped HDF5 up for use with MinGW, add &amp;amp;lt;tt&amp;amp;gt;--with-hdf5dir=/c/swarm&amp;amp;lt;/tt&amp;amp;gt; to the list of arguments passed to &amp;amp;lt;tt&amp;amp;gt;configure&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;tt&amp;amp;gt;swarm-2.4.1-mingw.patch&amp;amp;lt;/tt&amp;amp;gt; modifies the Swarm source code in the following ways:&lt;br /&gt;
&lt;br /&gt;
* &amp;amp;lt;tt&amp;amp;gt;gettimeofday&amp;amp;lt;/tt&amp;amp;gt; is no longer defined in the Swarm sources as MinGW includes this function in its standard library.&lt;br /&gt;
* Swarm GUI functions are updated to be compatible with LibPNG 1.5.&lt;br /&gt;
* The Swarm &amp;amp;lt;tt&amp;amp;gt;configure&amp;amp;lt;/tt&amp;amp;gt; script defines &amp;amp;lt;tt&amp;amp;gt;DATADIR&amp;amp;lt;/tt&amp;amp;gt; as a preprocessor macro---this conflicts with variables in the GCC Objective-C library. &amp;amp;lt;tt&amp;amp;gt;DATDIR&amp;amp;lt;/tt&amp;amp;gt; is &amp;amp;lt;tt&amp;amp;gt;undef&amp;amp;lt;/tt&amp;amp;gt;ed in critical parts of the source code.&lt;br /&gt;
* The &amp;amp;lt;tt&amp;amp;gt;sleep&amp;amp;lt;/tt&amp;amp;gt; function is aliased to &amp;amp;lt;tt&amp;amp;gt;usleep&amp;amp;lt;/tt&amp;amp;gt;---which is the name of the MinGW implementation.&lt;br /&gt;
* The way in which Makefiles invoke &amp;amp;lt;tt&amp;amp;gt;gperf&amp;amp;lt;/tt&amp;amp;gt; is amended so that it actually produces output.&lt;br /&gt;
* NULL checks are added to `zstrdup` in src/defobj/internal.m. Some functions in the Swarm library may attempt to call `zstrdup` on a NULL pointer. (This happens if the SWARMHOME environment variable is not set.) Failing to check for this condition can lead to segfaults. `zstrdup` now returns NULL if passed a NULL string or if `alloc` fails to allocate memory for a duplicate.&lt;br /&gt;
&lt;br /&gt;
Full details are contained in the patchfile.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
&lt;br /&gt;
== MinGW ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.mingw.org&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/mingw/files&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 20110530&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org MinGW] is a set of software that aims to provide an environment where software developed on UNIX-like systems can be easily compiled for Windows. Since Swarm is primarily developed on Linux (a UNIX clone), MinGW can ease the task of creating Swarm models that run on Windows.&lt;br /&gt;
&lt;br /&gt;
MinGW is similar to the [http://www.cygwin.org Cygwin] project. The major difference is that MinGW produces executables that depend only on native Windows libraries while Cygwin executables require special compatibility libraries that are part of the Cygwin distribution.&lt;br /&gt;
&lt;br /&gt;
=== Installing MinGW ===&lt;br /&gt;
&lt;br /&gt;
MinGW can be installed by downloading the &amp;amp;amp;quot;Automated MinGW Installer&amp;amp;amp;quot;, which usually has a name like &amp;amp;lt;tt&amp;amp;gt;mingw-get-inst-&amp;amp;amp;lt;date&amp;amp;amp;gt;.exe&amp;amp;lt;/tt&amp;amp;gt; where &amp;amp;lt;tt&amp;amp;gt;&amp;amp;amp;lt;date&amp;amp;amp;gt;&amp;amp;lt;/tt&amp;amp;gt; is the datestamp for when the installer was packaged. Running this executable will start the installation process. The installer lets you select which optional components to install; make sure all boxes are checked so you '''install all components'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Setup.png|frame|none|alt=Install all available MinGW components]]&lt;br /&gt;
&lt;br /&gt;
The installer downloads all components from the internet. This will take a while, so have a cup of coffee or walk the dog.&lt;br /&gt;
&lt;br /&gt;
See the following section about also installing an optional, more-functional shell window for MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Using MinGW ===&lt;br /&gt;
&lt;br /&gt;
The MinGW compilers are accessible through the &amp;amp;amp;quot;MinGW Shell&amp;amp;amp;quot; which should be located under the MinGW folder in the Start Menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Shell.png|frame|none|alt=Location of MinGW Shell]]&lt;br /&gt;
&lt;br /&gt;
or by running &amp;amp;lt;tt&amp;amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;amp;lt;/tt&amp;amp;gt; (if MinGW was installed to its default location).&lt;br /&gt;
&lt;br /&gt;
By default the MinGW shell executes inside of a Windows &amp;amp;lt;tt&amp;amp;gt;cmd.exe&amp;amp;lt;/tt&amp;amp;gt; terminal. There are a couple major drawbacks to this:&lt;br /&gt;
&lt;br /&gt;
* You cannot resize the window to full-screen.&lt;br /&gt;
* The shell provides limited history scrollback.&lt;br /&gt;
&lt;br /&gt;
MinGW provides a couple of alternative terminals for the MinGW shell which do not have these drawbacks; one of which is called MinTTY. To install MinTTY execute the following in a MinGW shell:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;mingw-get install mintty&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
Then the &amp;amp;lt;tt&amp;amp;gt;mintty&amp;amp;lt;/tt&amp;amp;gt; command can be used to launch a MinTTY terminal. The MinGW Shell can also be set to launch MinTTY by default by editing the file &amp;amp;lt;tt&amp;amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;amp;lt;/tt&amp;amp;gt; and changing the following line (approximately line 58):&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=sh.exe&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=mintty.exe&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A Note About Paths ===&lt;br /&gt;
&lt;br /&gt;
The MinGW Shell emulates a UNIX &amp;amp;lt;tt&amp;amp;gt;bash&amp;amp;lt;/tt&amp;amp;gt; shell and thus uses UNIX-style paths, &amp;amp;lt;tt&amp;amp;gt;/path/to/file&amp;amp;lt;/tt&amp;amp;gt;, instead of Windows-style paths, &amp;amp;lt;tt&amp;amp;gt;C:\path\to\file&amp;amp;lt;/tt&amp;amp;gt;. One peculiarity of this process is that the shell must deal with the fact that Windows filesystems have multiple roots (&amp;amp;lt;tt&amp;amp;gt;C:&amp;amp;lt;/tt&amp;amp;gt;, &amp;amp;lt;tt&amp;amp;gt;D:&amp;amp;lt;/tt&amp;amp;gt;, etc.) while a UNIX filesystem only has one root called &amp;amp;lt;tt&amp;amp;gt;/&amp;amp;lt;/tt&amp;amp;gt;. The way this is reconciled by the &amp;amp;lt;tt&amp;amp;gt;bash&amp;amp;lt;/tt&amp;amp;gt; shell provided with MinGW is that &amp;amp;lt;tt&amp;amp;gt;/c&amp;amp;lt;/tt&amp;amp;gt; refers to the root of the &amp;amp;lt;tt&amp;amp;gt;C:&amp;amp;lt;/tt&amp;amp;gt; drive, &amp;amp;lt;tt&amp;amp;gt;/d&amp;amp;lt;/tt&amp;amp;gt; refers to the root of the &amp;amp;lt;tt&amp;amp;gt;D:&amp;amp;lt;/tt&amp;amp;gt; drive and so on and so forth.&lt;br /&gt;
&lt;br /&gt;
The root of the filesystem itself, &amp;amp;lt;tt&amp;amp;gt;/&amp;amp;lt;/tt&amp;amp;gt;, also has some caveats. &amp;amp;lt;tt&amp;amp;gt;/&amp;amp;lt;/tt&amp;amp;gt; refers to the &amp;amp;lt;tt&amp;amp;gt;mysy&amp;amp;lt;/tt&amp;amp;gt; folder, &amp;amp;lt;tt&amp;amp;gt;C:/MinGW/mysys/1.0&amp;amp;lt;/tt&amp;amp;gt; in a default installation. &amp;amp;lt;tt&amp;amp;gt;/usr&amp;amp;lt;/tt&amp;amp;gt; also refers to the same location. Thus, &amp;amp;lt;tt&amp;amp;gt;/usr/local&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;/local&amp;amp;lt;/tt&amp;amp;gt; both refer to &amp;amp;lt;tt&amp;amp;gt;C:/MinGW/mysys/1.0/local&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== A Note About MinGW-64 ===&lt;br /&gt;
&lt;br /&gt;
Currently Swarm has been developed and tested against the 32-bit version of MinGW. Hence Swarm models produced this way should run in any version of Windows.&lt;br /&gt;
&lt;br /&gt;
The [MinGW-w64][mingw_65] project produces 64-bit MinGW compilers that can produce 64-bit executables that will only run on 64-bit versions of Windows. These executables benefit from:&lt;br /&gt;
&lt;br /&gt;
* Access to more memory. A 32-bit executable will only be able to allocate ~3 GB of RAM---even if the system has more RAM available.&lt;br /&gt;
* Possibly quicker execution speeds due to matching the native architecture of the operating system---however this depends on the types of tasks that the program executes. It has been reported that 64 bit Swarm executables run quicker than 32 bit Swarm executables on Linux.&lt;br /&gt;
&lt;br /&gt;
Currently, no attempt has been made to compile Swarm 2.4.1 with the 64 bit MinGW compilers. If a successful attempt is made, please report it on the [http://www.swarm.org/mailman/listinfo/support Swarm mailing list].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Emacs ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/emacs&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 23.3&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://ftp.gnu.org/gnu/emacs/windows&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GNU Emacs is a text editor that is used by many programmers to edit code. However, Emacs can also be scripted to perform a variety of complicated transformations on text files. The scripts that build the Swarm libraries use Emacs to automate the process of generating some source files. Thus Emacs has to be installed in order to build Swarm from source.&lt;br /&gt;
&lt;br /&gt;
=== Installing Emacs ===&lt;br /&gt;
&lt;br /&gt;
Install Emacs by downloading one of the &amp;amp;lt;tt&amp;amp;gt;emacs-&amp;amp;amp;lt;version&lt;br /&gt;
number&amp;amp;amp;gt;-bin-i386.zip&amp;amp;lt;/tt&amp;amp;gt; files from the download area. Don't use any of the&lt;br /&gt;
files containing &amp;amp;lt;tt&amp;amp;gt;barebin&amp;amp;lt;/tt&amp;amp;gt;. After extracting the ZIP archive there will&lt;br /&gt;
be an Emacs folder containing a subfolder called &amp;amp;lt;tt&amp;amp;gt;bin&amp;amp;lt;/tt&amp;amp;gt;. Add this folder&lt;br /&gt;
to your Windows &amp;amp;lt;tt&amp;amp;gt;PATH&amp;amp;lt;/tt&amp;amp;gt;. [[#RapidEE|RapidEE]] can help edit the&lt;br /&gt;
&amp;amp;lt;tt&amp;amp;gt;PATH&amp;amp;lt;/tt&amp;amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GPerf ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/gperf/&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/gnuwin32/files/gperf&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 3.0.1&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GPerf is a program that produces C code containing hash functions. The scripts&lt;br /&gt;
that build the Swarm libraries use GPerf to generate some source code files.&lt;br /&gt;
Download &amp;amp;lt;tt&amp;amp;gt;gperf.exe&amp;amp;lt;/tt&amp;amp;gt; from the GnuWin32 site on Sourceforge and place it&lt;br /&gt;
somewhere on your Windows &amp;amp;lt;tt&amp;amp;gt;PATH&amp;amp;lt;/tt&amp;amp;gt;. Again, [[#RapidEE|RapidEE]] can help set the &amp;amp;lt;tt&amp;amp;gt;PATH&amp;amp;lt;/tt&amp;amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RapidEE ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.rapidee.com&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 5.0&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.rapidee.com/en/license Freeware]&lt;br /&gt;
&lt;br /&gt;
The Rapid Environment Editor (RapidEE) is a spiffy tool that makes it easy to inspect and alter the value of Windows environment variables, such as the &amp;amp;lt;tt&amp;amp;gt;PATH&amp;amp;lt;/tt&amp;amp;gt;. RapidEE may be used to edit &amp;amp;amp;quot;System Variables&amp;amp;amp;quot; which will affect all user accounts or &amp;amp;amp;quot;User Variables&amp;amp;amp;quot; which will affect just the current account. Administrative privileges may be required to edit the System Variables.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_1.png|frame|none|alt=The different variables RapidEE can edit]]&lt;br /&gt;
&lt;br /&gt;
Right-clicking on the &amp;amp;lt;tt&amp;amp;gt;Path&amp;amp;lt;/tt&amp;amp;gt; variable in the System Variables or User Variables will bring up a menu that presents the option to &amp;amp;amp;quot;Add value&amp;amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_2.png|frame|none|alt=Adding a new value to the PATH]]&lt;br /&gt;
&lt;br /&gt;
Once the new entry has been added, RapidEE must be told to save the changes. Command line shells, such as &amp;amp;lt;tt&amp;amp;gt;cmd.exe&amp;amp;lt;/tt&amp;amp;gt;, must be restarted in order for them to notice the changes.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_3.png|frame|none|alt=Adding and saving a value]]&lt;br /&gt;
&lt;br /&gt;
== Depends ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.dependencywalker.com/&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 2.2&lt;br /&gt;
&lt;br /&gt;
'''License:''' Freeware&lt;br /&gt;
&lt;br /&gt;
Depends is a usefull utility that scans Windows executables and reports information concerning the Dynamic-link Libraries (DLLs) that those executables require in order to run.&lt;br /&gt;
&lt;br /&gt;
= Software Used to Compile Swarm 2.4.1 =&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!  Name&lt;br /&gt;
!  Verson Used&lt;br /&gt;
!  License&lt;br /&gt;
!  Homepage&lt;br /&gt;
!  Download Area&lt;br /&gt;
|-&lt;br /&gt;
|  ZLib&lt;br /&gt;
|  1.2.5&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG License]&lt;br /&gt;
|  [http://www.zlib.net http://www.zlib.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibFFI&lt;br /&gt;
|  3.0.9&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  [http://sourceware.org/libffi http://sourceware.org/libffi]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibPNG&lt;br /&gt;
|  1.5.4&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG]&lt;br /&gt;
|  [http://www.libpng.org/pub/png/libpng.html http://www.libpng.org/pub/png/libpng.html]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  XPM-NoX&lt;br /&gt;
|  4.2.0&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  unknown&lt;br /&gt;
|  [http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32 http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32]&lt;br /&gt;
|-&lt;br /&gt;
|  Tcl&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Tk&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  BLT&lt;br /&gt;
|  2.4z&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://blt.sourceforge.net http://blt.sourceforge.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  HDF5&lt;br /&gt;
|  1.8.7&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://www.hdfgroup.org/HDF5 http://www.hdfgroup.org/HDF5]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Swarm&lt;br /&gt;
|  2.4.1&lt;br /&gt;
|  [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
|  [http://www.swarm.org http://www.swarm.org]&lt;br /&gt;
|  [http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2156</id>
		<title>Swarm and MinGW</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm_and_MinGW&amp;diff=2156"/>
				<updated>2015-12-02T22:49:49Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Using Swarm Models Compiled with MinGW */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
This documentation provides information on how to use Swarm on Windows with [http://www.mingw.org MinGW] compilers. The following topics will be covered:&lt;br /&gt;
&lt;br /&gt;
* How to run a Swam model compiled with MinGW on Windows: Once you produce a Swarm model using MinGW (or someone gives one to you), how do you run it on other machines without installing Swarm there?&lt;br /&gt;
* How to use MinGW to compile your own Swarm models, either during model development or so you can distribute working models to others. This requires installing MinGW and our binary Swarm libraries.&lt;br /&gt;
* How to package a model compiled with MinGW so it can be installed and run by itself on Windows machines.&lt;br /&gt;
* How to use MinGW to compile the Swarm libraries, in case you want to build your own Swarm binaries.&lt;br /&gt;
&lt;br /&gt;
Each topic is more difficult than the one before it. However the topics are independent in that it is not necessary to know how to compile the Swarm library in order to run a pre-compiled Swarm model or compile your own model against a pre-compiled version of Swarm.&lt;br /&gt;
&lt;br /&gt;
= Using Swarm Models Compiled with MinGW =&lt;br /&gt;
&lt;br /&gt;
A model that has been compiled using MinGW can be installed and run from a Windows computer without installing MinGW or Swarm. An example code is this build of Heatbugs:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe http://download.savannah.gnu.org/releases/swarm/src/testing/heatbugs-MinGW-win32.exe]&lt;br /&gt;
&lt;br /&gt;
However, running a Swarm model requires some support programs and libraries. These are available as&lt;br /&gt;
&amp;amp;lt;tt&amp;amp;gt;swarm-2.4.1-win32.zip&amp;amp;lt;/tt&amp;amp;gt;, available here:&lt;br /&gt;
&lt;br /&gt;
[http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip http://download.savannah.gnu.org/releases/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip]&lt;br /&gt;
&lt;br /&gt;
Unzipping that file will create a folder called &amp;amp;lt;tt&amp;amp;gt;swarm&amp;amp;lt;/tt&amp;amp;gt; which should be moved somewhere that is easy to remember. The rest of this tutorial will assume this Swarm folder has been placed at &amp;amp;lt;tt&amp;amp;gt;C:\swarm&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Before a Swarm model can be run, the &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder must be added to the Windows &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; so that Heatbugs can find necessary libraries when it runs. The &amp;lt;tt&amp;gt;swarm\bin&amp;lt;/tt&amp;gt; folder can be ''temporarily'' added to the path by executing the following in the Windows command line (the command line is accessed using the program &amp;lt;tt&amp;gt;cmd.exe&amp;lt;/tt&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;path=%PATH%;C:\swarm\bin&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, it is possible to have conflicts if other versions of libraries used by Swarm, such as HDF5, are already installed and in your path. And some Swarm programs require that the environment variable SWARMHOME be defined, which will typically not be true. These problems can be avoided by using the following statements instead of the above path command:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
 &lt;br /&gt;
You can alternatively add the Swarm folder to your &amp;amp;lt;tt&amp;amp;gt;PATH&amp;amp;lt;/tt&amp;amp;gt; permanently by editing the Windows PATH environment variable. A tool like [[#RapidEE|RapidEE]] makes doing so easy, or you can use use Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add &amp;amp;lt;tt&amp;amp;gt;swarm\bin&amp;amp;lt;/tt&amp;amp;gt; to the PATH system variable.&lt;br /&gt;
&lt;br /&gt;
Once the path has been set to include the &amp;amp;lt;tt&amp;amp;gt;swarm\bin&amp;amp;lt;/tt&amp;amp;gt; folder, Swarm models can be started through the Windows command line, or by double-clicking on them from the Windows Explorer.  &lt;br /&gt;
&lt;br /&gt;
The Heatbugs model can now be run by changing the directory of the command line to the folder holding &amp;amp;lt;tt&amp;amp;gt;heatbugs.exe&amp;amp;lt;/tt&amp;amp;gt; and then executing the program. For example, if &amp;amp;lt;tt&amp;amp;gt;heatbugs.exe&amp;amp;lt;/tt&amp;amp;gt; is located in &amp;amp;lt;tt&amp;amp;gt;C:\Users\example_user\Downloads&amp;amp;lt;/tt&amp;amp;gt;, then the model may be run as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;cd C:\Users\example_user\Downloads&lt;br /&gt;
heatbugs.exe&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
(or you can just double-click on &amp;amp;lt;tt&amp;amp;gt;heatbugs.exe&amp;amp;lt;/tt&amp;amp;gt; from Windows Explorer, which temporarily opens a Windows command terminal while the model runs.)&lt;br /&gt;
&lt;br /&gt;
[[Image:Running_Heatbugs.png|frame|none|alt=Running the Heatbugs model]]&lt;br /&gt;
&lt;br /&gt;
You can also create a simple Windows batch file that sets SWARMHOME and the path and then executes the model. Create a file called, for example &amp;amp;lt;tt&amp;amp;gt;heatbugs.bat&amp;amp;lt;/tt&amp;amp;gt; in the same directory where &amp;amp;lt;tt&amp;amp;gt;heatbugs.exe&amp;amp;lt;/tt&amp;amp;gt; is, containing these lines: &lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;SWARMHOME=C:\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
heatbugs.exe&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, just double-clicking on &amp;amp;lt;tt&amp;amp;gt;heatbugs.bat&amp;amp;lt;/tt&amp;amp;gt; will start the model.&lt;br /&gt;
&lt;br /&gt;
If you try this and get an error that some .dll file is not found, then the problem is likely that the path is not set correctly to include the swarm\bin folder. If instead the program crashes without an error statement, then the problem is more likely that SWARMHOME needs to be set.&lt;br /&gt;
&lt;br /&gt;
= Installing Swarm and MinGW to compile models =&lt;br /&gt;
&lt;br /&gt;
To compile Swarm models from source using MinGW, the following simple steps need to be taken to set up the build environment:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|Install MinGW using instructions here]]. Currently only 32-bit MinGW can be used with Swarm. Install all components of MinGW.&lt;br /&gt;
* Download compiled Swarm binaries, archived as [http://ftp.swarm.org/pub/swarm/binaries/w32/MinGW/Swarm-2.4.1-win32.zip swarm-2.4.1-win32.zip]. Unzip the archive and place the extracted folder at &amp;amp;lt;tt&amp;amp;gt;C:\swarm&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''NOTE:'''&lt;br /&gt;
&lt;br /&gt;
The archived Swarm binaries '''MUST''' be placed at &amp;amp;lt;tt&amp;amp;gt;C:\swarm&amp;amp;lt;/tt&amp;amp;gt; to successfully compile Swarm models. This is because some paths had to be hard-coded by &amp;amp;lt;tt&amp;amp;gt;libtool&amp;amp;lt;/tt&amp;amp;gt; during the creation of the binaries.&lt;br /&gt;
&lt;br /&gt;
The final step before you can compile a Swarm model is to set the &amp;amp;lt;tt&amp;amp;gt;SWARMHOME&amp;amp;lt;/tt&amp;amp;gt; environment variable so that the &amp;amp;quot;make&amp;amp;quot; program knows where to find the Swarm libraries when compiling your code. There are several ways to do this.&lt;br /&gt;
*You can temporarily set SWARMHOME by entering this command in the MinGW shell: &amp;amp;lt;pre&amp;amp;gt;export SWARMHOME=/c/swarm&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
*You can edit your Makefile so it starts with: &amp;amp;lt;pre&amp;amp;gt;SWARMHOME=/c/swarm&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
*Set SWARMHOME permanently as a Windows environment variable, either by using [[#RapidEE|RapidEE]] or Windows control panel &amp;amp;gt; System &amp;amp;gt; Advanced &amp;amp;gt; Environment Variables to add a new (User or System) variable called SWARMHOME with the value &amp;amp;lt;tt&amp;amp;gt;/c/swarm&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
After MinGW has been installed and the Swarm binaries have been downloaded, Swarm models may be compiled using the MinGW shell. Start up the program MinGW Shell, cd to the directory containing your code and Makefile, and enter the command &amp;amp;quot;Make&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
An archive of official Swarm example programs can be downloaded from:&lt;br /&gt;
&lt;br /&gt;
[http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
&lt;br /&gt;
We will use the &amp;amp;amp;quot;Heatbugs&amp;amp;amp;quot; model as an example of how to compile a Swarm application:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xzf /path/to/downloaded/swarmapps-2.3.0.tar.gz&lt;br /&gt;
cd swarmapps-2.3.0/objc/heatbugs&lt;br /&gt;
&lt;br /&gt;
make&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
'''VERY IMPORTANT NOTE: MinGW produces two executables called &amp;amp;lt;tt&amp;amp;gt;heatbugs.exe&amp;amp;lt;/tt&amp;amp;gt;---one in the &amp;amp;lt;tt&amp;amp;gt;heatbugs&amp;amp;lt;/tt&amp;amp;gt; folder and another in the &amp;amp;lt;tt&amp;amp;gt;heatbugs/.libs&amp;amp;lt;/tt&amp;amp;gt; folder. You should ignore the executable in the top-level folder, &amp;amp;lt;tt&amp;amp;gt;heatbugs/heatbugs.exe&amp;amp;lt;/tt&amp;amp;gt;, as it is merely a compiled wrapper script that executes &amp;amp;lt;tt&amp;amp;gt;heatbugs/.libs/heatbugs.exe&amp;amp;lt;/tt&amp;amp;gt;. When distributing compiled models, only use binaries from the &amp;amp;lt;tt&amp;amp;gt;.libs&amp;amp;lt;/tt&amp;amp;gt; folder.'''&lt;br /&gt;
&lt;br /&gt;
The resulting executable, &amp;amp;lt;tt&amp;amp;gt;.libs/heatbugs.exe&amp;amp;lt;/tt&amp;amp;gt; may be executing by following the steps described above at ''Using Swarm Models Compiled with MinGW''. These steps must include setting the Windows Path to include &amp;amp;lt;tt&amp;amp;gt;C:\swarm\bin&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Distributing a Swarm Model for Windows Users =&lt;br /&gt;
&lt;br /&gt;
A major benefit of the MinGW version of Swarm is that models can be distributed for people to use without installing Swarm. A simple way to do this, after the model has been compiled and tested using methods in the previous section, is to create a ZIP archive that contains all the files to run the model.&lt;br /&gt;
&lt;br /&gt;
* Create a directory tree that includes the Swarm binary files. For example, create C:\MySwarmModel and add the Swarm binaries (as described [[Swarm_and_MinGW#Using_Swarm_Models_Compiled_with_MinGW|above]]) to it as a subdirectory tree.&lt;br /&gt;
* Create another subdirectory that includes just the compiled model.&lt;br /&gt;
* Create a third subdirectory that includes any input files that the model needs and a batch file that sets the path and executes the model. &lt;br /&gt;
* Zip the whole tree up for distribution.&lt;br /&gt;
&lt;br /&gt;
The directory tree in the zip file looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;&lt;br /&gt;
C:\MySwarmModel\swarm&lt;br /&gt;
                      \bin&lt;br /&gt;
                      \etc&lt;br /&gt;
                      \include&lt;br /&gt;
                      \lib&lt;br /&gt;
                      \man&lt;br /&gt;
                      \share&lt;br /&gt;
               \executable\MySwarmModel.exe&lt;br /&gt;
               \Runfiles\MySwarmModel.bat (and any input files)&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the file &amp;amp;lt;tt&amp;amp;gt;MySwarmModel.bat&amp;amp;lt;/tt&amp;amp;gt; contains:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;&lt;br /&gt;
set SWARMHOME=C:\MySwarmModel\swarm&lt;br /&gt;
path=%SWARMHOME%\bin;%PATH%&lt;br /&gt;
C:\MySwarmModel\executable\MySwarmModel.exe&lt;br /&gt;
&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then users can run the model just by double-clicking on &amp;amp;lt;tt&amp;amp;gt;MySwarmModel.bat&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
= Building Swarm Using MinGW =&lt;br /&gt;
&lt;br /&gt;
This tutorial provides directions and code for compiling your own Swarm libraries for Windows. It is a bit advanced---some familiarity with compiling software from source in a Linux environment and knowledge of the UNIX command line is assumed.&lt;br /&gt;
&lt;br /&gt;
== Install Required Tools ==&lt;br /&gt;
&lt;br /&gt;
The first step is to download and install tools required for compiling Swarm. These links provide directions:&lt;br /&gt;
&lt;br /&gt;
* [[#MinGW|MinGW]]&lt;br /&gt;
* [[#Emacs|Emacs]]&lt;br /&gt;
* [[#GPerf|GPerf]]&lt;br /&gt;
&lt;br /&gt;
== Build Support Libraries ==&lt;br /&gt;
&lt;br /&gt;
The next steps are to build and install the libraries that Swarm depends on. A ZIP archive containing all the source code required can be found at:&lt;br /&gt;
&lt;br /&gt;
[http://ftp.swarm.org/pub/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip http://ftp.swarm.org/pub/swarm/src/swarm/Swarm-2.4.1-MinGW-sources.zip]&lt;br /&gt;
&lt;br /&gt;
This archive contains two subdirectories:&lt;br /&gt;
&lt;br /&gt;
* sources: This folder contains the source code for each component.&lt;br /&gt;
* patches: This folder contains patchfiles that modfy source code so that MinGW can compile it.&lt;br /&gt;
&lt;br /&gt;
After downloading and extracting the source code archive, open up a MinGW shell and run the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
mkdir build&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
The following steps will all assume your MinGW shell is operating out of the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory. All compiled software will be installed to &amp;amp;lt;tt&amp;amp;gt;/c/swarm&amp;amp;lt;/tt&amp;amp;gt; (The Windows Explorer will see the folder appear at &amp;amp;lt;tt&amp;amp;gt;C:\swarm&amp;amp;lt;/tt&amp;amp;gt;).&lt;br /&gt;
&lt;br /&gt;
=== ZLib ===&lt;br /&gt;
&lt;br /&gt;
ZLib will be the first library to be built as it is a common dependency for many of the other software components. From the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, execute the following to build Zlib:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xzf ../sources/zlib-1.2.5.tar.gz&lt;br /&gt;
cd zlib-1.2.5&lt;br /&gt;
make -f win32/Makefile.gcc&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
And then the following commands to install ZLib to &amp;amp;lt;tt&amp;amp;gt;/c/swarm&amp;amp;lt;/tt&amp;amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;mkdir -p /c/swarm/bin&lt;br /&gt;
mkdir -p /c/swarm/include&lt;br /&gt;
mkdir -p /c/swarm/lib&lt;br /&gt;
&lt;br /&gt;
cp zlib1.dll /c/swarm/bin/&lt;br /&gt;
cp zconf.h zlib.h /c/swarm/include/&lt;br /&gt;
mv libzdll.a libz.dll.a&lt;br /&gt;
cp *.a /c/swarm/lib&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== LibPNG ===&lt;br /&gt;
&lt;br /&gt;
LibPNG will be built next as its only dependency is ZLib. From the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, execute the following steps to build and install LibPNG:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xjf ../sources/libpng-1.5.4.tar.bz2&lt;br /&gt;
cd libpng-1.5.4&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm --with-zlib-prefix=/c/swarm&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XPM ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, the XPM library can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xjf ../sources/xpm-nox-4.2.0.tar.bz2&lt;br /&gt;
cd xpm-nox-4.2.0&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/xpm-nox-4.2.0-mingw-tcl.patch&lt;br /&gt;
&lt;br /&gt;
make CC=gcc&lt;br /&gt;
make install prefix=/c/swarm&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
The patchfile is inherited from the SUSE builds of XPM for MinGW and adds Makefiles and other critical components.&lt;br /&gt;
&lt;br /&gt;
One major modification has been made to the SUSE patchfile---&amp;amp;lt;tt&amp;amp;gt;tcl.h&amp;amp;lt;/tt&amp;amp;gt; is included in &amp;amp;lt;tt&amp;amp;gt;xpm.h&amp;amp;lt;/tt&amp;amp;gt;. This is required in order to use XPM while Tk is installed. Conversely, this means that this build of XPM cannot be used without having Tk installed.&lt;br /&gt;
&lt;br /&gt;
=== LibFFI ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, LibFFI can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xzf ../sources/libffi-3.0.9.tar.gz&lt;br /&gt;
cd libffi-3.0.9&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
The LibFFI headers get installed in a weird place.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;mv /c/swarm/lib/libffi-3.0.9/include/*.h /c/swarm/include&lt;br /&gt;
rm -rf /c/swarm/lib/libffi-3.0.9&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tcl ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, Tcl can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xzf ../sources/tcl8.4.19-src.tar.gz&lt;br /&gt;
cd tcl8.4.19&lt;br /&gt;
patch -p1 &amp;amp;amp;lt; ../../patches/tcl-8.4.19-fix-lvalues.patch&lt;br /&gt;
cd win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
At two places in the TCL source code, an assignment is made while simultaneously performing a typecast. The typecast and the assignment had to be split into separate operations in order to be acceptable to the MinGW compilers.&lt;br /&gt;
&lt;br /&gt;
=== Tk ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, Tk can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xzf ../sources/tk8.4.19-src.tar.gz&lt;br /&gt;
cd tk8.4.19/win&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm&lt;br /&gt;
make&lt;br /&gt;
make install&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BLT ===&lt;br /&gt;
&lt;br /&gt;
Starting from the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, BLT can be built and installed as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xzf ../sources/BLT2.4z.tar.gz&lt;br /&gt;
cd blt2.4z&lt;br /&gt;
&lt;br /&gt;
./configure --prefix=/c/swarm --without-x&lt;br /&gt;
make&lt;br /&gt;
make install&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== HDF5 (Optional) ===&lt;br /&gt;
&lt;br /&gt;
Getting HDF5 to work with MinGW is a little tricky. It is an optional dependency, so if support for reading and writing &amp;amp;lt;tt&amp;amp;gt;.hdf&amp;amp;lt;/tt&amp;amp;gt; files is not needed this section can be skipped.&lt;br /&gt;
&lt;br /&gt;
As of version 1.8.7, HDF5 currently does not compile under MinGW. So, we must wrap pre-compiled binaries for use with MinGW. In order to wrap the binaries, we will need an additional tool called &amp;amp;lt;tt&amp;amp;gt;pexports&amp;amp;lt;/tt&amp;amp;gt;. This can be installed using &amp;amp;lt;tt&amp;amp;gt;mingw-get&amp;amp;lt;/tt&amp;amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;mingw-get install mingw-utils&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
Download 32-bit Windows binaries from the HDF website compiled for use with the Visual Studio compilers (these files have &amp;amp;amp;quot;VS&amp;amp;amp;quot; listed under the ''Compilers'' section). After extracting the archive, the HDF5 libraries can be wrapped for use with MinGW by executing the following commands:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;cd path/to/where/HDF5/was/extracted&lt;br /&gt;
&lt;br /&gt;
for dll in `ls dll/*dll`; do&lt;br /&gt;
  def_file=`basename $dll .dll`.def&lt;br /&gt;
  lib_file=lib`basename $dll dll.dll`.a&lt;br /&gt;
  pexports $dll &amp;amp;amp;gt; $def_file&lt;br /&gt;
  dlltool -d $def_file -l lib/$lib_file&lt;br /&gt;
done&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
Next, move the libraries and header files needed to use HDF5 from C into &amp;amp;lt;tt&amp;amp;gt;C:\swarm&amp;amp;lt;/tt&amp;amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;cp dll/hdf5dll.dll dll/szip.dll /c/swarm/bin&lt;br /&gt;
cp include/* /c/swarm/include&lt;br /&gt;
cp lib/libhdf5.a /c/swarm/lib&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
Finally, a patch must be applied to the HDF header file &amp;amp;lt;tt&amp;amp;gt;H5public.h&amp;amp;lt;/tt&amp;amp;gt; so that it doesn't define &amp;amp;lt;tt&amp;amp;gt;ssize_t&amp;amp;lt;/tt&amp;amp;gt;---a constant already defined by MinGW. The required patch is contained in the Swarm MinGW source archive:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;cd /path/to/where/swarm/source/was/extracted&lt;br /&gt;
patch -p1 -d /c/swarm &amp;amp;amp;lt; patches/hdf5-1.8.7-mingw.patch&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Build Swarm ==&lt;br /&gt;
&lt;br /&gt;
Finally, the Swarm libraries themselves can be built. From the &amp;amp;lt;tt&amp;amp;gt;build&amp;amp;lt;/tt&amp;amp;gt; directory, execute the following&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;tar xzf ../sources/swarm-2.4.1.tar.gz&lt;br /&gt;
cd swarm-2.4.1&lt;br /&gt;
patch -p1 ../../patches/swarm-2.4.1-mingw.patch&lt;br /&gt;
&lt;br /&gt;
export CPPFLAGS='-I/c/swarm/include'&lt;br /&gt;
export LDFLAGS='-L/c/swarm/lib'&lt;br /&gt;
./configure --prefix=/c/swarm \&lt;br /&gt;
  --with-zlibdir=/c/swarm \&lt;br /&gt;
  --with-pngdir=/c/swarm \&lt;br /&gt;
  --with-xpmdir=/c/swarm \&lt;br /&gt;
  --with-ffidir=/c/swarm \&lt;br /&gt;
  --with-tcl=/c/swarm/lib \&lt;br /&gt;
  --with-tk=/c/swarm/lib \&lt;br /&gt;
  --with-bltdir=/c/swarm&lt;br /&gt;
&lt;br /&gt;
cd avcall&lt;br /&gt;
gcc -S avcall-i386.c&lt;br /&gt;
cd ..&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
If you wrapped HDF5 up for use with MinGW, add &amp;amp;lt;tt&amp;amp;gt;--with-hdf5dir=/c/swarm&amp;amp;lt;/tt&amp;amp;gt; to the list of arguments passed to &amp;amp;lt;tt&amp;amp;gt;configure&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
'''Summary of patchfile changes:'''&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;tt&amp;amp;gt;swarm-2.4.1-mingw.patch&amp;amp;lt;/tt&amp;amp;gt; modifies the Swarm source code in the following ways:&lt;br /&gt;
&lt;br /&gt;
* &amp;amp;lt;tt&amp;amp;gt;gettimeofday&amp;amp;lt;/tt&amp;amp;gt; is no longer defined in the Swarm sources as MinGW includes this function in its standard library.&lt;br /&gt;
* Swarm GUI functions are updated to be compatible with LibPNG 1.5.&lt;br /&gt;
* The Swarm &amp;amp;lt;tt&amp;amp;gt;configure&amp;amp;lt;/tt&amp;amp;gt; script defines &amp;amp;lt;tt&amp;amp;gt;DATADIR&amp;amp;lt;/tt&amp;amp;gt; as a preprocessor macro---this conflicts with variables in the GCC Objective-C library. &amp;amp;lt;tt&amp;amp;gt;DATDIR&amp;amp;lt;/tt&amp;amp;gt; is &amp;amp;lt;tt&amp;amp;gt;undef&amp;amp;lt;/tt&amp;amp;gt;ed in critical parts of the source code.&lt;br /&gt;
* The &amp;amp;lt;tt&amp;amp;gt;sleep&amp;amp;lt;/tt&amp;amp;gt; function is aliased to &amp;amp;lt;tt&amp;amp;gt;usleep&amp;amp;lt;/tt&amp;amp;gt;---which is the name of the MinGW implementation.&lt;br /&gt;
* The way in which Makefiles invoke &amp;amp;lt;tt&amp;amp;gt;gperf&amp;amp;lt;/tt&amp;amp;gt; is amended so that it actually produces output.&lt;br /&gt;
* NULL checks are added to `zstrdup` in src/defobj/internal.m. Some functions in the Swarm library may attempt to call `zstrdup` on a NULL pointer. (This happens if the SWARMHOME environment variable is not set.) Failing to check for this condition can lead to segfaults. `zstrdup` now returns NULL if passed a NULL string or if `alloc` fails to allocate memory for a duplicate.&lt;br /&gt;
&lt;br /&gt;
Full details are contained in the patchfile.&lt;br /&gt;
&lt;br /&gt;
= Tools =&lt;br /&gt;
&lt;br /&gt;
== MinGW ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.mingw.org&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/mingw/files&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 20110530&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
[http://www.mingw.org MinGW] is a set of software that aims to provide an environment where software developed on UNIX-like systems can be easily compiled for Windows. Since Swarm is primarily developed on Linux (a UNIX clone), MinGW can ease the task of creating Swarm models that run on Windows.&lt;br /&gt;
&lt;br /&gt;
MinGW is similar to the [http://www.cygwin.org Cygwin] project. The major difference is that MinGW produces executables that depend only on native Windows libraries while Cygwin executables require special compatibility libraries that are part of the Cygwin distribution.&lt;br /&gt;
&lt;br /&gt;
=== Installing MinGW ===&lt;br /&gt;
&lt;br /&gt;
MinGW can be installed by downloading the &amp;amp;amp;quot;Automated MinGW Installer&amp;amp;amp;quot;, which usually has a name like &amp;amp;lt;tt&amp;amp;gt;mingw-get-inst-&amp;amp;amp;lt;date&amp;amp;amp;gt;.exe&amp;amp;lt;/tt&amp;amp;gt; where &amp;amp;lt;tt&amp;amp;gt;&amp;amp;amp;lt;date&amp;amp;amp;gt;&amp;amp;lt;/tt&amp;amp;gt; is the datestamp for when the installer was packaged. Running this executable will start the installation process. The installer lets you select which optional components to install; make sure all boxes are checked so you '''install all components'''.&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Setup.png|frame|none|alt=Install all available MinGW components]]&lt;br /&gt;
&lt;br /&gt;
The installer downloads all components from the internet. This will take a while, so have a cup of coffee or walk the dog.&lt;br /&gt;
&lt;br /&gt;
See the following section about also installing an optional, more-functional shell window for MinGW.&lt;br /&gt;
&lt;br /&gt;
=== Using MinGW ===&lt;br /&gt;
&lt;br /&gt;
The MinGW compilers are accessible through the &amp;amp;amp;quot;MinGW Shell&amp;amp;amp;quot; which should be located under the MinGW folder in the Start Menu:&lt;br /&gt;
&lt;br /&gt;
[[Image:MinGW_Shell.png|frame|none|alt=Location of MinGW Shell]]&lt;br /&gt;
&lt;br /&gt;
or by running &amp;amp;lt;tt&amp;amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;amp;lt;/tt&amp;amp;gt; (if MinGW was installed to its default location).&lt;br /&gt;
&lt;br /&gt;
By default the MinGW shell executes inside of a Windows &amp;amp;lt;tt&amp;amp;gt;cmd.exe&amp;amp;lt;/tt&amp;amp;gt; terminal. There are a couple major drawbacks to this:&lt;br /&gt;
&lt;br /&gt;
* You cannot resize the window to full-screen.&lt;br /&gt;
* The shell provides limited history scrollback.&lt;br /&gt;
&lt;br /&gt;
MinGW provides a couple of alternative terminals for the MinGW shell which do not have these drawbacks; one of which is called MinTTY. To install MinTTY execute the following in a MinGW shell:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;mingw-get install mintty&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
Then the &amp;amp;lt;tt&amp;amp;gt;mintty&amp;amp;lt;/tt&amp;amp;gt; command can be used to launch a MinTTY terminal. The MinGW Shell can also be set to launch MinTTY by default by editing the file &amp;amp;lt;tt&amp;amp;gt;C:\MinGW\msys\1.0\msys.bat&amp;amp;lt;/tt&amp;amp;gt; and changing the following line (approximately line 58):&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=sh.exe&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
to:&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;pre&amp;amp;gt;if &amp;amp;amp;quot;x%MSYSCON%&amp;amp;amp;quot; == &amp;amp;amp;quot;xunknown&amp;amp;amp;quot; set MSYSCON=mintty.exe&amp;amp;lt;/pre&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== A Note About Paths ===&lt;br /&gt;
&lt;br /&gt;
The MinGW Shell emulates a UNIX &amp;amp;lt;tt&amp;amp;gt;bash&amp;amp;lt;/tt&amp;amp;gt; shell and thus uses UNIX-style paths, &amp;amp;lt;tt&amp;amp;gt;/path/to/file&amp;amp;lt;/tt&amp;amp;gt;, instead of Windows-style paths, &amp;amp;lt;tt&amp;amp;gt;C:\path\to\file&amp;amp;lt;/tt&amp;amp;gt;. One peculiarity of this process is that the shell must deal with the fact that Windows filesystems have multiple roots (&amp;amp;lt;tt&amp;amp;gt;C:&amp;amp;lt;/tt&amp;amp;gt;, &amp;amp;lt;tt&amp;amp;gt;D:&amp;amp;lt;/tt&amp;amp;gt;, etc.) while a UNIX filesystem only has one root called &amp;amp;lt;tt&amp;amp;gt;/&amp;amp;lt;/tt&amp;amp;gt;. The way this is reconciled by the &amp;amp;lt;tt&amp;amp;gt;bash&amp;amp;lt;/tt&amp;amp;gt; shell provided with MinGW is that &amp;amp;lt;tt&amp;amp;gt;/c&amp;amp;lt;/tt&amp;amp;gt; refers to the root of the &amp;amp;lt;tt&amp;amp;gt;C:&amp;amp;lt;/tt&amp;amp;gt; drive, &amp;amp;lt;tt&amp;amp;gt;/d&amp;amp;lt;/tt&amp;amp;gt; refers to the root of the &amp;amp;lt;tt&amp;amp;gt;D:&amp;amp;lt;/tt&amp;amp;gt; drive and so on and so forth.&lt;br /&gt;
&lt;br /&gt;
The root of the filesystem itself, &amp;amp;lt;tt&amp;amp;gt;/&amp;amp;lt;/tt&amp;amp;gt;, also has some caveats. &amp;amp;lt;tt&amp;amp;gt;/&amp;amp;lt;/tt&amp;amp;gt; refers to the &amp;amp;lt;tt&amp;amp;gt;mysy&amp;amp;lt;/tt&amp;amp;gt; folder, &amp;amp;lt;tt&amp;amp;gt;C:/MinGW/mysys/1.0&amp;amp;lt;/tt&amp;amp;gt; in a default installation. &amp;amp;lt;tt&amp;amp;gt;/usr&amp;amp;lt;/tt&amp;amp;gt; also refers to the same location. Thus, &amp;amp;lt;tt&amp;amp;gt;/usr/local&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;/local&amp;amp;lt;/tt&amp;amp;gt; both refer to &amp;amp;lt;tt&amp;amp;gt;C:/MinGW/mysys/1.0/local&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== A Note About MinGW-64 ===&lt;br /&gt;
&lt;br /&gt;
Currently Swarm has been developed and tested against the 32-bit version of MinGW. Hence Swarm models produced this way should run in any version of Windows.&lt;br /&gt;
&lt;br /&gt;
The [MinGW-w64][mingw_65] project produces 64-bit MinGW compilers that can produce 64-bit executables that will only run on 64-bit versions of Windows. These executables benefit from:&lt;br /&gt;
&lt;br /&gt;
* Access to more memory. A 32-bit executable will only be able to allocate ~3 GB of RAM---even if the system has more RAM available.&lt;br /&gt;
* Possibly quicker execution speeds due to matching the native architecture of the operating system---however this depends on the types of tasks that the program executes. It has been reported that 64 bit Swarm executables run quicker than 32 bit Swarm executables on Linux.&lt;br /&gt;
&lt;br /&gt;
Currently, no attempt has been made to compile Swarm 2.4.1 with the 64 bit MinGW compilers. If a successful attempt is made, please report it on the [http://www.swarm.org/mailman/listinfo/support Swarm mailing list].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Emacs ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/emacs&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 23.3&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://ftp.gnu.org/gnu/emacs/windows&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GNU Emacs is a text editor that is used by many programmers to edit code. However, Emacs can also be scripted to perform a variety of complicated transformations on text files. The scripts that build the Swarm libraries use Emacs to automate the process of generating some source files. Thus Emacs has to be installed in order to build Swarm from source.&lt;br /&gt;
&lt;br /&gt;
=== Installing Emacs ===&lt;br /&gt;
&lt;br /&gt;
Install Emacs by downloading one of the &amp;amp;lt;tt&amp;amp;gt;emacs-&amp;amp;amp;lt;version&lt;br /&gt;
number&amp;amp;amp;gt;-bin-i386.zip&amp;amp;lt;/tt&amp;amp;gt; files from the download area. Don't use any of the&lt;br /&gt;
files containing &amp;amp;lt;tt&amp;amp;gt;barebin&amp;amp;lt;/tt&amp;amp;gt;. After extracting the ZIP archive there will&lt;br /&gt;
be an Emacs folder containing a subfolder called &amp;amp;lt;tt&amp;amp;gt;bin&amp;amp;lt;/tt&amp;amp;gt;. Add this folder&lt;br /&gt;
to your Windows &amp;amp;lt;tt&amp;amp;gt;PATH&amp;amp;lt;/tt&amp;amp;gt;. [[#RapidEE|RapidEE]] can help edit the&lt;br /&gt;
&amp;amp;lt;tt&amp;amp;gt;PATH&amp;amp;lt;/tt&amp;amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== GPerf ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.gnu.org/software/gperf/&lt;br /&gt;
&lt;br /&gt;
'''Download Area:''' http://sourceforge.net/projects/gnuwin32/files/gperf&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 3.0.1&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
&lt;br /&gt;
GPerf is a program that produces C code containing hash functions. The scripts&lt;br /&gt;
that build the Swarm libraries use GPerf to generate some source code files.&lt;br /&gt;
Download &amp;amp;lt;tt&amp;amp;gt;gperf.exe&amp;amp;lt;/tt&amp;amp;gt; from the GnuWin32 site on Sourceforge and place it&lt;br /&gt;
somewhere on your Windows &amp;amp;lt;tt&amp;amp;gt;PATH&amp;amp;lt;/tt&amp;amp;gt;. Again, [[#RapidEE|RapidEE]] can help set the &amp;amp;lt;tt&amp;amp;gt;PATH&amp;amp;lt;/tt&amp;amp;gt; variable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== RapidEE ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.rapidee.com&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 5.0&lt;br /&gt;
&lt;br /&gt;
'''License:''' [http://www.rapidee.com/en/license Freeware]&lt;br /&gt;
&lt;br /&gt;
The Rapid Environment Editor (RapidEE) is a spiffy tool that makes it easy to inspect and alter the value of Windows environment variables, such as the &amp;amp;lt;tt&amp;amp;gt;PATH&amp;amp;lt;/tt&amp;amp;gt;. RapidEE may be used to edit &amp;amp;amp;quot;System Variables&amp;amp;amp;quot; which will affect all user accounts or &amp;amp;amp;quot;User Variables&amp;amp;amp;quot; which will affect just the current account. Administrative privileges may be required to edit the System Variables.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_1.png|frame|none|alt=The different variables RapidEE can edit]]&lt;br /&gt;
&lt;br /&gt;
Right-clicking on the &amp;amp;lt;tt&amp;amp;gt;Path&amp;amp;lt;/tt&amp;amp;gt; variable in the System Variables or User Variables will bring up a menu that presents the option to &amp;amp;amp;quot;Add value&amp;amp;amp;quot;:&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_2.png|frame|none|alt=Adding a new value to the PATH]]&lt;br /&gt;
&lt;br /&gt;
Once the new entry has been added, RapidEE must be told to save the changes. Command line shells, such as &amp;amp;lt;tt&amp;amp;gt;cmd.exe&amp;amp;lt;/tt&amp;amp;gt;, must be restarted in order for them to notice the changes.&lt;br /&gt;
&lt;br /&gt;
[[Image:RapidEE_3.png|frame|none|alt=Adding and saving a value]]&lt;br /&gt;
&lt;br /&gt;
== Depends ==&lt;br /&gt;
&lt;br /&gt;
'''Homepage:''' http://www.dependencywalker.com/&lt;br /&gt;
&lt;br /&gt;
'''Version Used:''' 2.2&lt;br /&gt;
&lt;br /&gt;
'''License:''' Freeware&lt;br /&gt;
&lt;br /&gt;
Depends is a usefull utility that scans Windows executables and reports information concerning the Dynamic-link Libraries (DLLs) that those executables require in order to run.&lt;br /&gt;
&lt;br /&gt;
= Software Used to Compile Swarm 2.4.1 =&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
!  Name&lt;br /&gt;
!  Verson Used&lt;br /&gt;
!  License&lt;br /&gt;
!  Homepage&lt;br /&gt;
!  Download Area&lt;br /&gt;
|-&lt;br /&gt;
|  ZLib&lt;br /&gt;
|  1.2.5&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG License]&lt;br /&gt;
|  [http://www.zlib.net http://www.zlib.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibFFI&lt;br /&gt;
|  3.0.9&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  [http://sourceware.org/libffi http://sourceware.org/libffi]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  LibPNG&lt;br /&gt;
|  1.5.4&lt;br /&gt;
|  [http://www.opensource.org/licenses/Zlib ZLib/PNG]&lt;br /&gt;
|  [http://www.libpng.org/pub/png/libpng.html http://www.libpng.org/pub/png/libpng.html]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  XPM-NoX&lt;br /&gt;
|  4.2.0&lt;br /&gt;
|  [http://www.opensource.org/licenses/MIT MIT]&lt;br /&gt;
|  unknown&lt;br /&gt;
|  [http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32 http://build.opensuse.org/package/files?package=mingw32-xpm-nox&amp;amp;amp;project=windows%3Amingw%3Awin32]&lt;br /&gt;
|-&lt;br /&gt;
|  Tcl&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Tk&lt;br /&gt;
|  8.4.19&lt;br /&gt;
|  [http://www.tcl.tk/software/tcltk/license.html Tcl]&lt;br /&gt;
|  [http://www.tcl.tk http://www.tcl.tk]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  BLT&lt;br /&gt;
|  2.4z&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://blt.sourceforge.net http://blt.sourceforge.net]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  HDF5&lt;br /&gt;
|  1.8.7&lt;br /&gt;
|  [http://www.opensource.org/licenses/BSD-3-Clause BSD]&lt;br /&gt;
|  [http://www.hdfgroup.org/HDF5 http://www.hdfgroup.org/HDF5]&lt;br /&gt;
|  --&lt;br /&gt;
|-&lt;br /&gt;
|  Swarm&lt;br /&gt;
|  2.4.1&lt;br /&gt;
|  [http://www.opensource.org/licenses/GPL-3.0 GPL]&lt;br /&gt;
|  [http://www.swarm.org http://www.swarm.org]&lt;br /&gt;
|  [http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz http://ftp.swarm.org/pub/swarm/src/swarm/swarmapps-2.3.0.tar.gz]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Windows_binary_notes&amp;diff=2155</id>
		<title>Windows binary notes</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Windows_binary_notes&amp;diff=2155"/>
				<updated>2015-12-02T22:42:28Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: Created page with &amp;quot;{{SwarmFAQ}}  '''This page refers to Swarm 2.2 in Cygwin; we now strongly recommend instead using Swarm in Windows via the MinGW compiler. See Swarm_and_MinGW|the MinGW rele...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SwarmFAQ}}&lt;br /&gt;
&lt;br /&gt;
'''This page refers to Swarm 2.2 in Cygwin; we now strongly recommend instead using Swarm in Windows via the MinGW compiler. See [[Swarm_and_MinGW|the MinGW release page]].'''&lt;br /&gt;
&lt;br /&gt;
==Q: How do I install the Windows binary distribution of Objective-C Swarm-2.2?==&lt;br /&gt;
&lt;br /&gt;
A: Is in several parts, below. Note that Java Swarm 2.2 no longer requires Cygwin, only a simple download (see the [[Swarm:_stable_release|stable release page]]).&lt;br /&gt;
&lt;br /&gt;
===Windows-specific differences from Swarm-2.1.1===&lt;br /&gt;
&lt;br /&gt;
Unlike the previous stable version of Swarm, version 2.2 runs reliably under Windows XP. Objective-C users may notice less of an execution speed penalty for running in Windows, compared to Linux, depending on the application. If you were an Objective-C user of Swarm-2.1.1, you will notice that Version 2.2 uses a new Obj-C compiler that behaves differently in minor ways. For example, it produces more output while linking (just where you would get fatal error messages in the old compiler), and it may balk (or give warning messages) at minor programming faux pas that the previous compiler ignored.&lt;br /&gt;
&lt;br /&gt;
===Changes in how Objective-C Swarm Windows binaries are distributed===&lt;br /&gt;
&lt;br /&gt;
For Windows, Objective-C Swarm works within the Unix-like environment provided by Cygwin (http://www.cygwin.com). However, the approach to installing Cygwin and Swarm has changed. Version 2.1.1 (and earlier stable Windows distributions) included Cygwin in the Swarm distribution, so installing Swarm also installed Cygwin. Then, in the development versions preceding 2.2, it was necessary to first install Cygwin, then install Swarm within Cygwin.&lt;br /&gt;
&lt;br /&gt;
With Version 2.2, we are now including Swarm as a package within a special Cygwin distribution. (Swarm is *not*, and probably never will be, distributed by Cygwin as a part of their standard distributions.) You should not install Cygwin separately first; instead, just use the Swarm-specific Cygwin setup program we provide. &lt;br /&gt;
&lt;br /&gt;
Note that the Cygwin distributed with Swarm-2.2 is the version of Cygwin that was current as of December, 2004. We do not plan to update our distribution to keep current with future changes in Cygwin. If you want to update your Cygwin in the future, you can do so from the Cygwin site but you will be responsible for any effects it has on Swarm. &lt;br /&gt;
&lt;br /&gt;
The Cygwin setup program lets you select which packages to install. Cygwin distributes a wide variety of packages that do many different things, most of which are not used by Swarm, and the complete distribution is very large. If you follow the default selections during setup, you will get a version of Cygwin that includes everything you need to run Swarm and do other basic things, but many of the unrelated optional packages will not be installed. Using the default setup, you should end up with about 135 megabytes of installed code.&lt;br /&gt;
&lt;br /&gt;
===How to distribute Swarm-2.2 Windows binaries yourself===&lt;br /&gt;
&lt;br /&gt;
Sometimes it is desirable to put Swarm on a CD so you can distribute it yourself, for example so your clients can install and run your model. Unfortunately, we are still without a simple, reliable way to do this with Objective-C Swarm 2.2. &lt;br /&gt;
&lt;br /&gt;
Among the setup program's options is the ability to download the install files from the internet to a local directory, then install from the local directory. This seems like a good way to distribute Swarm-2.2: download the install files and put them and the setup program on a CD, so others can install from the CD. '''HOWEVER''' there apparently is a bug in the Cygwin setup program that can keep this from working: you may be able to install from a local directory (CD or hard disk) but then Cygwin may not work. Only the setup program's option to install from the internet seems to be reliable.&lt;br /&gt;
&lt;br /&gt;
The only option currently available is collection of packages that Pietro Terna developed to install Cygwin separately, then install Swarm within Cygwin. The files and information are at http://eco83.econ.unito.it/swarm/materiale/cd/ : look at the readme.txt file. This distribution contains also other useful things. Pietro has even very kindly been distributing CDs upon request.&lt;br /&gt;
&lt;br /&gt;
===Installing the Windows binaries===&lt;br /&gt;
&lt;br /&gt;
#Uninstall any previous versions of Cygwin or Swarm. For previous installations of Cygwin, just delete all its files.&lt;br /&gt;
#Execute (directly, or after first downloading it) the Swarm-specific Cygwin setup program, which is here: http://ftp.swarm.org/pub/swarm/binaries/w32/cygwin/setup.exe&lt;br /&gt;
#Select the download source as &amp;quot;Install from internet&amp;quot;.&lt;br /&gt;
#When this setup program asks you which site to download from, select &amp;quot;ftp.swarm.org&amp;quot;.&lt;br /&gt;
#If in doubt, just hit &amp;quot;Next&amp;quot; for all other selections. A window lets you select which components of Cygwin you want to install; it is safest to just hit &amp;quot;Next&amp;quot; and not change anything.&lt;br /&gt;
#One of the setup options is whether to use Unix or Windows file types. Unix and Windows have different line end characters in ASCII files, and this option determines which type your Swarm model will expect and produce. If you choose Unix, your Swarm code will expect input files to be in Unix format and will not be able to read files generated by Windows applications like Excel. (Cygwin includes the two utilities &amp;quot;dos2unix&amp;quot; and &amp;quot;unix2dos&amp;quot; that convert files, but be aware that these utilities will ruin your executable files if they attempt to convert them.)&lt;br /&gt;
&lt;br /&gt;
===Setting SWARMHOME===&lt;br /&gt;
&lt;br /&gt;
In Version 2.2, the environment variable SWARMHOME should be set to &amp;quot;/usr&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You can set it in your makefile, or you can temporarily set SWARMHOME from the Cygwin terminal window by entering:&lt;br /&gt;
&lt;br /&gt;
    export SWARMHOME=/usr&lt;br /&gt;
&lt;br /&gt;
Or you can permanently set SWARMHOME by (a) going to the Windows control panel and opening the System window; (b) clicking on the &amp;quot;Advanced&amp;quot; tab in the System window; (c) clicking on the &amp;quot;Environment variables&amp;quot; button; (d) in the &amp;quot;User variables&amp;quot; window, create a new environment variable called SWARMHOME with the value: &lt;br /&gt;
&lt;br /&gt;
    C:\Cygwin\usr&lt;br /&gt;
&lt;br /&gt;
Or you can permanently set SWARMHOME by creating a file named &amp;quot;.bashrc&amp;quot; that includes at least these two lines:&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    export SWARMHOME=/usr&lt;br /&gt;
&lt;br /&gt;
Save the file in your Cygwin home directory. &lt;br /&gt;
&lt;br /&gt;
Note: Your Cygwin home directory is the directory that Cygwin starts up in. It usually is:&lt;br /&gt;
 C:\Documents and Settings\(your user name). &lt;br /&gt;
Or, sometimes:&lt;br /&gt;
 c:\cygwin\home\(your user name).&lt;br /&gt;
&lt;br /&gt;
===Uninstalling Swarm and Cygwin===&lt;br /&gt;
&lt;br /&gt;
Cygwin does not come with an uninstaller; it must be manually uninstalled. Briefly, that means deleting all its files and then manually removing any entries related to Cygwin in the Windows registry (via the command-line program &amp;quot;regedit&amp;quot;). There are instructions in the Cygwin site's FAQ.&lt;br /&gt;
&lt;br /&gt;
===More information===&lt;br /&gt;
&lt;br /&gt;
Pietro Terna's instructions for installing the pre-release of Swarm-2.2 are not completely accurate for this stable release but they still provide useful information on topics such as using the Cygwin setup program and creating a .bashrc file. See &amp;quot;instructions.pdf&amp;quot; at http://eco83.econ.unito.it/swarm/materiale/cd/swarm_2.2_cd/ &lt;br /&gt;
&lt;br /&gt;
Additional information on Cygwin is at: http://www.cygwin.com/&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2154</id>
		<title>Swarm:Stable release</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Swarm:Stable_release&amp;diff=2154"/>
				<updated>2015-12-02T22:36:57Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Windows binaries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Stable release: Swarm 2.2==&lt;br /&gt;
&lt;br /&gt;
As of February, 2005, Swarm 2.2 is the new stable release. This release is the culmination of the numerous development snapshots since the previous release (Swarm 2.1.1, which was released in April, 2000). &lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 adds a few new capabilities to Swarm. These include improved support for HDF5 and Lisp archiving of data, with support for serialization; a variety of data summary options added to EZGraph and Averager; and binomial and Poisson random number distributions. Several components have been optimized for efficiency, including the random number generators.&lt;br /&gt;
&lt;br /&gt;
Swarm 2.2 also works reliably in Windows XP, fixes a number of bugs, works around drag-and-drop problems with Tcl/Tk in Windows, and includes a number of changes to speed up model execution.&lt;br /&gt;
&lt;br /&gt;
The documentation set has been updated for Swarm 2.2; it is available from the [[Swarm: documentation|Swarm documentation]] page.&lt;br /&gt;
&lt;br /&gt;
NEWS (user-visible changes)&lt;br /&gt;
&lt;br /&gt;
 * '''See the list of known bugs''', below!&lt;br /&gt;
 * Release Notes for Swarm 2.2&lt;br /&gt;
 ** Numerous bugs have been fixed since 2.1.1&lt;br /&gt;
 ** MacOS X is now supported&lt;br /&gt;
 ** The Windows binaries for java Swarm now use the MingW compiler.&lt;br /&gt;
 ** Two new probability distributions (binomial, Poisson) have been added &lt;br /&gt;
    to the Random library.&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
*If downloading a binary from within your web browser, you should do it in such a way that the browser never displays the file on the screen. If you save a file after viewing it, many browsers corrupt it. In Netscape, shift-clicking the url will save it directly to disk.&lt;br /&gt;
*The needed-software directory only applies to building Swarm from source. If you are installing one of the binary distributions, you will not be required to build any packages from source, all relevant packages will either be bundled with your distribution (such as Red Hat and Debian) and/or we provide the appropriate packages in on the ftp site, under the subdirectory relevant for that distribution (list below).&lt;br /&gt;
&lt;br /&gt;
==Packaged (binary) distributions (2.2)==&lt;br /&gt;
The packaged (binary) distributions provide an environment against which user applications can be compiled and linked, without building the Swarm kernel from source.&lt;br /&gt;
&lt;br /&gt;
===Windows binaries===&lt;br /&gt;
'''Windows binaries are different from previous versions!''' In Swarm 2.1.1 and earlier versions, Swarm Windows binaries were distributed as an executable file that installed Cygwin and Swarm on your computer. Swarm 2.2 is distributed by providing a special version of Cygwin that includes Swarm; this version is installed using a special version of the Cygwin setup program. Additional information and instructions are included in the [[Windows binary notes]]. &lt;br /&gt;
&lt;br /&gt;
The Windows binaries are installed via a setup program at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/cygwin/setup.exe&lt;br /&gt;
&lt;br /&gt;
This program downloads and installs Cygwin and Swarm from the internet; you will need a high-speed internet connection. (Alternatives for computers without high-speed access are discussed in [[Windows binary notes]].)&lt;br /&gt;
&lt;br /&gt;
Java binaries for Swarm 2.2 now use the MingW compiler (http://www.mingw.org ) instead of Sun JDK. This means they can be run outside of Cygwin. [http://www.swarm.org/swarmdocs-2.2/set/swarm.installbook.install.article.html Notes for installing Java Swarm] are in the Swarm documentation set. Java binaries for Windows are at:&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.tar.gz&lt;br /&gt;
*http://download.savannah.gnu.org/releases/swarm/binaries/w32/Swarm-2.2-java.zip&lt;br /&gt;
&lt;br /&gt;
For the latest information you should check out Paul Johnson's [http://www.ku.edu/~pauljohn/SwarmFaq/SwarmOnlineFaq.html online FAQ] or consult the [[Swarm: Mailing lists]] archives.&lt;br /&gt;
&lt;br /&gt;
===GNU/Linux binaries===&lt;br /&gt;
&lt;br /&gt;
Paul Johnson is maintaining [http://lark.cc.ku.edu/~pauljohn/Swarm/ RPMs] of Swarm for Fedora Core Linux (and Red Hat 9 if practical).&lt;br /&gt;
&lt;br /&gt;
===MacOS X binaries===&lt;br /&gt;
&lt;br /&gt;
Bill Northcott has produced binaries for MacOS X; see details at [[Swarm: MacOS X binaries]]  These packages include everything other than standard Apple software needed to build and run Swarm models on Panther. Tiger (MacOS X 10.4) is the preferred operating system but older binaries for Panther are available.  There are several versions of the gcc compiler provided, including bleeding edge versions built from the latest code in Apple's opensource cvs. This compiler includes Fortran, libffi and the GNU Objective-C runtime library.&lt;br /&gt;
&lt;br /&gt;
===Other platforms===&lt;br /&gt;
Binaries for other platforms have not been developed. If you develop binaries for another platform, please let us know so they can be shared.&lt;br /&gt;
&lt;br /&gt;
===Binaries of previous versions===&lt;br /&gt;
Legacy binaries (unmaintained) are available here:&lt;br /&gt;
*http://ftp.swarm.org/pub/swarm/binaries/old/&lt;br /&gt;
&amp;amp;lt;!-- commented out obsoleted binaries &lt;br /&gt;
    * Windows 9x, Windows NT 4, or Windows 2000. &lt;br /&gt;
          o Development Kit Note: very large (50 MB), you may wish to order a CD-ROM&lt;br /&gt;
          o&lt;br /&gt;
           Demos&lt;br /&gt;
    *&lt;br /&gt;
      Debian GNU/Linux 2.2. &lt;br /&gt;
          o&lt;br /&gt;
            ix86&lt;br /&gt;
          o&lt;br /&gt;
            sparc&lt;br /&gt;
    *      Red Hat GNU/Linux. &lt;br /&gt;
          o&lt;br /&gt;
            Red Hat 6.1 / x86&lt;br /&gt;
          o&lt;br /&gt;
            Red Hat 6.1 / sparc&lt;br /&gt;
          o&lt;br /&gt;
            LinuxPPC R5 (1999)&lt;br /&gt;
    *&lt;br /&gt;
      SuSE 6.3 GNU/Linux. &lt;br /&gt;
          o&lt;br /&gt;
            x86&lt;br /&gt;
    *&lt;br /&gt;
      Solaris 2.7. &lt;br /&gt;
          o&lt;br /&gt;
            Sparc&lt;br /&gt;
--&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Swarm source (2.2)==&lt;br /&gt;
The Swarm source distribution includes a complete set of swarm kernel sources and can be found at:&lt;br /&gt;
*ftp://ftp.swarm.org/pub/swarm/src/swarm/swarm-2.2.tar.gz &lt;br /&gt;
&lt;br /&gt;
The user must first install (or verify the availability of) appropriate versions of the needed software in order to provide a proper compilation and execution environment for Swarm. We no longer maintain an up-to-date archive of the packages needed by Swarm, as they are readily found on the web. The list of packages needed by Swarm 2.2 is:&lt;br /&gt;
* Tcl/Tk -- either built from source or using -devel binary packages on your favorite distribution&lt;br /&gt;
* BLT 2.4z, not 3.0&lt;br /&gt;
* libpng 1.2.5&lt;br /&gt;
* zlib 1.2.2&lt;br /&gt;
* xpm-4.2 (or the xpm-nox package for Cygwin)&lt;br /&gt;
* X11R6 on Linux and MacOS X (with SDK)&lt;br /&gt;
* Optionally, HDF5 1.6.2&lt;br /&gt;
* Optionally, Java SDK 1.4.2&lt;br /&gt;
* GCC 3.4.4 with Objective C (gcc-4.0 is preferable particularly on non-x86 platforms such as PowerPC, Alpha etc..)&lt;br /&gt;
* GNU Make&lt;br /&gt;
&lt;br /&gt;
Once the environment has been set up, and the source downloaded and de-tarred into an appropriate directory, the user should consult the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; file to learn what options should be specified to the configure script that configures Swarm to the local system. Compilation and linking are done using &amp;amp;lt;tt&amp;amp;gt;make&amp;amp;lt;/tt&amp;amp;gt; as usual, after this step.&lt;br /&gt;
&lt;br /&gt;
You also need an explicit &amp;amp;lt;tt&amp;amp;gt;make install&amp;amp;lt;/tt&amp;amp;gt; step, after the initial &amp;amp;lt;tt&amp;amp;gt;make build&amp;amp;lt;/tt&amp;amp;gt; to cleanly install Swarm to an appropriate location (for example &amp;amp;lt;tt&amp;amp;gt;/usr/local&amp;amp;lt;/tt&amp;amp;gt;). This is explained futher in the &amp;amp;lt;tt&amp;amp;gt;README&amp;amp;lt;/tt&amp;amp;gt; and &amp;amp;lt;tt&amp;amp;gt;INSTALL&amp;amp;lt;/tt&amp;amp;gt; files contained in the distribution.&lt;br /&gt;
&lt;br /&gt;
After compilation and installation of Swarm a set of program libraries and header files against which Swarm applications can be compiled and linked is available.&lt;br /&gt;
&lt;br /&gt;
==Known bugs and fixes==&lt;br /&gt;
This section describes bugs that are known to exist in the release of version 2.2 and what you can do about them.&lt;br /&gt;
&lt;br /&gt;
===Error in &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; minimum, maximum values===&lt;br /&gt;
Swarm's &amp;amp;lt;tt&amp;amp;gt;Averager&amp;amp;lt;/tt&amp;amp;gt; class (in the Analysis library) calculates statistics over values selected from a collection of objects. The '''&amp;amp;lt;tt&amp;amp;gt;getMin&amp;amp;lt;/tt&amp;amp;gt;''' and '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' methods do not work, and will report values that should easily (if checked) be detected as incorrect. (Note that the Reference Guide does not mention the '''&amp;amp;lt;tt&amp;amp;gt;getMax&amp;amp;lt;/tt&amp;amp;gt;''' method but it does exist.) Bug reported here 21 April 2005.&lt;br /&gt;
&lt;br /&gt;
Fixes:&lt;br /&gt;
&lt;br /&gt;
''Windows users'' can download new DLL files with this bug fixed. These are (thanks to Marcus Daniels):&lt;br /&gt;
&lt;br /&gt;
  http://www.santafe.edu/~mgd/javaswarm.dll&lt;br /&gt;
  http://www.santafe.edu/~mgd/cygswarm-0.dll&lt;br /&gt;
&lt;br /&gt;
These would overwrite the equivalent files in the Java/Swarm binary distribution.&lt;br /&gt;
The &amp;amp;lt;tt&amp;amp;gt;cygswarm-0.dll&amp;amp;lt;/tt&amp;amp;gt; goes in &amp;amp;lt;tt&amp;amp;gt;Cygwin/bin&amp;amp;lt;/tt&amp;amp;gt;.&lt;br /&gt;
&lt;br /&gt;
''RPMs for Redhat Linux'' are available from Paul Johnson; see the link above on this page.&lt;br /&gt;
&lt;br /&gt;
''Builds from source code'' can check out the most recent source code at Swarm's Savannah site (see [[Swarm:_development_snapshot#CVS|CVS]]),  or simply fix the offending line of code:&lt;br /&gt;
&lt;br /&gt;
In &amp;amp;lt;tt&amp;amp;gt;Averager.m&amp;amp;lt;/tt&amp;amp;gt;, change line 106 from &lt;br /&gt;
  '''if (totalCount == 0)''' &lt;br /&gt;
to &lt;br /&gt;
 '''if (totalCount == 0 || count == 0)'''&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2153</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2153"/>
				<updated>2015-11-30T23:04:06Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Help */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
=WWW.SWARM.ORG is back!=&lt;br /&gt;
We have just restored the Swarm Development Group wiki (October 2015), following a major server crash several years ago. We will be gradually cleaning up the site. Its emphasis will be on supporting Swarm software and SDG's annual SwarmFest. We will no longer attempt to provide current information on agent-based modeling in general, or on modeling software other than Swarm.&lt;br /&gt;
&lt;br /&gt;
=News=&lt;br /&gt;
==Swarmfest==&lt;br /&gt;
&lt;br /&gt;
Swamfest is the annual meeting of the Swarm Development Group (SDG), and one of the oldest communities involved in the development and propagation of agent-based modeling.  Swarmfest has traditionally involved a mix of both tool-users and tool-developers, drawn from many domains of expertise. These have included, in the past, computer scientists, software engineers, biomedical researchers, ecologists, economists, political scientists, social scientists, resource management specialists and evolutionary biologists.  Swarmfest represents a low-key environment for researchers to explore new ideas and approaches, and benefit from a multi-disciplinary environment.&lt;br /&gt;
&lt;br /&gt;
SwarmFest 2015 was held at the University of South Carolina in Columbia, South Carolina, USA. For information [http://www.swarmfest2015.org/ click here.]&lt;br /&gt;
&lt;br /&gt;
Announcements for future fests should appear here.&lt;br /&gt;
&lt;br /&gt;
==New version of Objective-C Swarm for Windows==&lt;br /&gt;
There is a new binary (and source) release of Swarm that works with MinGW, a compiler that produces Windows executables. Advantages of this new way to use Swarm in Windows:&lt;br /&gt;
* Windows executables can be launched directly from Windows, without needing to launch from inside a Unix-like environment.&lt;br /&gt;
* Swarm models can be distributed for use on any Windows computer, without requiring Swarm or MinGW to be installed.&lt;br /&gt;
* Faster execution than Cygwin Swarm.&lt;br /&gt;
See [[Swarm_and_MinGW]]&lt;br /&gt;
&lt;br /&gt;
=Swarm Software for Agent-based Modeling=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm_main_page|The main Swarm page]]''' for Swarm software, documentation, and applications&lt;br /&gt;
&lt;br /&gt;
*''New release of Objective-C for Windows'' produces Windows-native executables! See [[Swarm_and_MinGW|Using Swarm on Windows with MinGW]]&lt;br /&gt;
&lt;br /&gt;
*''[[Swarm:_Mailing_lists|Email lists for support and modeling]]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Agent- and Individual-based Modeling Resources=&lt;br /&gt;
&lt;br /&gt;
'''[[ABM_Resources|Resources for agent-based modeling]]'''. This area of the wiki is for information on agent-based modeling in general. '''This area is no longer maintained and we refer interested people to more up-to-date sites such as [http://www.openabm.org/ www.OpenABM.org]'''&lt;br /&gt;
&lt;br /&gt;
There is still information on:&lt;br /&gt;
*Agent-based modeling community resources&lt;br /&gt;
*Software (information on alternative platforms; learning materials; template models; integrated development environments)&lt;br /&gt;
*&amp;amp;quot;How and why to do agent-based modeling&amp;amp;quot;: techniques and theory&lt;br /&gt;
*Resources specific to different scientific domains&lt;br /&gt;
&lt;br /&gt;
=Swarm Development Group=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm Development Group]] (SDG)'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG contact|Contact information]]'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG_membership|Information on SDG membership]]'''&lt;br /&gt;
&lt;br /&gt;
*An old list of [https://www.ku.edu/~pauljohn/sdg/member_pages/ SDG Members]&lt;br /&gt;
&lt;br /&gt;
=Help=&lt;br /&gt;
* Who can contribute to this wiki? How do you use it? How can you register to edit or add pages? See the [[SwarmWiki:FAQ|FAQ about this wiki]]&lt;br /&gt;
* [[SwarmWiki:Objectives_and_organization|Objectives and organization of this wiki]]: what can you find on this wiki, and what is appropriate to add to it, where?&lt;br /&gt;
* For general wiki help, see: http://www.wikipedia.org/wiki/Wikipedia:Help&lt;br /&gt;
* For help editing the wiki, start with: http://www.wikipedia.org/wiki/Help:Editing&lt;br /&gt;
* To ''experiment with editing'' the wiki without worrying about messing up articles, try the [[Wiki sandbox]]&lt;br /&gt;
* [[SwarmWiki:Help]] Help page for wiki administrators.&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2152</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2152"/>
				<updated>2015-11-30T23:03:35Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Swarm Development Group */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
=WWW.SWARM.ORG is back!=&lt;br /&gt;
We have just restored the Swarm Development Group wiki (October 2015), following a major server crash several years ago. We will be gradually cleaning up the site. Its emphasis will be on supporting Swarm software and SDG's annual SwarmFest. We will no longer attempt to provide current information on agent-based modeling in general, or on modeling software other than Swarm.&lt;br /&gt;
&lt;br /&gt;
=News=&lt;br /&gt;
==Swarmfest==&lt;br /&gt;
&lt;br /&gt;
Swamfest is the annual meeting of the Swarm Development Group (SDG), and one of the oldest communities involved in the development and propagation of agent-based modeling.  Swarmfest has traditionally involved a mix of both tool-users and tool-developers, drawn from many domains of expertise. These have included, in the past, computer scientists, software engineers, biomedical researchers, ecologists, economists, political scientists, social scientists, resource management specialists and evolutionary biologists.  Swarmfest represents a low-key environment for researchers to explore new ideas and approaches, and benefit from a multi-disciplinary environment.&lt;br /&gt;
&lt;br /&gt;
SwarmFest 2015 was held at the University of South Carolina in Columbia, South Carolina, USA. For information [http://www.swarmfest2015.org/ click here.]&lt;br /&gt;
&lt;br /&gt;
Announcements for future fests should appear here.&lt;br /&gt;
&lt;br /&gt;
==New version of Objective-C Swarm for Windows==&lt;br /&gt;
There is a new binary (and source) release of Swarm that works with MinGW, a compiler that produces Windows executables. Advantages of this new way to use Swarm in Windows:&lt;br /&gt;
* Windows executables can be launched directly from Windows, without needing to launch from inside a Unix-like environment.&lt;br /&gt;
* Swarm models can be distributed for use on any Windows computer, without requiring Swarm or MinGW to be installed.&lt;br /&gt;
* Faster execution than Cygwin Swarm.&lt;br /&gt;
See [[Swarm_and_MinGW]]&lt;br /&gt;
&lt;br /&gt;
=Swarm Software for Agent-based Modeling=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm_main_page|The main Swarm page]]''' for Swarm software, documentation, and applications&lt;br /&gt;
&lt;br /&gt;
*''New release of Objective-C for Windows'' produces Windows-native executables! See [[Swarm_and_MinGW|Using Swarm on Windows with MinGW]]&lt;br /&gt;
&lt;br /&gt;
*''[[Swarm:_Mailing_lists|Email lists for support and modeling]]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Agent- and Individual-based Modeling Resources=&lt;br /&gt;
&lt;br /&gt;
'''[[ABM_Resources|Resources for agent-based modeling]]'''. This area of the wiki is for information on agent-based modeling in general. '''This area is no longer maintained and we refer interested people to more up-to-date sites such as [http://www.openabm.org/ www.OpenABM.org]'''&lt;br /&gt;
&lt;br /&gt;
There is still information on:&lt;br /&gt;
*Agent-based modeling community resources&lt;br /&gt;
*Software (information on alternative platforms; learning materials; template models; integrated development environments)&lt;br /&gt;
*&amp;amp;quot;How and why to do agent-based modeling&amp;amp;quot;: techniques and theory&lt;br /&gt;
*Resources specific to different scientific domains&lt;br /&gt;
&lt;br /&gt;
=Swarm Development Group=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm Development Group]] (SDG)'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG contact|Contact information]]'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG_membership|Information on SDG membership]]'''&lt;br /&gt;
&lt;br /&gt;
*An old list of [https://www.ku.edu/~pauljohn/sdg/member_pages/ SDG Members]&lt;br /&gt;
&lt;br /&gt;
=Help=&lt;br /&gt;
* Who can contribute to this wiki? How do you use it? How can you register to edit or add pages? See the [[SwarmWiki:FAQ|FAQ about this wiki]]&lt;br /&gt;
* [[SwarmWiki:Objectives_and_organization|Objectives and organization of this wiki]]: what can you find on this wiki, and what is appropriate to add to it, where?&lt;br /&gt;
* For general wiki help, see: http://www.wikipedia.org/wiki/Wikipedia:Help&lt;br /&gt;
* For help editing the wiki, start with: http://www.wikipedia.org/wiki/Help:Editing&lt;br /&gt;
* To ''experiment with editing'' the wiki without worrying about messing up articles, try the [[Wiki sandbox]]&lt;br /&gt;
* [[SwarmWiki:Help]] Help page for wiki administrators.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2151</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2151"/>
				<updated>2015-11-30T23:02:43Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
=WWW.SWARM.ORG is back!=&lt;br /&gt;
We have just restored the Swarm Development Group wiki (October 2015), following a major server crash several years ago. We will be gradually cleaning up the site. Its emphasis will be on supporting Swarm software and SDG's annual SwarmFest. We will no longer attempt to provide current information on agent-based modeling in general, or on modeling software other than Swarm.&lt;br /&gt;
&lt;br /&gt;
=News=&lt;br /&gt;
==Swarmfest==&lt;br /&gt;
&lt;br /&gt;
Swamfest is the annual meeting of the Swarm Development Group (SDG), and one of the oldest communities involved in the development and propagation of agent-based modeling.  Swarmfest has traditionally involved a mix of both tool-users and tool-developers, drawn from many domains of expertise. These have included, in the past, computer scientists, software engineers, biomedical researchers, ecologists, economists, political scientists, social scientists, resource management specialists and evolutionary biologists.  Swarmfest represents a low-key environment for researchers to explore new ideas and approaches, and benefit from a multi-disciplinary environment.&lt;br /&gt;
&lt;br /&gt;
SwarmFest 2015 was held at the University of South Carolina in Columbia, South Carolina, USA. For information [http://www.swarmfest2015.org/ click here.]&lt;br /&gt;
&lt;br /&gt;
Announcements for future fests should appear here.&lt;br /&gt;
&lt;br /&gt;
==New version of Objective-C Swarm for Windows==&lt;br /&gt;
There is a new binary (and source) release of Swarm that works with MinGW, a compiler that produces Windows executables. Advantages of this new way to use Swarm in Windows:&lt;br /&gt;
* Windows executables can be launched directly from Windows, without needing to launch from inside a Unix-like environment.&lt;br /&gt;
* Swarm models can be distributed for use on any Windows computer, without requiring Swarm or MinGW to be installed.&lt;br /&gt;
* Faster execution than Cygwin Swarm.&lt;br /&gt;
See [[Swarm_and_MinGW]]&lt;br /&gt;
&lt;br /&gt;
=Swarm Software for Agent-based Modeling=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm_main_page|The main Swarm page]]''' for Swarm software, documentation, and applications&lt;br /&gt;
&lt;br /&gt;
*''New release of Objective-C for Windows'' produces Windows-native executables! See [[Swarm_and_MinGW|Using Swarm on Windows with MinGW]]&lt;br /&gt;
&lt;br /&gt;
*''[[Swarm:_Mailing_lists|Email lists for support and modeling]]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Agent- and Individual-based Modeling Resources=&lt;br /&gt;
&lt;br /&gt;
'''[[ABM_Resources|Resources for agent-based modeling]]'''. This area of the wiki is for information on agent-based modeling in general. '''This area is no longer maintained and we refer interested people to more up-to-date sites such as [http://www.openabm.org/ www.OpenABM.org]'''&lt;br /&gt;
&lt;br /&gt;
There is still information on:&lt;br /&gt;
*Agent-based modeling community resources&lt;br /&gt;
*Software (information on alternative platforms; learning materials; template models; integrated development environments)&lt;br /&gt;
*&amp;amp;quot;How and why to do agent-based modeling&amp;amp;quot;: techniques and theory&lt;br /&gt;
*Resources specific to different scientific domains&lt;br /&gt;
&lt;br /&gt;
=Swarm Development Group=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm Development Group]] (SDG)'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG contact|Contact information]]'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG_membership|Information on SDG membership]]'''&lt;br /&gt;
&lt;br /&gt;
*[https://www.ku.edu/~pauljohn/sdg/member_pages/ SDG Members]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=2 style=&amp;amp;quot;border: 1px solid #c6c9ff; color: #000; padding: .4em .9em .9em; background-color: #d3d3d3&amp;amp;quot; |&lt;br /&gt;
=Help=&lt;br /&gt;
* Who can contribute to this wiki? How do you use it? How can you register to edit or add pages? See the [[SwarmWiki:FAQ|FAQ about this wiki]]&lt;br /&gt;
* [[SwarmWiki:Objectives_and_organization|Objectives and organization of this wiki]]: what can you find on this wiki, and what is appropriate to add to it, where?&lt;br /&gt;
* For general wiki help, see: http://www.wikipedia.org/wiki/Wikipedia:Help&lt;br /&gt;
* For help editing the wiki, start with: http://www.wikipedia.org/wiki/Help:Editing&lt;br /&gt;
* To ''experiment with editing'' the wiki without worrying about messing up articles, try the [[Wiki sandbox]]&lt;br /&gt;
* [[SwarmWiki:Help]] Help page for wiki administrators.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=ABM_Resources&amp;diff=2150</id>
		<title>ABM Resources</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=ABM_Resources&amp;diff=2150"/>
				<updated>2015-11-30T22:51:41Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* FIXME FIXME */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==Complete kits and platforms==&lt;br /&gt;
&lt;br /&gt;
===Open source===&lt;br /&gt;
(must be freely distributable under an open source license, i.e. &amp;amp;quot;free as in speech&amp;amp;quot; as defined by the superset of the [http://opensource.org/docs/definition.php Open Source Definition from the Open Source Initiative] and the [http://www.gnu.org/licenses/license-list.html Free Software Foundation])&lt;br /&gt;
*'''[http://agents.felk.cvut.cz/aglobe A-globe]'''&lt;br /&gt;
*'''[http://www.alphaworks.ibm.com/tech/able ABLE]'''&lt;br /&gt;
*'''[http://ascape.sourceforge.net Ascape]'''&lt;br /&gt;
*'''[http://www.spiderland.org/breve/ Breve]'''&lt;br /&gt;
*'''[http://cormas.cirad.fr/en/outil/outil.htm Cormas]''' &amp;amp;quot;Cormas is a programming environment dedicated to the creation of multi-agent systems, with a specificity in the domain of natural-resources management. It provides a framework for developing simulation models of coordination modes between individuals and groups that jointly exploit common resources.&amp;amp;quot;&lt;br /&gt;
*'''[http://www.cougaar.org/ Cougaar]'''&lt;br /&gt;
*'''[http://ecolab.sourceforge.net EcoLab]'''&lt;br /&gt;
*'''[http://omicrongroup.org/evo/ EVO]'''&lt;br /&gt;
*'''[http://sharon.cselt.it/projects/jade/ JADE]'''&lt;br /&gt;
*'''[http://jaslibrary.sourceforge.net JAS]'''&lt;br /&gt;
*'''[http://cs.gmu.edu/~eclab/projects/mason/ MASON]'''&lt;br /&gt;
*'''[http://www.metascapeabm.com/index.php?option=com_content&amp;amp;amp;task=view&amp;amp;amp;id=19&amp;amp;amp;Itemid=61 metaABM]''' (A meta-modeling environment supporting multiple ABM platforms)&lt;br /&gt;
*'''[http://www.avignon.inra.fr/internet/unites/biometrie/mobidyc_projet/english/version_index_html Mobidyc]''' &amp;amp;quot;The free software for building and running Individual Based Models with no computer skill. Mobidyc is a software project that aims to promote Individual-Based Modelling in the field of ecology, biology and environment.&amp;amp;quot;&lt;br /&gt;
*'''[http://ccl.northwestern.edu/netlogo/ NetLogo]'''&lt;br /&gt;
*'''[http://quicksilver.tigris.org/ Quicksilver]'''&lt;br /&gt;
*'''[http://repast.sourceforge.net Repast]'''&lt;br /&gt;
*'''[http://www.cs.bham.ac.uk/~axs/cog_affect/sim_agent.html SIM_AGENT]'''&lt;br /&gt;
*'''[http://www.simsesam.de SeSAm]'''&lt;br /&gt;
*'''[http://simpy.sourceforge.net/ SimPy]'''&lt;br /&gt;
*'''[http://www.swarm.org Swarm]'''&lt;br /&gt;
*'''[http://www.primordion.com/Xholon Xholon]'''&lt;br /&gt;
*'''[http://labs.bt.com/projects/agents/zeus/ Zeus]'''&lt;br /&gt;
&lt;br /&gt;
===Freeware===&lt;br /&gt;
(available for free &amp;amp;quot;as in beer&amp;amp;quot;, source may or may not necessarily be available, if source is available it is not under an open-source license)&lt;br /&gt;
*'''[http://dextk.org deX]'''&lt;br /&gt;
*'''[http://education.mit.edu/starlogo/ StarLogo]'''&lt;br /&gt;
*'''[http://ccl.northwestern.edu/cm/StarLogoT/ StarLogoT]'''&lt;br /&gt;
*'''[http://visualbots.com/ VisualBots]''' -- Easy to use multi-agent simulator for Microsoft Excel - Visual Basic syntax, rich object model, documentation, sample simulations&lt;br /&gt;
&lt;br /&gt;
===Proprietary===&lt;br /&gt;
*'''[http://agentsheets.com/ AgentSheets]'''&lt;br /&gt;
*'''[http://www.chiinc.com/products/products_igen.htm iGEN]'''&lt;br /&gt;
*'''[http://www.xjtek.com AnyLogic]'''&lt;br /&gt;
*'''[http://mass.aitia.ai MASS]'''&lt;br /&gt;
&lt;br /&gt;
==Swarm add-ons and extensions==&lt;br /&gt;
*'''[[COSMIC]]''' --  General simulation utility classes, provided by the Complex Systems Modelling Group at Imperial College&lt;br /&gt;
*'''[http://www.humboldt.edu/~ecomodel/ EcoSwarm@HSU]''' --  Modeling tools for use with the Swarm simulation system&lt;br /&gt;
*'''[http://me.in-berlin.de/~rws/logzone_toc.html LogZone]''' -- Zone exploration tool.&lt;br /&gt;
&lt;br /&gt;
==Related tools and technologies==&lt;br /&gt;
*'''[http://www.me.mtu.edu/%7Ermdsouza/ABM_GPU.html Agent-based simulation on Graphics Processing Units]'''. Roshan D'Souza at [http://www.me.mtu.edu/ Michigan Tech's Mechanical Engineering department] has been working on ultra-high-speed agent-based modeling using direct programming of Graphics Processing Units (gaming chips). He has, for example, run Sugarscape with 2 million agents updating over 50 times per second with graphical output. [[Image:SugarScape_GPU.pdf|Here is a paper on this work.]] &lt;br /&gt;
*'''[http://www.fipa.org/ FIPA]'''. &amp;amp;quot;FIPA is an IEEE Computer Society standards organization that promotes agent-based technology and the interoperability of its standards with other technologies.&amp;amp;quot;&lt;br /&gt;
*'''[[Objective-C]]'''&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
*Leigh Tesfatsion's '''[http://www.econ.iastate.edu/tesfatsi/acecode.htm Resource Site for Agent-Based Software and Toolkits]'''&lt;br /&gt;
&lt;br /&gt;
*Steve Railsback, Steve Lytinen, and Steve Jackson's '''[http://condor.depaul.edu/~slytinen/abm/StupidModel ABM template model site]'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Why and How to do Agent- and Individual-based Modeling=&lt;br /&gt;
This page provides citations for materials to help people understand when to use agent-based modeling, and how to design and use ABMs. '''Please add useful citations!'''&lt;br /&gt;
&lt;br /&gt;
* ''Railsback, S. F., and V. Grimm. 2012. Agent-based and individual-based modeling: a practical introduction. Princeton University Press, Princeton, New Jersey.'' This is a textbook for classes and self-instruction on scientific agent-based modeling. It uses NetLogo as a software platform. The book focuses on modeling concepts, theory, and methodology and how to implement them in NetLogo. See: http://www.railsback-grimm-abm-book.com/.&lt;br /&gt;
&lt;br /&gt;
* ''Salamon, T. 2011. Design of Agent-Based Models : Developing Computer Simulations for a Better Understanding of Social Processes. Repin, Czech Republic: Bruckner Publishing'' This monograph provides an overview of the principles of agent technologies and is primarily focused on the design and development process of agent-based models. See: http://www.designofagentbasedmodels.info/.&lt;br /&gt;
&lt;br /&gt;
* ''DeAngelis, D.L. &amp;amp;amp; W.M. Mooij. 2005 Individual-based modeling of ecological and evolutionary processes. Annual Reviews in Ecology, Evolution and Systematics 36: 147-168.'' The authors attempted to identify all the publications using individual-based models in ecology. They look at the kinds of problems and subjects that this approach has been applied to.&lt;br /&gt;
&lt;br /&gt;
* ''Grimm, V. 1999. Ten years of individual-based modelling in ecology: what have we learned and what could we learn in the future? Ecological Modelling 115:129-148.''  This paper reviews the status of individual-based modeling in ecology as of about 1998, focusing especially on the links (or lack thereof) between models and theory.&lt;br /&gt;
&lt;br /&gt;
* ''Grimm, V., and S. F. Railsback. 2005. Individual-based modeling and ecology. Princeton University Press, Princeton, New Jersey.'' This book addresses the full cycle of designing, testing, using, and publishing agent-based models, and should be useful even for non-ecologists. Additional information is at: http://www.pupress.princeton.edu/titles/8108.html&lt;br /&gt;
&lt;br /&gt;
* ''Grimm, V., E. Revilla, U. Berger, F. Jeltsch, W. M. Mooij, S. F. Railsback, H.-H. Thulke, J. Weiner, T. Wiegand, and D. L. DeAngelis. 2005. Pattern-oriented modeling of agent-based complex systems: lessons from ecology. Science 310:987-991.'' This paper discusses how to address 3 major problems in applying agent-based models to real-world problems: how do you design models that are complex enough but not too complex? how do you develop and test the theory used in your model? and how can you find good parameter values?&lt;br /&gt;
&lt;br /&gt;
*''Grimm, V., U. Berger, F. Bastiansen, S. Eliassen, V. Ginot, J. Giske, J. Goss-Custard, T. Grand, S. Heinz, G. Huse, A. Huth, J. U. Jepsen, C. JÃ¸rgensen, W. M. Mooij, B. MÃ¼ller, G. Peâ€™er, C. Piou, S. F. Railsback, A. M. Robbins, M. M. Robbins, E. Rossmanith, N. RÃ¼ger, E. Strand, S. Souissi, R. A. Stillman, R. VabÃ¸, U. Visser, and D. L. DeAngelis. 2006. A standard protocol for describing individual-based and agent-based models. Ecological Modelling 198:115-296.'' How can you describe an ABM (e.g., in model documentation or a publication) in such a way that its essential characteristics can be understood easily, while still providing all the details? This paper recommends a standard protocol for describing models, which is also a good way to think about models as they are being designed. The on-line appendices provide example descriptions of many models.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* There are many useful resources on [http://www.econ.iastate.edu/tesfatsi/ace.htm Leigh Tesfatsion's site].&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2149</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2149"/>
				<updated>2015-11-30T22:49:54Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Be a Swarm Development Group Member! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
=WWW.SWARM.ORG is back!=&lt;br /&gt;
We have just restored the Swarm Development Group wiki (October 2015), following a major server crash several years ago. We will be gradually cleaning up the site. Its emphasis will be on supporting Swarm software and SDG's annual SwarmFest. We will no longer attempt to provide current information on agent-based modeling in general, or on modeling software other than Swarm.&lt;br /&gt;
&lt;br /&gt;
=News=&lt;br /&gt;
==Swarmfest==&lt;br /&gt;
&lt;br /&gt;
Swamfest is the annual meeting of the Swarm Development Group (SDG), and one of the oldest communities involved in the development and propagation of agent-based modeling.  Swarmfest has traditionally involved a mix of both tool-users and tool-developers, drawn from many domains of expertise. These have included, in the past, computer scientists, software engineers, biomedical researchers, ecologists, economists, political scientists, social scientists, resource management specialists and evolutionary biologists.  Swarmfest represents a low-key environment for researchers to explore new ideas and approaches, and benefit from a multi-disciplinary environment.&lt;br /&gt;
&lt;br /&gt;
SwarmFest 2015 was held at the University of South Carolina in Columbia, South Carolina, USA. For information [http://www.swarmfest2015.org/ click here.]&lt;br /&gt;
&lt;br /&gt;
Announcements for future fests should appear here.&lt;br /&gt;
&lt;br /&gt;
=New version of Objective-C Swarm for Windows=&lt;br /&gt;
There is a new binary (and source) release of Swarm that works with MinGW, a compiler that produces Windows executables. Advantages of this new way to use Swarm in Windows:&lt;br /&gt;
* Windows executables can be launched directly from Windows, without needing to launch from inside a Unix-like environment.&lt;br /&gt;
* Swarm models can be distributed for use on any Windows computer, without requiring Swarm or MinGW to be installed.&lt;br /&gt;
* Faster execution than Cygwin Swarm.&lt;br /&gt;
See [[Swarm_and_MinGW]]&lt;br /&gt;
&lt;br /&gt;
=Agent- and Individual-based Modeling Resources=&lt;br /&gt;
&lt;br /&gt;
*'''[[ABM_Resources|Resources for agent-based modeling]]'''. This area of the wiki is for information on agent-based modeling in general. There are sub-areas for:&lt;br /&gt;
**Agent-based modeling community resources, including [[Swarm:_SwarmFest|SwarmFest]], our annual modeling conference&lt;br /&gt;
**Software (information on alternative platforms; learning materials; template models; integrated development environments)&lt;br /&gt;
**&amp;amp;quot;How and why to do agent-based modeling&amp;amp;quot;: techniques and theory&lt;br /&gt;
**Resources specific to different scientific domains&lt;br /&gt;
&lt;br /&gt;
*'''modelling@swarm.org: The email community of agent-based modelers.''' This email list discusses topics of general interest to agent-based modelers. [[Swarm:_Mailing_lists|More information and signup here.]]'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;amp;quot;border: 1px solid grey; color: #000; padding: .4em .9em .9em; background-color: #FFFFCC&amp;amp;quot; |&lt;br /&gt;
&lt;br /&gt;
[[Image:Small-swarm-logo.jpeg]]&lt;br /&gt;
&lt;br /&gt;
=Swarm Software for Agent-based Modeling=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm_main_page|The main Swarm page]]''' for Swarm software, documentation, and applications&lt;br /&gt;
&lt;br /&gt;
*''New release of Objective-C for Windows'' produces Windows-native executables! See [[Swarm_and_MinGW|Using Swarm on Windows with MinGW]]&lt;br /&gt;
&lt;br /&gt;
*''[[Swarm: applications|Thanks to Paul Johnson, a new package of applications for Swarm-2.2]]'', particularly for Objective C&lt;br /&gt;
&lt;br /&gt;
*''[[Swarm:_Mailing_lists|Email lists for support and modeling]]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Some Mostly Obsolete Links in this Wiki:=&lt;br /&gt;
&lt;br /&gt;
[[ABM_Resources]]&lt;br /&gt;
&lt;br /&gt;
[[Swarm_Apps]]&lt;br /&gt;
&lt;br /&gt;
[[Swarm_FAQ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;amp;quot;border: 1px solid grey; color: #000; padding: .4em .9em .9em; background-color: #DAFDDA&amp;amp;quot; |&lt;br /&gt;
=Swarm Development Group=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm Development Group]] (SDG)'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG contact|Contact information]]'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG_membership|Information on SDG membership]]'''&lt;br /&gt;
&lt;br /&gt;
*[https://www.ku.edu/~pauljohn/sdg/member_pages/ SDG Members]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=2 style=&amp;amp;quot;border: 1px solid #c6c9ff; color: #000; padding: .4em .9em .9em; background-color: #d3d3d3&amp;amp;quot; |&lt;br /&gt;
=Help=&lt;br /&gt;
* Who can contribute to this wiki? How do you use it? How can you register to edit or add pages? See the [[SwarmWiki:FAQ|FAQ about this wiki]]&lt;br /&gt;
* [[SwarmWiki:Objectives_and_organization|Objectives and organization of this wiki]]: what can you find on this wiki, and what is appropriate to add to it, where?&lt;br /&gt;
* For general wiki help, see: http://www.wikipedia.org/wiki/Wikipedia:Help&lt;br /&gt;
* For help editing the wiki, start with: http://www.wikipedia.org/wiki/Help:Editing&lt;br /&gt;
* To ''experiment with editing'' the wiki without worrying about messing up articles, try the [[Wiki sandbox]]&lt;br /&gt;
* [[SwarmWiki:Help]] Help page for wiki administrators.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2148</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2148"/>
				<updated>2015-11-30T22:49:18Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* Swarmfest */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
=WWW.SWARM.ORG is back!=&lt;br /&gt;
We have just restored the Swarm Development Group wiki (October 2015), following a major server crash several years ago. We will be gradually cleaning up the site. Its emphasis will be on supporting Swarm software and SDG's annual SwarmFest. We will no longer attempt to provide current information on agent-based modeling in general, or on modeling software other than Swarm.&lt;br /&gt;
&lt;br /&gt;
=News=&lt;br /&gt;
==Swarmfest==&lt;br /&gt;
&lt;br /&gt;
Swamfest is the annual meeting of the Swarm Development Group (SDG), and one of the oldest communities involved in the development and propagation of agent-based modeling.  Swarmfest has traditionally involved a mix of both tool-users and tool-developers, drawn from many domains of expertise. These have included, in the past, computer scientists, software engineers, biomedical researchers, ecologists, economists, political scientists, social scientists, resource management specialists and evolutionary biologists.  Swarmfest represents a low-key environment for researchers to explore new ideas and approaches, and benefit from a multi-disciplinary environment.&lt;br /&gt;
&lt;br /&gt;
SwarmFest 2015 was held at the University of South Carolina in Columbia, South Carolina, USA. For information [http://www.swarmfest2015.org/ click here.]&lt;br /&gt;
&lt;br /&gt;
Announcements for future fests should appear here.&lt;br /&gt;
&lt;br /&gt;
=New version of Objective-C Swarm for Windows=&lt;br /&gt;
There is a new binary (and source) release of Swarm that works with MinGW, a compiler that produces Windows executables. Advantages of this new way to use Swarm in Windows:&lt;br /&gt;
* Windows executables can be launched directly from Windows, without needing to launch from inside a Unix-like environment.&lt;br /&gt;
* Swarm models can be distributed for use on any Windows computer, without requiring Swarm or MinGW to be installed.&lt;br /&gt;
* Faster execution than Cygwin Swarm.&lt;br /&gt;
See [[Swarm_and_MinGW]]&lt;br /&gt;
&lt;br /&gt;
=Be a Swarm Development Group Member!=&lt;br /&gt;
Membership in SDG is a way to support our efforts to maintain and improve Swarm, and to support agent-based modeling. [[SDG_membership|We just updated our membership page]] with new membership categories and procedures. Take a look to see what you can do. {{posted|--[[User:SFRailsback|SFRailsback]] 17:34, 10 Nov 2006 (EST)}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;div style=&amp;amp;quot;float:right;&amp;amp;quot;&amp;amp;gt;'''[[News|News archive]]&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
[[SwarmWiki:FAQ#Q._How_do_I_add_a_news_item_to_the_wiki.27s_main_page.3F|How to submit a news item]]'''&amp;amp;lt;/div&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| width=&amp;amp;quot;45%&amp;amp;quot; style=&amp;amp;quot;border: 1px solid grey; color: #000; padding: .4em .9em .9em; background-color: #ffebcd&amp;amp;quot; |&lt;br /&gt;
=Agent- and Individual-based Modeling Resources=&lt;br /&gt;
&lt;br /&gt;
*'''[[ABM_Resources|Resources for agent-based modeling]]'''. This area of the wiki is for information on agent-based modeling in general. There are sub-areas for:&lt;br /&gt;
**Agent-based modeling community resources, including [[Swarm:_SwarmFest|SwarmFest]], our annual modeling conference&lt;br /&gt;
**Software (information on alternative platforms; learning materials; template models; integrated development environments)&lt;br /&gt;
**&amp;amp;quot;How and why to do agent-based modeling&amp;amp;quot;: techniques and theory&lt;br /&gt;
**Resources specific to different scientific domains&lt;br /&gt;
&lt;br /&gt;
*'''modelling@swarm.org: The email community of agent-based modelers.''' This email list discusses topics of general interest to agent-based modelers. [[Swarm:_Mailing_lists|More information and signup here.]]'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;amp;quot;border: 1px solid grey; color: #000; padding: .4em .9em .9em; background-color: #FFFFCC&amp;amp;quot; |&lt;br /&gt;
&lt;br /&gt;
[[Image:Small-swarm-logo.jpeg]]&lt;br /&gt;
&lt;br /&gt;
=Swarm Software for Agent-based Modeling=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm_main_page|The main Swarm page]]''' for Swarm software, documentation, and applications&lt;br /&gt;
&lt;br /&gt;
*''New release of Objective-C for Windows'' produces Windows-native executables! See [[Swarm_and_MinGW|Using Swarm on Windows with MinGW]]&lt;br /&gt;
&lt;br /&gt;
*''[[Swarm: applications|Thanks to Paul Johnson, a new package of applications for Swarm-2.2]]'', particularly for Objective C&lt;br /&gt;
&lt;br /&gt;
*''[[Swarm:_Mailing_lists|Email lists for support and modeling]]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Some Mostly Obsolete Links in this Wiki:=&lt;br /&gt;
&lt;br /&gt;
[[ABM_Resources]]&lt;br /&gt;
&lt;br /&gt;
[[Swarm_Apps]]&lt;br /&gt;
&lt;br /&gt;
[[Swarm_FAQ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;amp;quot;border: 1px solid grey; color: #000; padding: .4em .9em .9em; background-color: #DAFDDA&amp;amp;quot; |&lt;br /&gt;
=Swarm Development Group=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm Development Group]] (SDG)'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG contact|Contact information]]'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG_membership|Information on SDG membership]]'''&lt;br /&gt;
&lt;br /&gt;
*[https://www.ku.edu/~pauljohn/sdg/member_pages/ SDG Members]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=2 style=&amp;amp;quot;border: 1px solid #c6c9ff; color: #000; padding: .4em .9em .9em; background-color: #d3d3d3&amp;amp;quot; |&lt;br /&gt;
=Help=&lt;br /&gt;
* Who can contribute to this wiki? How do you use it? How can you register to edit or add pages? See the [[SwarmWiki:FAQ|FAQ about this wiki]]&lt;br /&gt;
* [[SwarmWiki:Objectives_and_organization|Objectives and organization of this wiki]]: what can you find on this wiki, and what is appropriate to add to it, where?&lt;br /&gt;
* For general wiki help, see: http://www.wikipedia.org/wiki/Wikipedia:Help&lt;br /&gt;
* For help editing the wiki, start with: http://www.wikipedia.org/wiki/Help:Editing&lt;br /&gt;
* To ''experiment with editing'' the wiki without worrying about messing up articles, try the [[Wiki sandbox]]&lt;br /&gt;
* [[SwarmWiki:Help]] Help page for wiki administrators.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2147</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2147"/>
				<updated>2015-11-30T22:45:58Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: Generic information about SwarmFest.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
=WWW.SWARM.ORG is back!=&lt;br /&gt;
We have just restored the Swarm Development Group wiki (October 2015), following a major server crash several years ago. We will be gradually cleaning up the site. Its emphasis will be on supporting Swarm software and SDG's annual SwarmFest. We will no longer attempt to provide current information on agent-based modeling in general, or on modeling software other than Swarm.&lt;br /&gt;
&lt;br /&gt;
=News=&lt;br /&gt;
==Swarmfest==&lt;br /&gt;
&lt;br /&gt;
Swamfest is the annual meeting of the Swarm Development Group (SDG), and one of the oldest communities involved in the development and propagation of agent-based modeling.  Swarmfest has traditionally involved a mix of both tool-users and tool-developers, drawn from many domains of expertise. These have included, in the past, computer scientists, software engineers, biomedical researchers, ecologists, economists, political scientists, social scientists, resource management specialists and evolutionary biologists.  Swarmfest represents a low-key environment for researchers to explore new ideas and approaches, and benefit from a multi-disciplinary environment.&lt;br /&gt;
&lt;br /&gt;
SwarmFest 2015 was held at the University of South Carolina in Columbia, South Carolina, USA. For information see: [[http://www.swarmfest2015.org/]]&lt;br /&gt;
&lt;br /&gt;
Announcements for future fests should appear here.&lt;br /&gt;
&lt;br /&gt;
=New version of Objective-C Swarm for Windows=&lt;br /&gt;
There is a new binary (and source) release of Swarm that works with MinGW, a compiler that produces Windows executables. Advantages of this new way to use Swarm in Windows:&lt;br /&gt;
* Windows executables can be launched directly from Windows, without needing to launch from inside a Unix-like environment.&lt;br /&gt;
* Swarm models can be distributed for use on any Windows computer, without requiring Swarm or MinGW to be installed.&lt;br /&gt;
* Faster execution than Cygwin Swarm.&lt;br /&gt;
See [[Swarm_and_MinGW]]&lt;br /&gt;
&lt;br /&gt;
=Be a Swarm Development Group Member!=&lt;br /&gt;
Membership in SDG is a way to support our efforts to maintain and improve Swarm, and to support agent-based modeling. [[SDG_membership|We just updated our membership page]] with new membership categories and procedures. Take a look to see what you can do. {{posted|--[[User:SFRailsback|SFRailsback]] 17:34, 10 Nov 2006 (EST)}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;div style=&amp;amp;quot;float:right;&amp;amp;quot;&amp;amp;gt;'''[[News|News archive]]&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
[[SwarmWiki:FAQ#Q._How_do_I_add_a_news_item_to_the_wiki.27s_main_page.3F|How to submit a news item]]'''&amp;amp;lt;/div&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| width=&amp;amp;quot;45%&amp;amp;quot; style=&amp;amp;quot;border: 1px solid grey; color: #000; padding: .4em .9em .9em; background-color: #ffebcd&amp;amp;quot; |&lt;br /&gt;
=Agent- and Individual-based Modeling Resources=&lt;br /&gt;
&lt;br /&gt;
*'''[[ABM_Resources|Resources for agent-based modeling]]'''. This area of the wiki is for information on agent-based modeling in general. There are sub-areas for:&lt;br /&gt;
**Agent-based modeling community resources, including [[Swarm:_SwarmFest|SwarmFest]], our annual modeling conference&lt;br /&gt;
**Software (information on alternative platforms; learning materials; template models; integrated development environments)&lt;br /&gt;
**&amp;amp;quot;How and why to do agent-based modeling&amp;amp;quot;: techniques and theory&lt;br /&gt;
**Resources specific to different scientific domains&lt;br /&gt;
&lt;br /&gt;
*'''modelling@swarm.org: The email community of agent-based modelers.''' This email list discusses topics of general interest to agent-based modelers. [[Swarm:_Mailing_lists|More information and signup here.]]'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;amp;quot;border: 1px solid grey; color: #000; padding: .4em .9em .9em; background-color: #FFFFCC&amp;amp;quot; |&lt;br /&gt;
&lt;br /&gt;
[[Image:Small-swarm-logo.jpeg]]&lt;br /&gt;
&lt;br /&gt;
=Swarm Software for Agent-based Modeling=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm_main_page|The main Swarm page]]''' for Swarm software, documentation, and applications&lt;br /&gt;
&lt;br /&gt;
*''New release of Objective-C for Windows'' produces Windows-native executables! See [[Swarm_and_MinGW|Using Swarm on Windows with MinGW]]&lt;br /&gt;
&lt;br /&gt;
*''[[Swarm: applications|Thanks to Paul Johnson, a new package of applications for Swarm-2.2]]'', particularly for Objective C&lt;br /&gt;
&lt;br /&gt;
*''[[Swarm:_Mailing_lists|Email lists for support and modeling]]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Some Mostly Obsolete Links in this Wiki:=&lt;br /&gt;
&lt;br /&gt;
[[ABM_Resources]]&lt;br /&gt;
&lt;br /&gt;
[[Swarm_Apps]]&lt;br /&gt;
&lt;br /&gt;
[[Swarm_FAQ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;amp;quot;border: 1px solid grey; color: #000; padding: .4em .9em .9em; background-color: #DAFDDA&amp;amp;quot; |&lt;br /&gt;
=Swarm Development Group=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm Development Group]] (SDG)'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG contact|Contact information]]'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG_membership|Information on SDG membership]]'''&lt;br /&gt;
&lt;br /&gt;
*[https://www.ku.edu/~pauljohn/sdg/member_pages/ SDG Members]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=2 style=&amp;amp;quot;border: 1px solid #c6c9ff; color: #000; padding: .4em .9em .9em; background-color: #d3d3d3&amp;amp;quot; |&lt;br /&gt;
=Help=&lt;br /&gt;
* Who can contribute to this wiki? How do you use it? How can you register to edit or add pages? See the [[SwarmWiki:FAQ|FAQ about this wiki]]&lt;br /&gt;
* [[SwarmWiki:Objectives_and_organization|Objectives and organization of this wiki]]: what can you find on this wiki, and what is appropriate to add to it, where?&lt;br /&gt;
* For general wiki help, see: http://www.wikipedia.org/wiki/Wikipedia:Help&lt;br /&gt;
* For help editing the wiki, start with: http://www.wikipedia.org/wiki/Help:Editing&lt;br /&gt;
* To ''experiment with editing'' the wiki without worrying about messing up articles, try the [[Wiki sandbox]]&lt;br /&gt;
* [[SwarmWiki:Help]] Help page for wiki administrators.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2146</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2146"/>
				<updated>2015-11-30T22:38:40Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: /* WWW.SWARM.ORG is back! */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
=WWW.SWARM.ORG is back!=&lt;br /&gt;
We have just restored the Swarm Development Group wiki (October 2015), following a major server crash several years ago. We will be gradually cleaning up the site. Its emphasis will be on supporting Swarm software and SDG's annual SwarmFest. We will no longer attempt to provide current information on agent-based modeling in general, or on modeling software other than Swarm.&lt;br /&gt;
&lt;br /&gt;
=News=&lt;br /&gt;
==Announcement for Swarmfest 2012==&lt;br /&gt;
&lt;br /&gt;
Email Inquiries to: swarmfest2012@gmail.com&lt;br /&gt;
&lt;br /&gt;
[[Test]] will take place in Downtown Charlotte, N.C. July 29-31, 2012, hosted by the Complex Systems&lt;br /&gt;
Institute at the University of North Carolina, Charlotte (http://complexity.uncc.edu/). The conference venue is the UNCC Center City Building http://centercity.uncc.edu/.&lt;br /&gt;
Local Map http://centercity.uncc.edu/map-and-directions and Parking http://centercity.uncc.edu/parking&lt;br /&gt;
&lt;br /&gt;
'''Registration can be accomplished at http://www.cvent.com/d/tcqqgn'''&lt;br /&gt;
 &lt;br /&gt;
Swamfest is the annual meeting of the Swarm Development Group (SDG), and one of the oldest communities involved in the development and propagation of agent-based modeling.  Swarmfest has traditionally involved a mix of both tool-users and tool-developers, drawn from many domains of expertise. These have included, in the past, computer scientists, software engineers, biomedical researchers, ecologists, economists, political scientists, social scientists, resource management specialists and evolutionary biologists.  Swarmfest represents a low-key environment for researchers to explore new ideas and approaches, and benefit from a multi-disciplinary environment.&lt;br /&gt;
&lt;br /&gt;
This year we will continue to examine the range of systems being modeled with ABM, with the possibility of providing some guidance as to the suitability of the various types of agent-based models for particular types of modeling goals. We also encourage the sharing of our experiences with attempting to gain acceptance of ABM within our own research communities, and discuss strategies where cross-domain examples/analogies can aid in that process. We will also try to identify future avenues for ABM research, including the &amp;amp;quot;next&amp;amp;quot; generation of ABM tools, platforms and application.&lt;br /&gt;
&lt;br /&gt;
Watch this page for upcoming news on program and logistics.&lt;br /&gt;
&lt;br /&gt;
Hope to see you in Charlotte!&lt;br /&gt;
{{posted|--[[User:Gary An|Gary An]] 16 March 2012}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=New version of Objective-C Swarm for Windows=&lt;br /&gt;
There is a new binary (and source) release of Swarm that works with MinGW, a compiler that produces Windows executables. Advantages of this new way to use Swarm in Windows:&lt;br /&gt;
* Windows executables can be launched directly from Windows, without needing to launch from inside a Unix-like environment.&lt;br /&gt;
* Swarm models can be distributed for use on any Windows computer, without requiring Swarm or MinGW to be installed.&lt;br /&gt;
* Faster execution than Cygwin Swarm.&lt;br /&gt;
See [[Swarm_and_MinGW]]&lt;br /&gt;
&lt;br /&gt;
=Be a Swarm Development Group Member!=&lt;br /&gt;
Membership in SDG is a way to support our efforts to maintain and improve Swarm, and to support agent-based modeling. [[SDG_membership|We just updated our membership page]] with new membership categories and procedures. Take a look to see what you can do. {{posted|--[[User:SFRailsback|SFRailsback]] 17:34, 10 Nov 2006 (EST)}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;div style=&amp;amp;quot;float:right;&amp;amp;quot;&amp;amp;gt;'''[[News|News archive]]&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
[[SwarmWiki:FAQ#Q._How_do_I_add_a_news_item_to_the_wiki.27s_main_page.3F|How to submit a news item]]'''&amp;amp;lt;/div&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| width=&amp;amp;quot;45%&amp;amp;quot; style=&amp;amp;quot;border: 1px solid grey; color: #000; padding: .4em .9em .9em; background-color: #ffebcd&amp;amp;quot; |&lt;br /&gt;
=Agent- and Individual-based Modeling Resources=&lt;br /&gt;
&lt;br /&gt;
*'''[[ABM_Resources|Resources for agent-based modeling]]'''. This area of the wiki is for information on agent-based modeling in general. There are sub-areas for:&lt;br /&gt;
**Agent-based modeling community resources, including [[Swarm:_SwarmFest|SwarmFest]], our annual modeling conference&lt;br /&gt;
**Software (information on alternative platforms; learning materials; template models; integrated development environments)&lt;br /&gt;
**&amp;amp;quot;How and why to do agent-based modeling&amp;amp;quot;: techniques and theory&lt;br /&gt;
**Resources specific to different scientific domains&lt;br /&gt;
&lt;br /&gt;
*'''modelling@swarm.org: The email community of agent-based modelers.''' This email list discusses topics of general interest to agent-based modelers. [[Swarm:_Mailing_lists|More information and signup here.]]'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;amp;quot;border: 1px solid grey; color: #000; padding: .4em .9em .9em; background-color: #FFFFCC&amp;amp;quot; |&lt;br /&gt;
&lt;br /&gt;
[[Image:Small-swarm-logo.jpeg]]&lt;br /&gt;
&lt;br /&gt;
=Swarm Software for Agent-based Modeling=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm_main_page|The main Swarm page]]''' for Swarm software, documentation, and applications&lt;br /&gt;
&lt;br /&gt;
*''New release of Objective-C for Windows'' produces Windows-native executables! See [[Swarm_and_MinGW|Using Swarm on Windows with MinGW]]&lt;br /&gt;
&lt;br /&gt;
*''[[Swarm: applications|Thanks to Paul Johnson, a new package of applications for Swarm-2.2]]'', particularly for Objective C&lt;br /&gt;
&lt;br /&gt;
*''[[Swarm:_Mailing_lists|Email lists for support and modeling]]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Some Mostly Obsolete Links in this Wiki:=&lt;br /&gt;
&lt;br /&gt;
[[ABM_Resources]]&lt;br /&gt;
&lt;br /&gt;
[[Swarm_Apps]]&lt;br /&gt;
&lt;br /&gt;
[[Swarm_FAQ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;amp;quot;border: 1px solid grey; color: #000; padding: .4em .9em .9em; background-color: #DAFDDA&amp;amp;quot; |&lt;br /&gt;
=Swarm Development Group=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm Development Group]] (SDG)'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG contact|Contact information]]'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG_membership|Information on SDG membership]]'''&lt;br /&gt;
&lt;br /&gt;
*[https://www.ku.edu/~pauljohn/sdg/member_pages/ SDG Members]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=2 style=&amp;amp;quot;border: 1px solid #c6c9ff; color: #000; padding: .4em .9em .9em; background-color: #d3d3d3&amp;amp;quot; |&lt;br /&gt;
=Help=&lt;br /&gt;
* Who can contribute to this wiki? How do you use it? How can you register to edit or add pages? See the [[SwarmWiki:FAQ|FAQ about this wiki]]&lt;br /&gt;
* [[SwarmWiki:Objectives_and_organization|Objectives and organization of this wiki]]: what can you find on this wiki, and what is appropriate to add to it, where?&lt;br /&gt;
* For general wiki help, see: http://www.wikipedia.org/wiki/Wikipedia:Help&lt;br /&gt;
* For help editing the wiki, start with: http://www.wikipedia.org/wiki/Help:Editing&lt;br /&gt;
* To ''experiment with editing'' the wiki without worrying about messing up articles, try the [[Wiki sandbox]]&lt;br /&gt;
* [[SwarmWiki:Help]] Help page for wiki administrators.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	<entry>
		<id>http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2145</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="http://www.swarm.org/w/index.php?title=Main_Page&amp;diff=2145"/>
				<updated>2015-11-30T22:37:14Z</updated>
		
		<summary type="html">&lt;p&gt;SwarmWikiSysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Consult the [//meta.wikimedia.org/wiki/Help:Contents User's Guide] for information on using the wiki software.&lt;br /&gt;
&lt;br /&gt;
=WWW.SWARM.ORG is back!=&lt;br /&gt;
We have just restored the Swarm Development Group wiki (October 2015), following a major server crash several years ago. We will be gradually cleaning up the site. Its emphasis will be on supporting Swarm software and SDG's annual SwarmFest.&lt;br /&gt;
&lt;br /&gt;
=News=&lt;br /&gt;
==Announcement for Swarmfest 2012==&lt;br /&gt;
&lt;br /&gt;
Email Inquiries to: swarmfest2012@gmail.com&lt;br /&gt;
&lt;br /&gt;
[[Test]] will take place in Downtown Charlotte, N.C. July 29-31, 2012, hosted by the Complex Systems&lt;br /&gt;
Institute at the University of North Carolina, Charlotte (http://complexity.uncc.edu/). The conference venue is the UNCC Center City Building http://centercity.uncc.edu/.&lt;br /&gt;
Local Map http://centercity.uncc.edu/map-and-directions and Parking http://centercity.uncc.edu/parking&lt;br /&gt;
&lt;br /&gt;
'''Registration can be accomplished at http://www.cvent.com/d/tcqqgn'''&lt;br /&gt;
 &lt;br /&gt;
Swamfest is the annual meeting of the Swarm Development Group (SDG), and one of the oldest communities involved in the development and propagation of agent-based modeling.  Swarmfest has traditionally involved a mix of both tool-users and tool-developers, drawn from many domains of expertise. These have included, in the past, computer scientists, software engineers, biomedical researchers, ecologists, economists, political scientists, social scientists, resource management specialists and evolutionary biologists.  Swarmfest represents a low-key environment for researchers to explore new ideas and approaches, and benefit from a multi-disciplinary environment.&lt;br /&gt;
&lt;br /&gt;
This year we will continue to examine the range of systems being modeled with ABM, with the possibility of providing some guidance as to the suitability of the various types of agent-based models for particular types of modeling goals. We also encourage the sharing of our experiences with attempting to gain acceptance of ABM within our own research communities, and discuss strategies where cross-domain examples/analogies can aid in that process. We will also try to identify future avenues for ABM research, including the &amp;amp;quot;next&amp;amp;quot; generation of ABM tools, platforms and application.&lt;br /&gt;
&lt;br /&gt;
Watch this page for upcoming news on program and logistics.&lt;br /&gt;
&lt;br /&gt;
Hope to see you in Charlotte!&lt;br /&gt;
{{posted|--[[User:Gary An|Gary An]] 16 March 2012}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=New version of Objective-C Swarm for Windows=&lt;br /&gt;
There is a new binary (and source) release of Swarm that works with MinGW, a compiler that produces Windows executables. Advantages of this new way to use Swarm in Windows:&lt;br /&gt;
* Windows executables can be launched directly from Windows, without needing to launch from inside a Unix-like environment.&lt;br /&gt;
* Swarm models can be distributed for use on any Windows computer, without requiring Swarm or MinGW to be installed.&lt;br /&gt;
* Faster execution than Cygwin Swarm.&lt;br /&gt;
See [[Swarm_and_MinGW]]&lt;br /&gt;
&lt;br /&gt;
=Be a Swarm Development Group Member!=&lt;br /&gt;
Membership in SDG is a way to support our efforts to maintain and improve Swarm, and to support agent-based modeling. [[SDG_membership|We just updated our membership page]] with new membership categories and procedures. Take a look to see what you can do. {{posted|--[[User:SFRailsback|SFRailsback]] 17:34, 10 Nov 2006 (EST)}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;amp;lt;div style=&amp;amp;quot;float:right;&amp;amp;quot;&amp;amp;gt;'''[[News|News archive]]&amp;amp;lt;br&amp;amp;gt;&lt;br /&gt;
[[SwarmWiki:FAQ#Q._How_do_I_add_a_news_item_to_the_wiki.27s_main_page.3F|How to submit a news item]]'''&amp;amp;lt;/div&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| width=&amp;amp;quot;45%&amp;amp;quot; style=&amp;amp;quot;border: 1px solid grey; color: #000; padding: .4em .9em .9em; background-color: #ffebcd&amp;amp;quot; |&lt;br /&gt;
=Agent- and Individual-based Modeling Resources=&lt;br /&gt;
&lt;br /&gt;
*'''[[ABM_Resources|Resources for agent-based modeling]]'''. This area of the wiki is for information on agent-based modeling in general. There are sub-areas for:&lt;br /&gt;
**Agent-based modeling community resources, including [[Swarm:_SwarmFest|SwarmFest]], our annual modeling conference&lt;br /&gt;
**Software (information on alternative platforms; learning materials; template models; integrated development environments)&lt;br /&gt;
**&amp;amp;quot;How and why to do agent-based modeling&amp;amp;quot;: techniques and theory&lt;br /&gt;
**Resources specific to different scientific domains&lt;br /&gt;
&lt;br /&gt;
*'''modelling@swarm.org: The email community of agent-based modelers.''' This email list discusses topics of general interest to agent-based modelers. [[Swarm:_Mailing_lists|More information and signup here.]]'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;amp;quot;border: 1px solid grey; color: #000; padding: .4em .9em .9em; background-color: #FFFFCC&amp;amp;quot; |&lt;br /&gt;
&lt;br /&gt;
[[Image:Small-swarm-logo.jpeg]]&lt;br /&gt;
&lt;br /&gt;
=Swarm Software for Agent-based Modeling=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm_main_page|The main Swarm page]]''' for Swarm software, documentation, and applications&lt;br /&gt;
&lt;br /&gt;
*''New release of Objective-C for Windows'' produces Windows-native executables! See [[Swarm_and_MinGW|Using Swarm on Windows with MinGW]]&lt;br /&gt;
&lt;br /&gt;
*''[[Swarm: applications|Thanks to Paul Johnson, a new package of applications for Swarm-2.2]]'', particularly for Objective C&lt;br /&gt;
&lt;br /&gt;
*''[[Swarm:_Mailing_lists|Email lists for support and modeling]]''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Some Mostly Obsolete Links in this Wiki:=&lt;br /&gt;
&lt;br /&gt;
[[ABM_Resources]]&lt;br /&gt;
&lt;br /&gt;
[[Swarm_Apps]]&lt;br /&gt;
&lt;br /&gt;
[[Swarm_FAQ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;amp;quot;border: 1px solid grey; color: #000; padding: .4em .9em .9em; background-color: #DAFDDA&amp;amp;quot; |&lt;br /&gt;
=Swarm Development Group=&lt;br /&gt;
&lt;br /&gt;
*'''[[Swarm Development Group]] (SDG)'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG contact|Contact information]]'''&lt;br /&gt;
&lt;br /&gt;
*'''[[SDG_membership|Information on SDG membership]]'''&lt;br /&gt;
&lt;br /&gt;
*[https://www.ku.edu/~pauljohn/sdg/member_pages/ SDG Members]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| colspan=2 style=&amp;amp;quot;border: 1px solid #c6c9ff; color: #000; padding: .4em .9em .9em; background-color: #d3d3d3&amp;amp;quot; |&lt;br /&gt;
=Help=&lt;br /&gt;
* Who can contribute to this wiki? How do you use it? How can you register to edit or add pages? See the [[SwarmWiki:FAQ|FAQ about this wiki]]&lt;br /&gt;
* [[SwarmWiki:Objectives_and_organization|Objectives and organization of this wiki]]: what can you find on this wiki, and what is appropriate to add to it, where?&lt;br /&gt;
* For general wiki help, see: http://www.wikipedia.org/wiki/Wikipedia:Help&lt;br /&gt;
* For help editing the wiki, start with: http://www.wikipedia.org/wiki/Help:Editing&lt;br /&gt;
* To ''experiment with editing'' the wiki without worrying about messing up articles, try the [[Wiki sandbox]]&lt;br /&gt;
* [[SwarmWiki:Help]] Help page for wiki administrators.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>SwarmWikiSysop</name></author>	</entry>

	</feed>