Menu

Building OpenSceneGraph in Mac

Ravi Mathur Eduardo Valente
Attachments
osg_osx_patch.diff (19874 bytes)

This page under construction

Building OpenSceneGraph

OpenSceneGraph provides the underlying scene graph management capabilities for OpenFrames. This page outlines the process of downloading and building the OpenSceneGraph libraries.

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

Mac 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

Download OpenSceneGraph

  1. Get the OpenSceneGraph Git repository.
  2. Checkout the branch corresponding to the tag OpenSceneGraph-3.5.6
  3. The root OSG folder will be referred to as [OSG_FOLDER] in this page

Setup OpenSceneGraph Build System

In CMake:

  1. Specify [OSG_FOLDER] as the Source Code location.
  2. Specify [OSG_FOLDER]/X11-build as the Build Binaries location
  3. Press the "Configure" button
    • Say "ok" if you are asked to create the X11-build folder
    • Select "unix makfiles" as the build system

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 = \[OSG_FOLDER\]/X11-install
  • OSG_WINDOWING_SYSTEM = X11

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 OpenSceneGraph

In Terminal:

  1. Go to the \[OSG_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 OpenSceneGraph into the \[OSG_FOLDER\]/X11-install folder
  4. Confirm that the osgversion executable is in \[OSG_FOLDER\]/X11-install/bin

Test OpenSceneGraph

In Terminal:

  1. Add the following to your .bash_profile (or equivalent) login file:
    export OSG_ROOT=/path/to/OSG/X11-install
    export PATH=$PATH:$OSG_ROOT/bin:$OSG_ROOT/share/OpenSceneGraph/bin
    export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$OSG_ROOT/lib
    export DYLD_BIND_AT_LAUNCH
  • Open a new Terminal window (so the above changes take effect), and type osgversion. It should tell you the version of OSG that you have installed.

OpenSceneGraph is now built and installed, and ready for use with OpenFrames.


Related

Wiki: Building OpenFrames for the Mac

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.