You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

 

 

 

How to Build Scripts on Windows 7/8, Linux Ubuntu 12.04 and Macintosh OSX Lion systems

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://gmat.svn.sourceforge.net/svnroot/gmat/trunk gmat
Step 2: Building on different operating systems

The Build process can be broken down into two phases:

    1. Phase 1 = Dependency Configuration - For details on how to do the Dependency Configuration manually, go to Appendix A below.
    2. Phase 2 = Automatic Build Script Generation & Compilation
Folder Structure

Figure 1. Folder Structure

 

Windows

Tested Operating Systems

Windows 7/8

Prerequisite software
  1. Microsoft Visual Studio 2010 Express or Paid versions.
    1. If using express you will also need 7.1 Microsoft SDK
  2. 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.
    1. 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.
  3. Subversion – Subversion (also known as SVN) is an open source version control system.
    1. Download links: The source code for SVN can be found on http://subversion.apache.org/download/.
  4. Seven Zip – Seven Zip (7-Zip)is a file archiver with a high compression ratio.
    1. Download links: The source code for 7-Zip can be found on http://www.7-zip.org/download.html.
  5. 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.
    1. Download links: The source code for CMake can be found on http://www.cmake.org/cmake/resources/software.html.
  6. 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.
    1. 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
  1. Copy wxWidget .dll’s from /depends/wxWidgets/wxWidget-2.8.12 to /application/bin directory.
  2. Set Visual Studio Build Environment paths based on architecture and version of SDK and Visual Studio installations.
  3. Generate Visual Studio Files using CMake.
  4. Execute Msbuild.exe using “Clean” target against Visual Studio Solution.
  5. 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
  1. gnome-core-devel - These are the development components of the GNOME Desktop environment, an intuitive and attractive desktop.
    1. Download links: The source code for gnome-core-devel can be found on http://packages.ubuntu.com/hardy/gnome-core-devel.
  2. 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.
    1. Download links: The source code for build-essential can be found on http://packages.ubuntu.com/hardy/build-essential.
  3. 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.
    1. Download links: The source code for libgtk2.0-dev can be found on http://packages.ubuntu.com/lucid/libgtk2.0-dev.
  4. 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/ .
    1. Download links: The source code for libgtk2.0-doc can be found on http://packages.ubuntu.com/lucid/libgtk2.0-doc.
  5. 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).
    1. Download links: The source code for devhelp can be found on http://packages.ubuntu.com/search?keywords=devhelp.
  6. 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.
    1. Download links: The source code for libgl1-mesa-dev can be found on http://www.ubuntuupdates.org/libgl1-mesa-dev.
  7. 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.
    1. Download links: The source code for libglu1-mesa-dev can be found on http://packages.ubuntu.com/hardy/i386/libglu1-mesa-dev.
  8. 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.
    1. Download links: The source code for freeglut3 can be found on http://packages.ubuntu.com/hardy/freeglut3-dev.
  9. 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.
    1. Download links: The source code for freeglut3-dev can be found on http://packages.ubuntu.com/hardy/freeglut3-dev.
  10. 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.
    1. Download links: The source code for libdevil-dev can be found on http://packages.ubuntu.com/search?keywords=libdevil-dev.
  11. 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.
    1. Download links: The source code for CMake can be found on http://www.cmake.org/cmake/resources/software.html.
  12. 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.
    1. Download links: The source code for cmake-gui can be found on http://packages.ubuntu.com/hardy-backports/cmake-gui.
  13. 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.
    1. Download links: The source code for Wget is part of the Linux Distro package.
  14. Subversion – Subversion (also known as SVN) is an open source version control system.
    1. 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 svn 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.bat 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.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
  1. Make and make install wxWidgets
  2. Generate Unix Make Files using CMake.
  3. Execute make against make files.

For more notes, go to the additional notes section below.

Macintosh

Tested Operating Systems

OSX Lion

Prerequisite software
  1. 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.
    1. Download links: The source code for XCode 4.3 can be found on http://www.cmake.org/cmake/resources/software.html.
  2. 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.
    1. 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.
  3. 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.
    1. Download links: The source code for CMake can be found on http://www.cmake.org/cmake/resources/software.html.
  4. 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.
    1. Download links: The source code for cmake-gui can be found on http://www.cmake.org/cmake/resources/software.html.
  5. 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.
    1. Download links: The source code for Wget is part of the Linux Distro package.
  6. Subversion – Subversion (also known as SVN) is an open source version control system.
    1. 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.bat 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.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
  1. Make and make install wxWidgets
  2. Generate Unix Make Files using CMake.
  3. Execute make against make files.

