You can also create a simple Windows batch file that sets SWARMHOME and the path and then executes the model. (or you can just double-click on heatbugs.exe from Windows Explorer, which temporarily opens a Windows command terminal while the model runs.)
For example, if heatbugs.exe is located in C:\Users\example_user\Downloads, then the model may be run as follows: The Heatbugs model can now be run by changing the directory of the command line to the folder holding heatbugs.exe and then executing the program. Once the path has been set to include the swarm\bin folder, Swarm models can be started through the Windows command line, or by double-clicking on them from the Windows Explorer. A tool like RapidEE makes doing so easy, or you can use use Windows control panel > System > Advanced > Environment Variables to add swarm\bin to the PATH system variable. You can alternatively add the Swarm folder to your PATH permanently by editing the Windows PATH environment variable.
These problems can be avoided by using the following statements instead of the above path command: And some Swarm programs require that the environment variable SWARMHOME be defined, which will typically not be true. 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. The swarm\bin 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 cmd.exe): The rest of this tutorial will assume this Swarm folder has been placed at C:\swarm.īefore a Swarm model can be run, the swarm\bin folder must be added to the Windows PATH so that Heatbugs can find necessary libraries when it runs. Unzipping that file will create a folder called swarm which should be moved somewhere that is easy to remember. However, running a Swarm model requires some support programs and libraries.
An example code is this build of Heatbugs:
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.Ī model that has been compiled using MinGW can be installed and run from a Windows computer without installing MinGW or Swarm.