Skip to content

USD on Windows

Nick Porcino edited this page Nov 5, 2019 · 18 revisions

Building USD on Windows

Whether you build USD with build club, or Pixar's script you are going to need some prerequisites. Before you start, make sure the following are satisfied:

Prereqs:

  1. Install the 64 bit version of Python 2.7.x and Pip. When using the python.msi installer, installing pip, and putting Python in %PATH% are both options that should be selected.
  2. pip install PySide
  3. pip install pyopengl (required for usdview)
  4. pip install jinja2
  5. Ensure PySide tools (in python27/scripts) are visible on %PATH%. pip probably put it there already.
  6. Install CMake and make sure its on your %PATH%. The cmake version must be at least 3.10.1 due to breaking changes with vs2017 and boost; cmake won't be able to detect bosos
  7. Install NASM from http://www.nasm.us/. Make sure it's on your %PATH% in the working terminal
  8. Install 7-Zip, make sure 7z is on your %PATH% in the working terminal

If you are going to develop your own schemas, then you will also need flex and bison. They are not required to build and use USD using only the standard schemas.

  1. Download & unzip win-flex and bison from https://sourceforge.net/projects/winflexbison/, put them in the %PATH%.

pixar method

Once the prerequisites above have been satisfied, follow the instructions in the USD readme.

https://github.com/PixarAnimationStudios/USD/#3-run-the-script

build club method

Run the commands below in a 64-bit VS2015 Developer command prompt.

Side note about Alembic: For the moment, Alembic is being compiled without HDF5 support. The reason is that the HDF5 integer and floating point detection logic works by forcing failures and watching for them. This makes MSVC pop up numerous Assertion dialogs, forcing you, the developer to "Ignore" and "Cancel" each and every one of them. This party game is super annoying, and HDF5 support in Alembic is being phased out, so build club builds Alembic without HDF5 support.

  mkdir Projects
  cd Projects
    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-vs2017.cmd

Still in the stage directory, continue:

  ..\usd-build-club\configure-windows.cmd

The previous command will leave you in stage/build/USD. In that directory, continue:

  cmake --build . --target install --config Release -- /maxcpucount:16

For debug builds (at least currently), OpenSubdiv must be compiled in debug config (edit OpenSubdiv.cmd) and two files must be edited in the USD source directory:

cmake/defaults/msvcdefaults.cmake

  • uncomment add_definitions("/DTBB_USE_DEBUG=1")

cmake/defaults/Packages.cmake

  • line 45: set(TBB_USE_DEBUG_BUILD ON)

Using the install:

  1. Add [PATH TO STAGE]\local\bin to %PATH%
  2. Add [PATH TO STAGE]\local\lib to %PATH%
  3. Add [PATH TO STAGE]\local\lib\python to %PYTHONPATH%

Test the build:

  1. python> from pxr import Usd

#Building USD on Windows - Experimental

Install the required programs such as python and so on as above. The build-windows.cmd script takes two optional arguments: debug to build as Debug instead of Release, and prereq to build the prerequisites before building USD itself. Note that at this time, only release option works.

In the project directory -

  git clone https://github.com/vfxpro99/usd-build-club.git
  mkdir stage
  cd stage
  ..\usd-build-club\build-windows.cmd prereq release