The first two steps are generally "one-time" processes that are performed immediately after downloading the GMAT repository. They result in a build system (e.g. Visual Studio solution or makefiles) that will intelligently rebuild GMAT components as needed when source or configuration files are changed.

Step 1: Download and Configure GMAT Dependencies

The <GMAT>/depends folder contains scripts to automatically download and configure the GMAT dependencies.

Requirements:

Windows: Visual Studio 2010 or 2013 (Express or Paid versions). If using VS2010 Express, you will need the Microsoft 7.1 SDK.

Mac: XCode tools, with the command line developer tools

Linux: gcc compiler tools

Figure 2. <GMAT>/depends folder layout after dependency configuration

→ To set up GMAT dependencies, double-click the configure.sh (Mac/Linux) or configure.bat (Windows) script.

On Windows you will be prompted to select 32-vs-64 bit dependencies and a VisualStudio version. Choose according to your VisualStudio installation. On Mac/Linux these choices are currently auto-selected based on the system architecture.

You can also run these scripts by name from the Terminal (Mac/Linux) or Command Prompt (Windows).

→ The script will download, build, and configure the GMAT dependencies. The resulting <GMAT>/depends folder structure should look like Figure 2.

GmatBase, GmatConsole, GmatGUI, Plugins: The various GMAT components. You can build these individually if desired.

Choose a build configuration, e.g. Release, Debug, etc.

Build the ALL_BUILD project. Depending on your system speed and number of selected GMAT components, this may take a while!

(Optional) Build the INSTALL project if you want a fully standalone and relocatable version of GMAT.

MacOS and Linux (makefiles)

Makefiles are run through the command line, which on Mac and Linux can be accessed via the Terminal application.

In these instructions, <CMake_binary_path> is the path to the build system folder that you chose in Step 2 (Figure 3 box 2).

Open a command prompt and type the following commands (assuming $ is your command prompt):$ cd <CMake_binary_path>$ make

Note: if you know your computer has N cores, you can also do "make -jN" to significantly speed up the compile time

(Optional) Do "make install" if you want a fully standalone and relocatable version of GMAT.

Step 4: Run GMAT

After building, you have several options for how to run GMAT:

All Operating Systems: GMAT executables and plugins are placed in the <GMAT>/application directory. You can run GMAT from the bin/ (or debug/) subfolders without having to perform the optional INSTALL step. This allows for a more rapid edit-build-test cycle.

All Operating Systems: If you built the optional INSTALL project in Step 3, then a standalone copy of GMAT is placed in the CMAKE_INSTALL_PREFIX folder that you chose in Step 2. The GMAT executables will be in the bin/ subfolder.

Windows: In addition to the above two methods, you can also run the GmatConsole and GmatGUI projects directly from within VisualStudio. This allows for in-program debugging with breakpoints.

Select the configuration that you want to run (Release, Debug, etc.)

Right-click on the GmatConsole or GmatGUI project, and select "Set as Startup Project"

Building GMAT Navigation branch using CMake on Windows

Git clone GMAT Navigation branch. The following example dialog shows the GMAT git repository URL and Directory where Navigation branch will be cloned. Use the correct URL and your id in the URL field. Note that Branch checkbox is checked and branch name is “navigation.” Click “OK” to start cloning the repository.

Navigation build needs additional library called “xerces” (https://xerces.apache.org/xerces-c/). At this time, the XML Parser (Xerces) is not automatically downloaded and configured in Step 2 above (it will be added in a future). Temporarily you can copy “xerces” files from the \Builds\windows\xerces-c-3.1.2 on mesa-file server. The “xerces” libraries on mesa-file were built using VS 2013. If you have other version of VS C++, you will need to build “xerces” libraries on your own and configure CMake to build GMAT using the same compiler. In order to manually add “xerces” include and library to GmatEstimation project, first open GMAT.sln in where it was configured and generated from the CMake. The example solution was generated in C:\Projects\GmatNavigation\build\windows-VS2013-CMake-32. The following shows when GMAT.sln is opened.

First, add “xerces” include file to “Plugin GmatEstimation” project. Right click on “Plugin GmatEstimation” and select “Properties.” Expand “C/C++” and select “General.” In “Additional Include Directories” field, add “xerces” source directory where you coped into. The example shows “C:\xerces-c-3.1.2\src” was added at the end. You can also add it by clicking the down error symbol and “<Edit…>.”