GMAT Build Script
CMake to Build Scripts on Windows 7/8, Linux Ubuntu 12.04 and Macintosh OSX Lion systems
This is a work in progress!! This is NOT GMAT's primary build system.
Internet connection required for configure phase. To install GMAT version 2012 a on your system, follow these steps.
Step 1: Download GMAT: svn co https://svn.code.sf.net/p/gmat/code/trunk gmat
Step 2: Building on different operating systems
The Build process can be broken down into two phases:
Phase 1 = Dependency Configuration - For details on how to do the Dependency Configuration manually, go to Appendix A below.
Phase 2 = Automatic Build Script Generation & Compilation
Folder Structure
Figure 1. Folder Structure
Windows
Tested Operating Systems
Windows 7/8
Prerequisite software
- Microsoft Visual Studio 2010 Express or Paid versions.
- If using express you will also need 7.1 Microsoft SDK
- Seven Zip – Seven Zip (7-Zip)is a file archiver with a high compression ratio.
- Download links: The source code for 7-Zip can be found on http://www.7-zip.org/download.html.
- Wget - Wget (GNU Wget, formerly Geturl) is a free softwarepackage for retrieving files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without X-Windows support, etc.
- Download links: The source code for GNU Wget can be found on http://ftp.gnu.org/gnu/wget/ [via http] and ftp://ftp.gnu.org/gnu/wget/ [via FTP]. It can also be found on one of our FTP mirrors. For more download options, see the download information on the Wget Wgiki.
- Subversion – Subversion (also known as SVN) is an open source version control system.
- Download links: The source code for SVN can be found on http://subversion.apache.org/download/.
- CMake – CMake is a cross-platform, open-source build system. CMake is a family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files. CMake generates native makefiles and workspaces that can be used in the compiler environment of your choice.
- Download links: The source code for CMake can be found on http://www.cmake.org/cmake/resources/software.html.
- OpenGL Libraries (Installed with graphics card) - OpenGL (Open Graphics Library)[3]is a cross-language, multi-platform API for rendering 2D and 3D computer graphics. The API is typically used to interact with a GPU, to achieve hardware-accelerated rendering.
- Download links: The source code for OpenGL can be found on http://www.opengl.org/resources/.
Prerequisite Installation
Install all software above.
Configure Dependencies
Automatically
Open up the gmat/depends/ folder in a command prompt.
Run Configure.bat located in gmat/depends/ folder.
Usage for Configure.bat is as follows:
Configure.bat –p [ /path/to/gmat/folder/ ] –wget [ /path/to/wget/install/ ] –svn [/path/to/svn/install/ ] –sevenz [ /path/to/7zip/install/ ] –vsversion [vsversion ie. 9 | 10 | 11 ] –vspath [ /path/to/visual/studio/or/windows/sdk/ ] –latest [ true | false ]
If you do not wish to input these parameters as arguments simply modify the “Default Variables” section of Configure.bat and run Configure.bat without any arguments.
NOTE: All input paths must use quotes.
If all goes well, the script will complete with “Dependency Configuration Complete!”
To double check the dependency configuration, go to the Depends folder and verify the directory structure using figure above.
Manually
If you want to configure manually, go to the dependency section below.
Automatic Build Script Generation
Automatically
Run Build.bat located in gmat/build/ folder.
Usage for Build.bat is as follows:
Build.bat -arch [x86 | x64] -target [debug | release] -version [10.0 | 11.0]
If you do not wish to input these parameters as arguments simply modify the “Default Variables” section of Configure.bat and run Configure.bat without any arguments.
If all goes well the script will complete with “GMAT Build Complete!”
All Binary output will be in gmat/application/bin directory.
Manually
- Copy wxWidget .dll’s from /depends/wxWidgets/wxWidget-2.8.12 to /application/bin directory.
- Set Visual Studio Build Environment paths based on architecture and version of SDK and Visual Studio installations.
- Generate Visual Studio Files using CMake.
- Execute Msbuild.exe using “Clean” target against Visual Studio Solution.
- Execute Msbuild.exe using “Rebuild” target against Visual Studio Solution.
For more notes, go to the additional notes section below.
Linux
Tested Operating Systems
Ubuntu 12.04
Prerequisite software
- gnome-core-devel - These are the development components of the GNOME Desktop environment, an intuitive and attractive desktop.
- Download links: The source code for gnome-core-devel can be found on http://packages.ubuntu.com/hardy/gnome-core-devel.
- build-essential - This package contains an informational list of packages which are considered essential for building Debian packages. This package also depends on the packages on that list, to make it easy to have the build-essential packages installed.
- Download links: The source code for build-essential can be found on http://packages.ubuntu.com/hardy/build-essential.
- libgtk2.0-dev - The GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets, the GTK+ is suitable for projects ranging from small one-off tools to complete application suites. This package contains the header files and static libraries which is needed for developing the GTK+ applications.
- Download links: The source code for libgtk2.0-dev can be found on http://packages.ubuntu.com/lucid/libgtk2.0-dev.
- libgtk2.0-doc - The GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets, the GTK+ is suitable for projects ranging from small one-off tools to complete application suites. This package contains the HTML documentation for the GTK+ library in /usr/share/doc/libgtk2.0-doc/ .
- Download links: The source code for libgtk2.0-doc can be found on http://packages.ubuntu.com/lucid/libgtk2.0-doc.
- devhelp - Devhelp is a GTK+/GNOME browser for APIdocumentation; it works natively with gtk-doc (which is the API reference format for GTK+/GNOME documentation).
- Download links: The source code for devhelp can be found on http://packages.ubuntu.com/search?keywords=devhelp.
- libgl1-mesa-dev – This is a free implementation of the OpenGL API -- GLX development files. Includes headers and static libraries for compiling programs with GLU.
- Download links: The source code for libgl1-mesa-dev can be found on http://www.ubuntuupdates.org/libgl1-mesa-dev.
- libglu1-mesa-dev – This is a free implementation of the OpenGL API -- GLX development files. Includes headers and static libraries for compiling programs with GLU.
- Download links: The source code for libglu1-mesa-dev can be found on http://packages.ubuntu.com/hardy/i386/libglu1-mesa-dev.
- freeglut3 - GLUT is a window system independent toolkit for writing OpenGL programs. It implements a simple windowing API, which makes learning about and exploring OpenGL programming very easy. GLUT is designed for constructing small to medium sized OpenGL programs, however it is not a full-featured toolkit, so large applications requiring sophisticated user interfaces are better off using native window system toolkits like GTK or Motif. This package contains libraries, and headers suitable for software development with GLUT.
- Download links: The source code for freeglut3 can be found on http://packages.ubuntu.com/hardy/freeglut3-dev.
- freeglut3-dev - GLUT is a window system independent toolkit for writing OpenGL programs. It implements a simple windowing API, which makes learning about and exploring OpenGL programming very easy. GLUT is designed for constructing small to medium sized OpenGL programs, however it is not a full-featured toolkit, so large applications requiring sophisticated user interfaces are better off using native window system toolkits like GTK or Motif. This package contains libraries, and headers suitable for software development with GLUT.
- Download links: The source code for freeglut3-dev can be found on http://packages.ubuntu.com/hardy/freeglut3-dev.
- libdevil-dev - Developer's Image Library (DevIL) is a programmer's toolkit which can load, save and convert a wide variety of image formats. It also offers basic manipulation and filtering capabilities. DevIL presents a simple programming interface similar to OpenGL's, which is easy for a developer to learn and use. Ultimate control of the images is left to the developer. This package contains the development files.
- Download links: The source code for libdevil-dev can be found on http://packages.ubuntu.com/search?keywords=libdevil-dev.
- cmake - CMake is a cross-platform, open-source build system. CMake is a family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files. CMake generates native makefiles and workspaces that can be used in the compiler environment of your choice.
- Download links: The source code for CMake can be found on http://www.cmake.org/cmake/resources/software.html.
- cmake –gui - CMake is used to control the software compilation process using simple platform and compiler independent configuration files. CMake generates native makefiles and workspaces that can be used in the compiler environment of your choice. CMake is quite sophisticated: it is possible to support complex environments requiring system configuration, pre-processor generation, code generation, and template instantiation. This package provides a simple GUI to guide you through running cmake.
- Download links: The source code for cmake-gui can be found on http://packages.ubuntu.com/hardy-backports/cmake-gui.
- Wget (Part of Linux distro) - Wget (GNU Wget, formerly Geturl) is a free softwarepackage for retrieving files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without X-Windows support, etc.
- Download links: The source code for Wget is part of the Linux Distro package.
- Subversion – Subversion (also known as SVN) is an open source version control system.
- Download links: The source code for SVN can be found on http://subversion.apache.org/download/.
Prerequisite Installation
Run: sudo apt-get install gnome-core-devel build-essential libgtk2.0-dev libgtk2.0-doc devhelp libgl1-mesa-dev libglu1-mesa-dev freeglut3 freeglut3-dev libdevil-dev subversion cmake cmake-gui
Configure Dependencies
Automatically
Open up the gmat/depends/ folder in the terminal.
Run configure.sh located in gmat/depends/ folder.
Usage for configure.sh is as follows:
configure.sh –p [ /path/to/gmat/folder/ ]
If you do not wish to input these parameters as arguments simply modify the “Default Variables” section of configure.sh and run configure.sh without any arguments.
NOTE: All input paths must use quotes.
If all goes well the script will complete with “Dependency Configuration Complete!”
To double check dependency configuration, go to the Depends folder and verify the directory structure using figure above.
Manually
If you want to configure manually, go to the dependency section below.
Automatic Build Script Generation
Automatically
Run Build.sh located in gmat/build/ folder.
Usage for Build.sh is as follows:
Build.sh -arch [x86 | x64]
If you do not wish to input these parameters as arguments simply modify the “Default Variables” section of Configure.sh and run Configure.sh without any arguments.
If all goes well the script will complete with “GMAT Build Complete!”
All Binary output will be in gmat/application/bin directory.
Manually
- Make and make install wxWidgets
- Generate Unix Make Files using CMake.
- Execute make against make files.
For more notes, go to the additional notes section below.
Macintosh
Tested Operating Systems
OSX Lion
Prerequisite software
- XCode 4.3 - Xcodeis Apple's powerful integrated development environment for creating great apps for Mac, iPhone, and iPad. Xcode includes the Instruments analysis tool, iOS Simulator, and the latest Mac OS X and iOS SDKs.
- Download links: The source code for XCode 4.3 can be found on https://developer.apple.com/xcode/.
- Command Line Tools for XCode (Distro Dependent) - The Xcode interface seamlessly integrates code editing, UI design with Interface Builder, testing, and debugging, all within a single window. The embedded Apple LLVM compiler underlines coding mistakes as you type, and is even smart enough to fix the problems for you automatically.
- Download links: Xcode now provides an interface for downloading and installing the latest command line tools, such as Apple LLVM compiler and system headers. To install these tools, go to the Downloads tab within the Xcode Preferences menu and click "Install" next to the Command Line Tools entry.
- cmake - CMake is a cross-platform, open-source build system. CMake is a family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files. CMake generates native makefiles and workspaces that can be used in the compiler environment of your choice.
- Download links: The source code for CMake can be found on http://www.cmake.org/cmake/resources/software.html.
- cmake – gui - CMake is used to control the software compilation process using simple platform and compiler independent configuration files. CMake generates native makefiles and workspaces that can be used in the compiler environment of your choice. CMake is quite sophisticated: it is possible to support complex environments requiring system configuration, pre-processor generation, code generation, and template instantiation. This package provides a simple GUI to guide you through running cmake.
- Download links: The source code for cmake-gui can be found on http://www.cmake.org/cmake/resources/software.html.
- Wget (Part of Linux distro) - Wget (GNU Wget, formerly Geturl) is a free softwarepackage for retrieving files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without X-Windows support, etc.
- Download links: The source code for Wget is part of the Mac Distro package.
- Subversion – Subversion (also known as SVN) is an open source version control system.
- Download links: The source code for SVN can be found on http://subversion.apache.org/packages.html#osx.
Configure Dependencies
Automatically
Open up the gmat/depends/ folder in the terminal.
Run configure.sh located in gmat/depends/ folder.
Usage for configure.sh is as follows:
configure.sh –p [ /path/to/gmat/folder/ ] –mac
If you do not wish to input these parameters as arguments simply modify the “Default Variables” section of configure.sh and run configure.sh without any arguments.
NOTE: All input paths must use quotes.
If all goes well the script will complete with “Dependency Configuration Complete!”
To double check dependency configuration, go to the Depends folder and verify the directory structure using figure above.
Manually
If you want to configure manually, go to the dependency section below.
Automatic Build Script Generation
Automatically
Run Build.sh located in gmat/build/ folder.
Usage for Build.sh is as follows:
Build.sh -arch [x86 | x64] -mac
If you do not wish to input these parameters as arguments simply modify the “Default Variables” section of Configure.sh and run Configure.sh without any arguments.
If all goes well the script will complete with “GMAT Build Complete!”
All Binary output will be in gmat/application/bin directory.
Manually
- Make and make install wxWidgets
- Generate Unix Make Files using CMake.
- Execute make against make files.
For more links, go to the additional notes section below.
Appendix A:
Library Dependencies
F2C (Fortran to C)
Used in plugins and GMAT. Headers are required for GMAT which makes this a required dependency.
/depends/f2c/ contains source code and header files for GMAT (required)
/depends/bin/f2c contains 32 and 64 bit windows binaries for plugins. (No binaries exist for Linux) These will need to be built using FORTRAN inside CMake (This is still TBD).
Source can be downloaded from ftp://netlib.org/f2c/ and needs to be installed to /depends/f2c/
CSpice (Spice Toolkit for C)
Required Dependency – Used in GmatBase and GmatGUI
32 and 64 bit versions necessary for GMAT.
32 bit Source/binaries can be downloaded from: ftp://naif.jpl.nasa.gov/pub/naif/toolkit//C/PC_Windows_VisualC_32bit/packages/cspice.zip
64 bit Source/Binaries can be downloaded from: ftp://naif.jpl.nasa.gov/pub/naif/toolkit//C/PC_Windows_VisualC_64bit/packages/cspice.zip
Extract to /depends/cspice/cspice32 and cspice64 respectively.
WxWidgets
Required dependency for GmatGUI
wxWidgets build system takes care of 32 vs. 64 bit compilation.
Source can be obtained by running: svn co http://svn.wxwidgets.org/svn/wx/wxWidgets/tags/WX_2_8_12/ wxWidgets-2.8.12
Only the wxWidgets version 2.8.12 tag works with GMAT GUI.
Source should be downloaded to /depends/wxWidgets/wxWidgets-2.8.12
PCRE (Perl Compatible Regular Expressions)
Optional - Used in plugins
Checkout source using: svn co svn://vcs.exim.org/pcre/code/tags/pcre-8.31 pcre-8.31
Or for latest: Checkout source using: svn co svn://vcs.exim.org/pcre/code/trunk/ pcre-latest
Checkout to /depends/pcre/pcre-8.31 or /depends/pcre/pcre-latest
Sofa (Standards of Fundamental Astronomy C Library)
Optional – Used in plugins
Download from http://www.iausofa.org/2012_0301_C/sofa_c_a.zip
Extract to /depends/sofa/
TsPlot (WxWidget Plotting Library)
Optional – Used in plugins
Checkout source using: svn co svn://svn.code.sf.net/p/tsplot/code/trunk tsplot-latest
Checkout to /depends/tsPlot