For more links, go to the additional notes section below.

Additional Notes:

Developer
  • wxWidgets need preconfigured setup.h file copied over to its Operating System specific folder before build. This preconfigured file is located in gmatroot/depends/bin/wx/setup.h. This file is automatically copied by configure.bat/configure.sh script. This will only be necessary if creating dependencies manually.
Windows  
  • Build process will not work with Visual Studio 2012.
    • This is due to wxWidgets 2.8.12 dependency not being compatible. VS complain about .pch files not working.
  • Build will work on Windows 8 with VS 2012.
  • Only Targeting builds with Visual Studio. NMake generated CMake files on windows have build problems.
Linux  
  • Only tested on Ubuntu 12.04 but should work on older versions as well (Still need to test)
    • Ubuntu 12.04 requires symlinks for gl, glu, and mesa libraries (Old versions were installed to /usr/lib/ new versions installed to architecture specific (e.g. i386-linux-gnu and x86_64-linux-gnu respectively).
    • Because of the symlink issue user will need to run configure script as sudo. This is an issue with wxWidgets 2.8.12. Ticket for this is at: http://trac.wxwidgets.org/ticket/13376 and http://trac.wxwidgets.org/ticket/13375
      • Option to take out of configure script and have user run symlink command manually.
  • The wxWidget dependency “NetUtils” contrib/net does not build on Linux32 or 64.
  • Editor.cpp causes compiliation to fail on Linuxusing wxWidgets stc editor. Lin 747 is windows specific. There is no such thing as a Boolean in Linux. Change Boolean to bool and you can use stc editor on Linux.
  • wxWidgets is hardcoded to use gtk2 libraries on Linux. The configure script installs these to the default folder of /usr/local/lib. Requires sudo on configure script.
    • Option to take out of configure script and have user run make install from wxwidget dependency folder.
    • Option to use –prefix on wxWidgets make install to install to local dependency folder.
    • Option to try and included wx-Config in CMake which would allow support for more than just gtk2 libs.
Macintosh  
  • Only tested on OSX Lion.
  • The wxWidget dependency “NetUtils” contrib/net does not build on Macintosh 32 or 64.
  • Editor.cpp causes compilation to fail on Macintosh using wxWidgets stc editor. Lin 747 is windows specific. There is no such thing as a Boolean in Macintosh. Change Boolean to bool and you can use stc editor on Macintosh.
  • wxWidgets is hardcoded to use carbon libraries on Macintosh. The configure script installs these to the default folder of /usr/local/lib. Requires sudo on configure script.
    • Option to take out of configure script and have user run make install from wxwidget dependency folder.
    • Option to use –prefix on wxWidgets make install to install to local dependency folder.
    • Option to try and included wx-Config in CMake which would allow support for more than just carbon libs.
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

 

How to Use the Build System

The Build process can be broken down into two phases:

Phase 1 : Dependency Configuration

This phase includes dependency configuration scripts in the form of batch files (.bat for Windows) and (.sh for Linux/Macintosh). If new dependencies are necessary these or existing dependencies need to be removed these scripts would be the place to make those changes.

The scripts can be found in the gmatroot/depends/ directory.

Phase 2 : Automatic Build Script Generation & Compilation

This phase makes use of CMake, the 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.)

The CMake files for the GMAT build system are located in gmatroot/src/ directory. Each CMake file is named CMakeLists.txt which is a required name by the CMake system.

There are currently four CMake build files. One for each project (base, gui, and console) as well as one main Script.

These scripts are located in the following directories:

  • src – (CMakeLists.txt – Main Cmake Script)
    • base– (CMakeLists.txt – Base Library Cmake Script)
    • console– (CMakeLists.txt – Console Project Cmake Script)
    • gui – (CMakeLists.txt – GUI Project Cmake Script)

NOTE: You should not add/remove any files or dependencies to the Visual Studio or Eclipse files. CMake will now handle the generation of everything. All Compiler flags will also need to be set in the CMake files.

