Building on Linux
These instructions were copied from Building on Mac. If you see Mac-specific details here (or Linux-specific details missing), please update them.
Get the code
Follow the instructions on the Downloads page to check out a copy of the GMAT source code from SourceForge.
Optionally, you can also check out a copy of the plugins repository further down on that page. If you choose to get the plugins code, you only need to check out the trunk/code
directory from the repository. The rest is associated testing and documentation code, and is quite large.
We'll refer to the SourceForge checkout as sf
and the internal code checkout as plugins
.
Get the prerequisites
Toolchain
You'll need the standard GNU toolchain, including GCC and make.
wxWidgets
GMAT needs a version of wxWidgets with OpenGL enabled and Unicode disabled. This usually means building a custom wxGTK library:
- Download wxGTK 2.8.12 from http://wxwidgets.org.
- Unzip and untar the downloaded file.
- In a Terminal, run the following commands from the new
wxGTK-2.8.12
directory (replacing/path/to/wxGTK-2.8.12
with the absolute path to yourwxGTK-2.8.12
directory):Â
chmod a+x ./configuremkdir build-gmat
cd build-gmat../configure --prefix=/path/to/wxGTK-2.8.12/build-gmat --with-opengl
- Run
make
to compile the wxGTK libraries:make
- Run
make install
to install the libraries and correctly set install paths. This is necessary due to bug GMT-3021.make install
SPICE
- Download
http://naif.jpl.nasa.gov/pub/naif/toolkit//C/PC_Linux_GCC_32bit/packages/cspice.tar.Z
. - Uncompress and untar
cspice.tar.Z
to result in acspice
directory.
f2c
- Download
smb://mesa-file/595/GMAT/GMAT_3rdParty.zip
(internal users only) - Unzip and move the
f2c32
directory to your preferred location.
PCRE
- Download PCRE from
http://www.pcre.org
- Unzip and untar the downloaded file
- Run the following commands from the extracted
pcre-#.##
folder:./configure
make
Configure GMAT
- Set the following environment variable:
PLATFORM=linux
- Copy
sf/trunk/build/macosx/BuildEnv.mk
tosf/src
- Edit
BuildEnv.mk
to set the following variables:TOP_DIR
: path to thesf
directoryWX_INSTALLED
: path to the directory containingwx-config
; usually this is thewxGTK-2.8.12/build-gmat
directoryWX_LIB_LOC
: path to the directory containing the compiled wx libraries; usually this is thewxGTK-2.8.12/build-gmat/lib
directorySPICE_DIR
: path to the directory containing thecspice
directoryF2C_LOC
: path to the directory containing thef2c32
directoryPCRE_LIB_LOC
: path to the PCRE library location; usuallypcre-#.##/.libs
Configure the bundled plugins
The public GMAT repository (on SourceForge) includes several plugins that can be compiled along with the main application.
MatlabInterfacePlugin
The MatlabInterfacePlugin is available on OS X Leopard (10.5) and Snow Leopard (10.6) only.
- Copy
sf/plugins/MatlabInterfacePlugin/build/mac_snowleopard/MatlabInterfaceEnv.mk
(ormac_leopard
) tosf/plugins/MatlabInterfacePlugin/src
. - Edit the new
sf/plugins/MatlabInterfacePlugin/src/MatlabInterfaceEnv.mk
file:WX_INSTALLED
: path to the directory containingwx-config
; usually this is thewxMac-2.8.12
directoryMATLAB_DIR
: path to a MATLAB app (such as/Applications/MATLAB_R2012a.app
)
Plugin configuration: To use the MATLAB interface plugin, you must have the following environment variable configured:
MATLABFORGMAT=/path/to/MATLAB_ver.app
You can do this system-wide by putting the variable and its value into the file ~/.MacOSX/environment.plist
using the OS X Property List Editor. See Apple QA1067 for details. You'll need to log off and log back on before the setting will take effect.
CInterfacePlugin (alpha)
Copy sf/plugins/CInterfacePlugin/build/macosx/CInterfaceEnv.mk
to sf/plugins/CInterfacePlugin/src
. No extra configuration of this file is necessary.
EphemPropagatorPlugin (alpha)
- Copy
sf/plugins/EphemPropagatorPlugin/build/macosx/EphemPropEnv.mk
tosf/plugins/EphemPropagatorPlugin/src
. - Edit the new
sf/plugins/EphemPropagatorPlugin/src/EphemPropEnv.mk
file:SPICE_DIR
: path to the directory containingcspice
EstimationPlugin (alpha)
Copy sf/plugins/EstimationPlugin/build/macosx/OdEnv.mk
to sf/plugins/EstimationPlugin/src
. No extra configuration of this file is necessary.
EventLocatorPlugin (alpha)
Copy sf/plugins/EventLocatorPlugin/build/macosx/EventLocatorEnv.mk
to sf/plugins/EventLocatorPlugin/src
. No extra configuration of this file is necessary.
ExtraPropagatorsPlugin (alpha)
- Copy
sf/plugins/ExtraPropagatorsPlugin/build/macosx/ExtraPropagatorEnv.mk
tosf/plugins/ExtraPropagatorsPlugin/src
. - Edit the new
sf/plugins/ExtraPropagatorsPlugin/src/ExtraPropagatorEnv.mk
file:GMAT_CODE_LOCATION
: path tosf/src
GMAT_BIN_LOCATION
: path tosf/application/bin
FminconOptimizerPlugin
The FminconOptimizerPlugin is not available on Mac OS X.
Build GMAT and plugins
- Change to the top-level
sf
directory - Run
make
- If you built CInterfacePlugin:
- Copy the contents of
sf/plugins/CInterfacePlugin/matlab
tosf/application/matlab/libCInterface
. - Change to the
sf/plugins/CInterfacePlugin/build/matlab
directory. - In MATLAB, run
prepareInterface.m
.
- Copy the contents of
Configure and build the internal plugins
At the beginning of this guide, you may have checked out the trunk/code
directory from the internal plugins repository. We'll refer to the location of this working copy as plugins
.
Msise86Plugin
- Copy
sf/plugins/Msise86Plugin/build/macosx/Msise86Env.mk
tosf/plugins/Msise86Plugin/src
. - Edit the new
sf/plugins/Msise86Plugin/src/Msise86Env.mk
file:GMAT_CODE_LOCATION
: path tosf/src
; you'll need to remove one "../
" and changetrunk
to the name you gave yoursf
working copy.GMAT_BIN_LOCATION
: path tosf/application/bin
; you'll need to remove one "../
" and changetrunk
to the name you gave yoursf
working copy.F2C_LOCATION
: path to the directory containing thef2c32
directory; you'll need to remove one "../
" and changeGMAT_3rdParty
to the name of the directory above thef2c32
directory. - Change to the
sf/plugins/Msise86Plugin
directory. - Run
make
The libMsise86.dylib
plugin will be copied to the sf/application/plugins/proprietary
directory.
NRLMsise00Plugin
- Copy
sf/plugins/NRLMsise00Plugin/build/macosx/NRLMsise00Env.mk
tosf/plugins/NRLMsise00Plugin/src
. - Edit the new
sf/plugins/NRLMsise00Plugin/src/NRLMsise00Env.mk
file:GMAT_CODE_LOCATION
: path tosf/src
; you'll need to remove one "../
" and changetrunk
to the name you gave yoursf
working copy.GMAT_BIN_LOCATION
: path tosf/application/bin
; you'll need to remove one "../
" and changetrunk
to the name you gave yoursf
working copy.F2C_LOCATION
: path to the directory containing thef2c32
directory; you'll need to remove one "../
" and changeGMAT_3rdParty
to the name of the directory above thef2c32
directory. - Change to the
sf/plugins/NRLMsise00Plugin
directory. - Run
make
The libNRLMsise00.dylib
plugin will be copied to the sf/application/plugins/proprietary
directory.
Vf13OptimizerPlugin
- Copy
sf/plugins/Vf13OptimizerPlugin/build/macosx/Vf13OptimizerEnv.mk
tosf/plugins/Vf13OptimizerPlugin/src
. - Edit the new
sf/plugins/Vf13OptimizerPlugin/src/Vf13OptimizerEnv.mk
file:GMAT_CODE_LOCATION
: path tosf/src
; you'll need to remove one "-+ ../+-" and changetrunk
to the name you gave yoursf
working copy.GMAT_BIN_LOCATION
: path tosf/application/bin
; you'll need to remove one "-+ ../+-" and changetrunk
to the name you gave yoursf
working copy.F2C_LOCATION
: path to the directory containing thef2c32
directory; you'll need to remove one "-+ ../+-" and changeGMAT_3rdParty
to the name of the directory above thef2c32
directory. - Change to the
sf/plugins/Vf13OptimizerPlugin
directory. - Run
make
The libVF13Optimizer.dylib
plugin will be copied to the sf/application/plugins/proprietary
directory.
MarsGRAMPlugin (alpha)
- Copy
sf/plugins/MarsGRAMPlugin/build/macosx/MarsGRAMEnv.mk
tosf/plugins/MarsGRAMPlugin/src
. - Edit the new
sf/plugins/MarsGRAMPlugin/src/MarsGRAMEnv.mk
file:GMAT_CODE_LOCATION
: path tosf/src
GMAT_BIN_LOCATION
: path tosf/application/bin
- Change to the
sf/plugins/MarsGRAMPlugin
directory. - Run
make
The libMarsGRAM.dylib
plugin will be copied to the sf/application/plugins/proprietary
directory.
CcsdsEphemerisFilePlugin
This plugin is obsolete and is no longer maintained.
DataFilePlugin
This plugin is obsolete and is no longer maintained.