USD on macOS

Nick Porcino edited this page Jul 11, 2017 · 7 revisions

The official Pixar script is a quick and easy way to get an out of the box USD build going using official distributions of the various dependencies. Build club is useful when a USD build has to be built in Debug mode, or if specific third party library versions are required.

Building USD on macOS with the official script

These instructions vary from Pixar's in that it uses homebrew to install PyQt rather than macports. The reason for that is that macports sets up an alternative python environment, but some users need system python to work with USD. These steps allow for that.

Prerequisites - PyQt and cmake

If you choose to install these with homebrew -

brew install cmake
brew install cartr/qt4/qt
brew install cartr/qt4/pyside
brew install cartr/qt4/pyside-tools

Prerequisites - PyOpenGL

The Pixar script will use pip to install PyOpenGL, but more likely than not, it will fail due to permissions, or attempting to install for a weird version, like Python 3.5. It's easy enough to do it manually:

pip install PyOpenGL

You may need sudo.

If necessary, set the PYTHONPATH environment variable so that cmake can find PyQt:

export PYTHONPATH=$PYTHONPATH:/usr/local/lib/python2.7/site-packages

Set up to build in ~/Projects/Pixar/USD:

cd $HOME
mkdir Projects
cd Projects
mkdir Pixar
cd Pixar
git clone https://github.com/PixarAnimationStudios/USD
cd USD
git checkout dev
cd ..

Run the build_usd.py build script

python USD/build_scripts/build_usd.py -v $HOME/Projects/Pixar/BUILD/USD

If the build succeeded, set up environment variables so that the USD binaries and python bindings can be found:

export PYTHONPATH=$PYTHONPATH:$HOME/Projects/Pixar/BUILD/USD/lib/python
export PATH=$PATH:$HOME/Projects/Pixar/BUILD/USD/bin

And test:

usdview ./USD/extras/usd/tutorials/convertingLayerFormats/Sphere.usda

Using build club to build USD

Building USD on macOS

Building USD this way will create a local cache of all the libraries USD depends on as well as USD itself.

Pick this method if you need to exercise absolute control over the libraries and don't want to mix them in with your system paths.

Run the following in your projects directory:

  git clone https://github.com/PixarAnimationStudios/USD.git
  cd USD
  git checkout dev
  cd ..
  git clone https://github.com/vfxpro99/usd-build-club.git
  mkdir stage
  cd stage
  ../usd-build-club/build-prerequisites-macos.sh
  pip install -U pyside
  ../usd-build-club/configure-macos.sh Xcode
  cmake --build . --target install --config Release

Building USD on macOS - Experimental

Building USD this way will create a local cache of all the libraries USD depends on as well as USD itself.

Pick this method if you need to exercise absolute control over the libraries and don't want to mix them in with your system paths.

Run the following in your project directory:

  git clone https://github.com/vfxpro99/usd-build-club.git
  mkdir stage
  cd stage
  ../usd-build-club/build-macos.sh

Building USD on macOS using Brew

Building USD on macOS using Brew will install brew, USD's prerequisites, USD, and a local copy of python in your stage directory.

  git clone https://github.com/vfxpro99/usd-build-club.git
  mkdir stage
  cd stage
  ../usd-build-club/build-macos-brew.sh

When the build is complete, run the following within a terminal to initialize the run time environment:

  cd /path/to/my/stage
  source ../usd-build-club/setvars-macos-brew.sh
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.