Adding/Removing Source Files

To add or remove source files to the projects you will need to modify the CMakeLists.txt file that corresponds with the project.

To do this find the “Source Files” section in the CmakeLists.txt file and add or remove the file path and name to the “Source Files” array.

Adding/Removing Include Directories

To add or remove include files to the projects you will need to modify the CMakeLists.txt file that corresponds with the project.

To do this find the “include directories for header files” section, in the CmakeLists.txt file and add a “INCLUDE_DIRECTORIES” line.

An Example would be:

INCLUDE_DIRECTORIES("/path/to/my/include/")

Additional CMake Functionality

To add additional functionality to the Cmake files (ie. Compiler flags, definitions, new linked libraries, etc.), please consult the CMake documentation.

Building with CMake

After CMakeLists.txt files have been modified you can build/rebuild your project by doing one of the following:

On Windows:

  • Rerun Build.bat located in gmatroot/build/ directory or
  • Rebuild with Visual Studio IDE (Upon a rebuild the CMake Cache will be auto updated and the new source files and include files will appear in Visual Studio).

On Linux/Macintosh:

  • Rerun Build.bat located in gmatroot/build/ directory.

Build Output

GMAT Binaries and dependencies will be built to the gmatroot/application/bin directory. Intermediate builds will go to the gmatroot/build/src/<configuration>/<project_name>.dir/ folder. The auto generated Visual studio solution files and make files will go to the gmatroot/build/<os>/ folder.

 

Additional Notes:
Developer
  • wxWidgets need preconfigured setup.h file copied over to its Operating System specific folder before build. This preconfigured file is located in gmatroot/depends/bin/wx/setup.h. This file is automatically copied by configure.bat/configure.sh script. This will only be necessary if creating dependencies manually.
Windows
  • Build process will not work with Visual Studio 2012.
    • This is due to wxWidgets 2.8.12 dependency not being compatible. VS complain about .pch files not working.
  • Build will work on Windows 8 with VS 2012.
  • Only Targeting builds with Visual Studio. NMake generated CMake files on windows have build problems.
Linux
  • Only tested on Ubuntu 12.04 but should work on older versions as well (Still need to test)
    • Ubuntu 12.04 requires symlinks for gl, glu, and mesa libraries (Old versions were installed to /usr/lib/ new versions installed to architecture specific (e.g. i386-linux-gnu and x86_64-linux-gnu respectively).
    • Because of the symlink issue user will need to run configure script as sudo. This is an issue with wxWidgets 2.8.12. Ticket for this is at: http://trac.wxwidgets.org/ticket/13376 and http://trac.wxwidgets.org/ticket/13375
      • Option to take out of configure script and have user run symlink command manually.
  • The wxWidget dependency “NetUtils” contrib/net does not build on Linux32 or 64.
  • Editor.cpp causes compiliation to fail on Linuxusing wxWidgets stc editor. Lin 747 is windows specific. There is no such thing as a Boolean in Linux. Change Boolean to bool and you can use stc editor on Linux.
  • wxWidgets is hardcoded to use gtk2 libraries on Linux. The configure script installs these to the default folder of /usr/local/lib. Requires sudo on configure script.
    • Option to take out of configure script and have user run make install from wxwidget dependency folder.
    • Option to use –prefix on wxWidgets make install to install to local dependency folder.
    • Option to try and included wx-Config in CMake which would allow support for more than just gtk2 libs.
Macintosh
  • Only tested on OSX Lion.
  • The wxWidget dependency “NetUtils” contrib/net does not build on Macintosh 32 or 64.
  • Editor.cpp causes compilation to fail on Macintosh using wxWidgets stc editor. Lin 747 is windows specific. There is no such thing as a Boolean in Macintosh. Change Boolean to bool and you can use stc editor on Macintosh.
  • wxWidgets is hardcoded to use carbon libraries on Macintosh. The configure script installs these to the default folder of /usr/local/lib. Requires sudo on configure script.
    • Option to take out of configure script and have user run make install from wxwidget dependency folder.
    • Option to use –prefix on wxWidgets make install to install to local dependency folder.
    • Option to try and included wx-Config in CMake which would allow support for more than just carbon libs.
  • No labels