Monthly Archives: September 2010

Building and Installing VR Juggler on Mac OS X

VR Juggler is an open-source virtual reality framework that is very cross-platform compatible.  However, that doesn’t mean it is necessarily easy to install on multiple platforms – there are some pitfalls.  Hopefully this post will help VR Juggler users get it going on their Mac computers.

Homebrew is a great replacement for MacPorts or Fink: it’s a system for installing Unix or Unixy packages on Mac OS X.  It tries to keep things simple and non-duplicated (unlike, for example, MacPorts…).  I’ve created package descriptions (“formulae”) for Brew to install VR Juggler 2.2.x or 3.0 prereleases on the Mac – just follow these steps.  If you’ve already used Homebrew, you can skip the first three steps.  Update instructions are at the bottom.

  • If you haven’t already, install XCode: there should be a somewhat out of date version on your OS X install CD, and you can get an updated version from Apple’s ADC.
  • Install homebrew system-wide in /usr/local – the latest instructions (from the homepage at ) at time of post are:
ruby -e "$(curl -fsS"

(If you want, you can install it elsewhere: I’ll refer you to the brew homepage and wiki for instructions on installing brew elsewhere, and you’ll have to change all instances of /usr/local in these instructions to your chosen install directory.)

  • Install git, update brew, and set it up as a git repo:
cd /usr/local
brew install git
brew update
  • If you’ve already used Homebrew, this is the place where you pick up in the instructions: add my repository as a remote, and merge it.
cd /usr/local
git remote add rpavlik
git fetch rpavlik
git merge rpavlik/master
  • Optional: Edit/create .bash_profile by running this command (or choosing Open Hidden with Fraise)
nano ~/.bash_profile

add these lines toward the top for brew’s sake.

# Mac Homebrew
export PATH=/usr/local/sbin:/usr/local/Library/Contributions/examples:$PATH
export PYTHONPATH="/usr/local/lib/python2.6/site-packages/:$PYTHONPATH"
source `brew --prefix`/Library/Contributions/
# Bash completion scripts
if [ -f `brew --prefix`/etc/bash_completion ]; then
 . `brew --prefix`/etc/bash_completion
  • Find out about possible issues with your install through a brew diagnostic command – you may want to act on its recommendations.
brew doctor
  • Install the latest CMake from when it asks where you want to install command line tools to, first run this in a terminal
mkdir -p /usr/local/Cellar/cmake/CMAKEVERSIONGOESHERE/bin
  • Then back in the cmake installer, type:
  • Run this command to point brew to your CMake:
brew link cmake
  • Install any or all of these optional dependencies, if desired – it won’t hurt to install more than necessary, so I’d recommend installing all of them (you can put all the package names on the same brew install command)
brew install vrpn
brew install omniorb
brew install freealut
  • Install your desired version of VR Juggler: either 2.2.x or 3.0.x. Add “–HEAD” to the command to build the latest SVN from that branch instead of the latest release tarball, and add –with-debug if you also want the debug-enabled versions built [new enhancement courtesy of Brandon Newendorp – thanks!].
brew install vrjuggler-2.2
brew install vrjuggler-3.0
  • Go get a snack while this builds – it will take a while, especially if you haven’t installed any brew packages before (since it will compile the common dependencies like boost, etc)
  • When it’s done: you’ll have your desired VR Juggler installed to /usr/local – a message will tell you where the bundle is so that you can copy it to /Applications, if you like.
  • If you use OpenSceneGraph for your apps, you can also install it using Homebrew. You may first wish to run:
brew install collada

to install the COLLADA DOM so your osg build can read collada files.  In any case, run:

brew install openscenegraph

and go eat a meal – OSG is a large set of software so it takes a while.  On my MacBook (Santa Rosa/Late 2007), I believe it takes roughly an hour to build.  Don’t worry, Brew build in parallel when possible, so if you have a very fancy machine it will go quickly.  If you want to use the OpenSceneGraph as a framework, instead of “unix-style”, you’ll want to build the XCode projects included with the OpenSceneGraph source instead of using Homebrew.  (Both methods work, it’s just personal preference or potentially some corner cases.)

To update, just run:

brew upgrade

Once you’ve merged from my repository, you’ll have a slightly-patched version of brew that first updates from my repository before updating from the upstream repo.  This makes it so that I have a chance to fix any merge conflicts pre-emptively so you don’t run into them.  If you get a merge conflict, running this command will undo the attempted merge and any uncommitted changes in your homebrew repository (which is safe as long as you aren’t making your own formulas without committing them).

cd /usr/local
git reset --hard

If these instructions aren’t quite clear, please contact me and let me know how I can clarify them – I only have one Mac so I rarely start from scratch setting up a development environment.

[EDIT: 8 Sept 2010 – Fixed the path for installing CMake links, add brew doctor step, add note about OSG as a framework]

[EDIT: 8 Sept 2010 – Add notes about .bash_profile]

[EDIT: 28 Jan 2011 – Made the CMake section clearer and not version-specific, added info about –with-debug flag for VR Juggler formulas]