Skip to content

Building OpenFrames on Mac

tyler edited this page Mar 2, 2020 · 6 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

  • used to generate build system
  • used 3.12 as tested
  • version 2.7.9 or greater
  • version 7.2 or greater
  • used if you want to to build the Winteracter demo
  • download the latest static library for your architecture (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

  • clone 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]\X11-build 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]\X11-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 X11-build folder
  • verify the default generator choice or choose a different one
  • check Use default native compiler (See Figure 2)
  • select unix makefiles as the build system
  • 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-Darwin-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 Terminal:

  1. Go to the [OF_FOLDER]\X11-build folder.
  2. Type make or make -j N where N is the number of cores your computer has.
  3. Type make install to install the compiled OpenFrames into the [OF_FOLDER]\OpenFrames-Darwin-install folder
  4. Confirm that the test1 executable is in [OF_FOLDER]/X-11-Darwin-install/bin

Step 4: Test OpenFrames

In Terminal:

  1. Add the following to your .bash_profile (or equivalent) login file:
export OF_ROOT=/path/to/OpenFrames-Darwin-install
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$OF_ROOT/lib
  1. Open a new Terminal window (so the above changes take effect).
  2. Go to the OpenFrames-Darwin-install/bin folder and type ./test1
  3. XQuartz will launch (if not already running), and an OpenFrames expample should run.

Congratulations, OpenFrames is now built and installed.