Compiling Pixar’s USD natively on Windows 11 / VS 2022


If you’ve tried it, you’ve probably run into the endless catch-22 that is getting everything to behave when trying to compile the Universal Scene Description on a newly setup Windows machine.

NOTE: if there’s any way for you to avoid this in your life, don’t look back, rejoice.

Prerequisites

You’ll need to install at least the following to get your toolset ready:

  • Python 3.7 or newer (I used 3.11 as it was just released) – install system-wide
  • Git – install system-wide
  • NASM – install system-wide
  • CMake 3.24 or newer – install system-wide
  • Visual Studio 2022 – install just the basic components, no C# or other bloatware (it’s still >9GB)

Add NASM and CMake to your PATH environment variable – you can do this right before building too, by typing:

set PATH=%PATH%;C:\Program Files\NASM;C:\Program Files\CMake\bin

This depends on where you installed them, in my case I used the zipped version of CMake and extracted it under C:\Program Files\CMake

Pip modules

Install at least the pyopengl and pyside6 packages with pip:

pip install pyopengl pyside6

Building

Go to wherever you keep your sources, and pull down the USD git repository:

git clone https://github.com/PixarAnimationStudios/USD.git

Patch the boost version used – the build script build_scripts/build_usd.py will want to use 1.70 on windows, but that won’t support VS 2022. Find this segment and modify the Windows part to use 1.79 instead:

elif Windows():
    # ... a comment here about why 1.70 is used to support older VS
    BOOST_URL = "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.gz"
    BOOST_VERSION_FILE = "include/boost-1_79/boost/version.hpp"

Decide where you want your built USD to go, in this example we’ll use C:\opt\USD as the target folder. Now you’re ready to run the build script (with your preferred build flags, of course):

python build_scripts\build_usd.py --no-examples --no-tutorials --tools --python --no-docs --usd-imaging --usdview --embree --alembic --hdf5 --generator "Visual Studio 17 2022" --toolset=v143 C:\opt\USD

Leave reply:

Your email address will not be published.

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.