Skip to content

Building OpenFrames on Windows

tyler edited this page Mar 2, 2020 · 16 revisions

Overview

The OpenFrames build process can be broken down into four main steps:

  1. Download and configure the dependencies
  2. Create the build system using CMake
  3. Build OpenFrames
  4. Run OpenFrames

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

Below are step-by-step instructions on how to perform the aforementioned steps along with the background requirements that are needed before beginning.


Step 1: Dependencies

Git Client

  • Source Tree : a GUI git and mercurial client
  • Git for Windows : a command line linux style shell and with git support or GUI based (runs over included MINGW)
  • used to generate build system
  • used 3.12 as tested
  • to run build and install processes
  • used VS 2013 Community edition version 12.0.40629.00 Update 5 as tested
  • used if you want to to build the Winteracter demo
  • download the latest static library for your architecture (32 or 64-bit) and place it in a convenient location
  • it is recommended to place it in the Winteracter lib directory (e.g. lib.ifi64) next to the existing Winteracter libraries

OpenFrames

  • download the OpenFrames repository
  • when checking out, ensure you have selected the "develop" branch instead of the "Master" branch
  • the root OpenFrames folder will be referred to as [OF_FOLDER] on this page

Step 2: Setup OpenFrames Build System

The following steps correspond to the numbered arrows in Figure 1 below.

In CMake:

  1. Specify [OF_FOLDER] as the Source Code location.
  2. Specify [OF_FOLDER]\Win64build as the Build Binaries location.
  • Note: CMake makes slashes forward slashes
  1. Click Add Entry and specify the following:
  • Name = OSG_DIR
  • Type = PATH
  • Value = Path to your [OSG_FOLDER]\install directory
  • Description = empty
  1. (Optional) If you want to build the Winteracter example, click Add Entry and specify the following:
  • Name = WINTER_ROOT
  • Type = PATH
  • Value = Path to your Winteracter \wint directory, eg: C:\Users\John\Documents\wint
  • Description = empty
  1. Press the Configure button
  • say Ok if you are asked to create the build folder
  • verify the default generator choice (Visual Studio 12 2013 Win64 in our case) or choose a different one
  • check Use default native compiler (See Figure 2)
  • click Finish

Figure 1 : CMake GUI CMake GUI

Figure 2 : CMake Specifications CMake Specifications

Note: If you get a CMake error OpenSceneGraph NOT FOUND, make sure you specified OSG_DIR correctly (Step 3 above).

Note: If you get a CMake warning Open Motif NOT FOUND, see below to set the path to libXm if you want to build the Winteracter demo.

  1. Set CMake variables
  • the configure process sets up build variables that can be modified before generating the actual build system
  • the variable list can be organized by clicking the Grouped button. Set the following variables: (See Figure 3)
    • CMAKE_INSTALL_PREFIX = [OF_FOLDER]\OpenFrames-Windows-install
    • Select OF_FORTRAN_MODULE to build the Fortran interface and Winteracter example
    • (Optional) Use CMAKE_LIBRARY_PATH to specify the directory containing Open Motif (libXm) if you are building the Winteracter example, only needed if you did NOT place libXm next to the installed Winteracter libraries
  1. Finally, create the build system
  • press the Configure button again to enable the variable changes you just made
  • press the Generate button to create the build system
  • exit CMake

Figure 3 : CMake Variables CMake Variables


Step 3: Build and Install OpenFrames

In Visual Studio (See Figure 4)

  1. File -> Open Project and navigate to [OF_FOLDER]\Win64build folder. Choose OpenFrames.sln and click Open
  2. The Solution Explorer windows will have ALL_BUILD selected
  3. By default the Debug build solution may be selected. Choose the Release build solution and perform build. (Build -> Build Solution)
  4. Once the build is complete perform the installation:
  • within Solution Explorer window, find the list of CMakePredefinedTargets under ALL_BUILD, INSTALL etc, in the Solution Explorer window (highlighted in Figure 4)
  • right-click INSTALL, left click Build
  1. Confirm that the ofsplitwindow executable is in [OF_FOLDER]\OpenFrames-Windows-install\bin (see Figure 5)

Figure 4 : MS Visual Studio MS Visual Studio

Figure 5 : Browse to locate ofsplitwindow Browse to locate ofsplitwindow


Step 4: Test OpenFrames

In System Properties:

  1. Select the Advanced tab on your Windows machine.
  2. Click on Environment Variables button (see Figure 6)
  3. Edit Path under User Variables. If Path doesn't exist, then create it. (see Figure 7)
  4. Add [OF_FOLDER]\OpenFrames-Windows-install\bin to the Path by clicking Edit once Path is selected. Add the path as a new line in the table.
  5. Create a new user environment variable named OSG_FILE_PATH, and set its value to [OF_FOLDER]\install. This will allow OpenFrames demos to find their resources (images, models, etc.). If OSG_FILE_PATH variable already exists, then append the new value to its end by clicking Edit and adding a path as a new ling in the table.
  6. Click OK to close the editor dialog
  7. Click OK to close the Environment Variables dialog
  8. Open a new terminal (so the above changes can take effect), change directory to [OF_FOLDER]\OpenFrames-Windows-install\bin and type ofsplitwindow. It should bring up a window where the top half has satellites orbiting the Earth, and the bottom half has a 3D time-history plot of one of the satellites.

Figure 6 : Environment Variables
Environment Variables

Figure 7 : Environment Variables Environment Variables

Congratulations, OpenFrames is now built and installed.