Skip to content

Building OpenFrames on Ubuntu

Tyler Lee edited this page Mar 5, 2020 · 9 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.

This tutorial was most recently tested and run on Ubuntu 18.04.1


Step 1: Dependencies

sudo snap install cmake

  • used to generate build system
  • used 3.16.5 as tested

GCC

sudo apt install gcc

  • used version 7.4.0 as tested
  • used if you want to to build the Winteracter demo
  • download the latest static library for your architecture (32-bit 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

  • clone the OpenFrames repository
    • git clone https://github.com/ravidavi/OpenFrames.git
  • when checking out, ensure you have selected the "develop" branch instead of the "Master" branch
    • cd OpenFrames
    • git checkout develop
  • the root OpenFrames folder will be referred to as [OF_FOLDER] on this page

Step 2: Setup OpenFrames Build System

In Terminal:

  1. cd [OF_FOLDER]
  2. mkdir build
  3. mkdir install
  4. cd build
  5. cmake ..
  6. ccmake . or cmake-gui .
    • this is a Terminal/GUI based cmake that displays information in a textual/graphical based interface
    • CMAKE_INSTALL_PREFIX = [OF_FOLDER]/install
    • press [c] to configure
    • if any XXX_LIBRARY file path is not found, edit the entry
      • may require the advanced mode edit
      • XXX_LIBRARY = [OSG_FOLDER]/install/lib64/<filename>.so
      • press [c] to configure
    • press [q] to quit
  7. (Optional) ccmake -D WINTER_ROOT:PATH=[PATH_TO_YOUR_WINTERACTER]`
    • this is a Terminal based cmake that displays information in a textual based interface
    • press [c] to configure
    • press [g] to generate
    • press [q] to quit

Step 3: Build and Install OpenFrames

In Terminal:

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

Step 4: Test OpenFrames

In Terminal:

  1. Add the following lines to your .bashrc
export OF_ROOT=[OF_FOLDER]/install
export PATH=$PATH:$OF_ROOT/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OF_ROOT/lib
  1. Download and unzip the OpenSceneGraph Data Resources if you haven't already from installing OpenSceneGraph
  2. cd <UNZIPPED_OSG_FOLDER>
  3. ofviewer cow.osg

Congratulations, OpenFrames is now built and installed.