Menu

Building OpenFrames for the Mac

Ravi Mathur Eduardo Valente Yasir Majeed Khan R. S.

This page under construction

Building OpenFrames

NOTE: This guide currently applies to Mac OSX, but will be updated in the future with Windows/Linux instructions.

Requirements

  • CMake to generate build systems on Mac OSX, Windows, and Linux
  • XQuartz v2.7.9 or greater
  • XCode v7.2 or greater. Available for free through the Mac App Store
  • OpenSceneGraph: See the [Building OpenSceneGraph in Mac] wiki
  • (Optional if you want to build the Winteracter demo) Winteracter Open Motif. 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.

Download OpenFrames

  1. Get the OpenFrames Git repository. See here for the link. When checking out, ensure you have selected the "develop" branch instead of the "Master" branch.
  2. The root OpenFrames folder will be referred to as [OF_FOLDER] in this page

Setup OpenFrames Build System

In CMake:

  1. Specify [OF_FOLDER] as the Source Code location.
  2. Specify [OF_FOLDER]/X11-build as the Build Binaries location
  3. Click "Add Entry", and specify the following:
    • Name = OSG_DIR
    • Type = PATH
    • Value = Path to your [OSG_FOLDER]/X11-install directory
    • Description = empty
  4. (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, e.g. /Users/xyz/Documents/wint
    • Description = empty
  5. Press the "Configure" button
    • Say "Yes" if you are asked to create the X11-build folder
    • Select "unix makfiles" as the build system

If you get a CMake error "OpenSceneGraph NOT FOUND", make sure you specified OSG_DIR correctly (Step 3 above).
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.

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:

  • 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. (see Requirements above)

Finally, create the build system:

  1. Press the "Configure" button again to enable the variable changes you just made
  2. Press the "Generate" button to create the build system
  3. Exit CMake

Build OpenFrames

In Terminal:

  1. Go to the [OF_FOLDER]/X11-build folder
  2. Type make, or make -jN 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]/X11-Darwin-install/bin

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
  • Open a new Terminal window (so the above changes take effect), go to the OpenFrames-Darwin-install/bin folder, and type ./test1. XQuartz will launch (if not already running), and an OpenFrames example should run.

OpenFrames is now built and installed.


Related

Wiki: Building OpenSceneGraph in Mac