Software for spatially-explicit simulation of forest dynamics

The SORTIE-ND installation

It is a big job to get all the different parts of the SORTIE-ND installation to work together as a single software unit. (There's more on the different components in third party stuff.) Here's a list of needed files and libraries:

  • SORTIE.exe - an executable wrapper. Goes in the main application directory.
  • In the /bin directory:
    • coremodel.exe - the SORTIE core model code.
    • gzip.exe - GZIP application.
    • libgcc_s_dw2-1.dll - GCC code library.
    • libgsl-0.dll - GNU Scientific Library.
    • libgslcblas-0.dll - GNU Scientific Library.
    • libinterface.dll - the library that controls the C++ interface.
    • libstdc++-6.dll - C++ standard library.
    • libxerces-c-3-1-2.dll - Xerces XML parsing library.
    • mingwm10.dll - MinGW runtime library.
    • SORTIE.jar - the SORTIE-ND GUI.
    • tar.exe - TAR application.
  • In the /lib directory:
    • jcommon-1.0.23.jar - JFreeChart library.
    • jfreechart-1.0.19.jar - JFreeChart library.
    • jh.jar - JavaHelp library.
    • sortie_help.jar - the SORTIE-ND help files.
    • xercesimpl.jar - Xerces for Java library.
    • xml-apis.jar - Xerces for Java library.

Creating SORTIE.jar

(See the Java Tutorial for more on JAR files.) The main SORTIE-ND GUI is contained in a JAR file, SORTIE.jar. This JAR can be created in Eclipse with the JAR description file included. It can also be created from the command line by typing something similar to jar -cvmf SORTIE.jar classes. The -cvmf tells jar.exe that you want to:

  • c - create a new archive
  • v - output info to the screen about what jar.exe is doing.
  • m - Specify your own manifest file
  • f - Create a ".JAR" file instead of sending the output to your screen (stdout). is the manifest file (more on this in a bit), SORTIE.jar is the name of the JAR file to create, and classes is the directory containing the java .class files (which are the compiled .java files).

The manifest file defines the JAR and tells SORTIE.jar how to find its needed Java libraries. The file contains a ClassPath header that directs the JVM to look at the jar files as class directories. Here is the contents of at the time of this writing:

Manifest-Version: 1.0
Main-Class: sortie.parfile.Model
Class-Path: ../lib/jh.jar ../lib/sortie_help.jar ../lib/jcommon-1.0.23.jar ../lib/jfreechart-1.0.19.jar ../lib/tar.jar ../lib/xercesImpl.jar ../lib/xml-apis.jar

The latest version is available on the SORTIE-ND downloads page.

Launching SORTIE.jar

Once it is launched from its JAR file, the SORTIE-ND GUI in SORTIE.jar needs to know how to find the core model code. When running the JAR file from the command line, you do this by adjusting the library path when SORTIE-ND is launched. The command is java -Djava.library.path=../lib -jar sortie.jar, assuming that you are in the main installation directory when this command is typed. In release, SORTIE.jar is launched by SORTIE.exe.

Creating SORTIE.exe

To make things less challenging for everyone, SORTIE.jar is packaged into a native Windows executable wrapper. This wrapper is created by JSmooth, an open-source tool. The JSmooth project file is available on the SORTIE-ND downloads page. It makes sure that the user has an appropriate JVM installed and passes it the needed library paths. The library paths are the same as in the SORTIE.jar manifest; these are passed as arguments to the Java Virtual Machine at runtime.

Creating the installer

The installer is created by Inno, an extremely handy piece of open-source software. The first step in creating the installer is to recreate a SORTIE-ND install by placing all the files in the appropriate directories, as described above. Then the Inno install script for SORTIE-ND will do the rest. The latest version of the SORTIE-ND install script is available by request.