Skip to content

Commit

Permalink
Merge release v24.05
Browse files Browse the repository at this point in the history
  • Loading branch information
pixar-oss committed Apr 19, 2024
2 parents f941bce + 934d68d commit 2864f3d
Show file tree
Hide file tree
Showing 1,080 changed files with 53,208 additions and 81,907 deletions.
11 changes: 8 additions & 3 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,15 @@ that depend on Metal, including:

##### Vulkan

Vulkan support for USD is currently experimental and disabled by default.

Building USD with Vulkan enabled requires the Vulkan SDK and glslang to
be installed. The VULKAN_SDK environment variable must point to the
location of the SDK. The glslang compiler headers must be locatable during
the build process.
be installed. If you wish to build a debug build on Windows, please make sure
you have the optional component "Shader Toolchain Debug Symbols" installed as
part of the Vulkan SDK.

The VULKAN_SDK environment variable must point to the location of the SDK. The
glslang compiler headers must be locatable during the build process.

Support for Vulkan can optionally be enabled by specifying the cmake flag
`PXR_ENABLE_VULKAN_SUPPORT=TRUE`.
Expand Down
366 changes: 363 additions & 3 deletions CHANGELOG.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ For example, the following will download, build, and install USD's dependencies,
then build and install USD into `/path/to/my_usd_install_dir`.

```
> python USD/build_scripts/build_usd.py /path/to/my_usd_install_dir
> python OpenUSD/build_scripts/build_usd.py /path/to/my_usd_install_dir
```

##### MacOS:
Expand All @@ -138,7 +138,7 @@ For example, the following will download, build, and install USD's dependencies,
then build and install USD into `/path/to/my_usd_install_dir`.

```
> python USD/build_scripts/build_usd.py /path/to/my_usd_install_dir
> python OpenUSD/build_scripts/build_usd.py /path/to/my_usd_install_dir
```

##### Windows:
Expand All @@ -153,7 +153,7 @@ For example, the following will download, build, and install USD's dependencies,
then build and install USD into `C:\path\to\my_usd_install_dir`.

```
C:\> python USD\build_scripts\build_usd.py "C:\path\to\my_usd_install_dir"
C:\> python OpenUSD\build_scripts\build_usd.py "C:\path\to\my_usd_install_dir"
```

#### 4. Try it out
Expand All @@ -162,7 +162,7 @@ Set the environment variables specified by the script when it finishes and
launch `usdview` with a sample asset.

```
> usdview USD/extras/usd/tutorials/convertingLayerFormats/Sphere.usda
> usdview OpenUSD/extras/usd/tutorials/convertingLayerFormats/Sphere.usda
```

Contributing
Expand Down
4 changes: 2 additions & 2 deletions VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ Our test machines have the following software versions installed.
| Qt for Python | PySide2 5.15.2.1 | PySide6 6.3.1 | PySide2 5.15.2.1 |
| PyOpenGL | 3.1.5 | 3.1.5 | 3.1.5 |
| Embree | 3.2.2 | 3.13.3 | 3.2.2 |
| RenderMan | 24.4, 25.0 | 24.4, 25.0 | 24.4, 25.0 |
| RenderMan | 25.3 | 25.3 | 25.3 |
| Alembic | 1.8.5 | 1.8.5 | 1.8.5 |
| OpenEXR | 3.1.11 | 3.1.11 | 3.1.11 |
| MaterialX | 1.38.7 | 1.38.7 | 1.38.7 |
| MaterialX | 1.38.8 | 1.38.8 | 1.38.8 |
| Jinja2 | 2.0 | | |
| Flex | 2.5.39 | | |
| Bison | 2.4.1 | | |
Expand Down
2 changes: 1 addition & 1 deletion azure-pypi-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ stages:
$(PYTHON_INTERPRETER) build_scripts/build_usd.py --build-args USD,"-DPXR_PY_UNDEFINED_DYNAMIC_LOOKUP=ON -DPXR_BUILD_USD_TOOLS=OFF -DPXR_INSTALL_LOCATION=../pluginfo" --no-materialx --no-imaging --no-examples --no-tutorials --generator Xcode --build-target universal --build $HOME/USDgen/build --src $HOME/USDgen/src $HOME/USDinst -v
displayName: 'Building USD'
- bash: |
$(PYTHON_INTERPRETER) -m pip install delocate wheel
$(PYTHON_INTERPRETER) -m pip install delocate~=0.10.2 wheel
displayName: 'Installing python packages'
- bash: |
mkdir ./packaging
Expand Down
80 changes: 28 additions & 52 deletions build_scripts/build_usd.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ def GetVisualStudioCompilerAndVersion():

msvcCompiler = which('cl')
if msvcCompiler:
# VisualStudioVersion environment variable should be set by the
# VCToolsVersion environment variable should be set by the
# Visual Studio Command Prompt.
match = re.search(
r"(\d+)\.(\d+)",
os.environ.get("VisualStudioVersion", ""))
os.environ.get("VCToolsVersion", ""))
if match:
return (msvcCompiler, tuple(int(v) for v in match.groups()))
return None
Expand All @@ -154,16 +154,17 @@ def IsVisualStudioVersionOrGreater(desiredVersion):
return version >= desiredVersion
return False

# Helpers to determine the version of "Visual Studio" (also support the Build Tools) based
# on the version of the MSVC compiler.
# See MSVC++ versions table on https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B
def IsVisualStudio2022OrGreater():
VISUAL_STUDIO_2022_VERSION = (17, 0)
VISUAL_STUDIO_2022_VERSION = (14, 30)
return IsVisualStudioVersionOrGreater(VISUAL_STUDIO_2022_VERSION)

def IsVisualStudio2019OrGreater():
VISUAL_STUDIO_2019_VERSION = (16, 0)
VISUAL_STUDIO_2019_VERSION = (14, 20)
return IsVisualStudioVersionOrGreater(VISUAL_STUDIO_2019_VERSION)

def IsVisualStudio2017OrGreater():
VISUAL_STUDIO_2017_VERSION = (15, 0)
VISUAL_STUDIO_2017_VERSION = (14, 1)
return IsVisualStudioVersionOrGreater(VISUAL_STUDIO_2017_VERSION)

def GetPythonInfo(context):
Expand Down Expand Up @@ -283,8 +284,8 @@ def Run(cmd, logCommandOutput = True):
if verbosity < 3:
with open("log.txt", "r") as logfile:
Print(logfile.read())
raise RuntimeError("Failed to run '{cmd}'\nSee {log} for more details."
.format(cmd=cmd, log=os.path.abspath("log.txt")))
raise RuntimeError("Failed to run '{cmd}' in {path}.\nSee {log} for more details."
.format(cmd=cmd, path=os.getcwd(), log=os.path.abspath("log.txt")))

@contextlib.contextmanager
def CurrentWorkingDirectory(dir):
Expand Down Expand Up @@ -723,6 +724,9 @@ def InstallBoost_Helper(context, force, buildArgs):
# However, there are some cases where a newer version is required.
# - Building with Python 3.11 requires boost 1.82.0 or newer
# (https://github.com/boostorg/python/commit/a218ba)
# - Building on MacOS requires v1.82.0 or later for C++17 support starting
# with Xcode 15. We choose to use this version for all MacOS builds for
# simplicity."
# - Building with Python 3.10 requires boost 1.76.0 or newer
# (https://github.com/boostorg/python/commit/cbd2d9)
# XXX: Due to a typo we've been using 1.78.0 in this case for a while.
Expand All @@ -733,14 +737,12 @@ def InstallBoost_Helper(context, force, buildArgs):
# compatibility issues on Big Sur and Monterey.
pyInfo = GetPythonInfo(context)
pyVer = (int(pyInfo[3].split('.')[0]), int(pyInfo[3].split('.')[1]))
if context.buildPython and pyVer >= (3, 11):
if MacOS() or (context.buildPython and pyVer >= (3,11)):
BOOST_URL = "https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.zip"
elif context.buildPython and pyVer >= (3, 10):
BOOST_URL = "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.zip"
elif IsVisualStudio2022OrGreater():
BOOST_URL = "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.zip"
elif MacOS():
BOOST_URL = "https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.zip"
else:
BOOST_URL = "https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.zip"

Expand Down Expand Up @@ -788,7 +790,7 @@ def InstallBoost_Helper(context, force, buildArgs):
primaryArch, secondaryArch)

if macOSArch:
bootstrapCmd += " cxxflags=\"{0}\" " \
bootstrapCmd += " cxxflags=\"{0} -std=c++17 -stdlib=libc++\" " \
" cflags=\"{0}\" " \
" linkflags=\"{0}\"".format(macOSArch)
bootstrapCmd += " --with-toolset=clang"
Expand Down Expand Up @@ -904,7 +906,7 @@ def InstallBoost_Helper(context, force, buildArgs):
# https://github.com/boostorg/container/commit/79a75f470e75f35f5f2a91e10fcc67d03b0a2160
b2_settings.append(f"define=BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT=0")
if macOSArch:
b2_settings.append("cxxflags=\"{0}\"".format(macOSArch))
b2_settings.append("cxxflags=\"{0} -std=c++17 -stdlib=libc++\"".format(macOSArch))
b2_settings.append("cflags=\"{0}\"".format(macOSArch))
b2_settings.append("linkflags=\"{0}\"".format(macOSArch))

Expand Down Expand Up @@ -952,7 +954,8 @@ def InstallBoost(context, force, buildArgs):
TBB_URL = "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2020.3.zip"
TBB_INTEL_URL = "https://github.com/oneapi-src/oneTBB/archive/refs/tags/2018_U1.zip"
else:
TBB_URL = "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2020.3.zip"
# Use point release with fix https://github.com/oneapi-src/oneTBB/pull/833
TBB_URL = "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2020.3.1.zip"

def InstallTBB(context, force, buildArgs):
if Windows():
Expand Down Expand Up @@ -1354,36 +1357,18 @@ def InstallOpenSubdiv(context, force, buildArgs):
'-DNO_TESTS=ON',
'-DNO_GLEW=ON',
'-DNO_GLFW=ON',
'-DNO_PTEX=ON',
'-DNO_TBB=ON',
]

# If Ptex support is disabled in USD, disable support in OpenSubdiv
# as well. This ensures OSD doesn't accidentally pick up a Ptex
# library outside of our build.
if not context.enablePtex:
extraArgs.append('-DNO_PTEX=ON')

# NOTE: For now, we disable TBB in our OpenSubdiv build.
# This avoids an issue where OpenSubdiv will link against
# all TBB libraries it finds, including libtbbmalloc and
# libtbbmalloc_proxy. On Linux and MacOS, this has the
# unwanted effect of replacing the system allocator with
# tbbmalloc.
extraArgs.append('-DNO_TBB=ON')
# Use Metal for macOS and all Apple embedded systems.
if MacOS():
extraArgs.append('-DNO_OPENGL=ON')

# Add on any user-specified extra arguments.
extraArgs += buildArgs

# OpenSubdiv seems to error when building on windows w/ Ninja...
# ...so just use the default generator (ie, Visual Studio on Windows)
# until someone can sort it out
oldGenerator = context.cmakeGenerator
if oldGenerator == "Ninja" and Windows():
context.cmakeGenerator = None

try:
RunCMake(context, force, extraArgs)
finally:
context.cmakeGenerator = oldGenerator
RunCMake(context, force, extraArgs)

OPENSUBDIV = Dependency("OpenSubdiv", InstallOpenSubdiv,
"include/opensubdiv/version.h")
Expand Down Expand Up @@ -1491,19 +1476,10 @@ def InstallDraco(context, force, buildArgs):
############################################################
# MaterialX

MATERIALX_URL = "https://github.com/materialx/MaterialX/archive/v1.38.7.zip"
MATERIALX_URL = "https://github.com/materialx/MaterialX/archive/v1.38.8.zip"

def InstallMaterialX(context, force, buildArgs):
with CurrentWorkingDirectory(DownloadURL(MATERIALX_URL, context, force)):
# MaterialX 1.38.7 fails to build on windows using VS2017 because of a
# missing header include, following patch fixes the same. This patch
# should be removed when underlying issue is resolved.
# https://github.com/AcademySoftwareFoundation/MaterialX/issues/1401
if IsVisualStudio2017OrGreater() and not IsVisualStudio2019OrGreater():
PatchFile("source\\MaterialXGenMsl\\MslShaderGenerator.cpp",
[("#include <MaterialXGenMsl/MslShaderGenerator.h>",
"#include <cctype>\n" +
"#include <MaterialXGenMsl/MslShaderGenerator.h>")])
cmakeOptions = ['-DMATERIALX_BUILD_SHARED_LIBS=ON',
'-DMATERIALX_BUILD_TESTS=OFF'
]
Expand Down Expand Up @@ -1543,9 +1519,9 @@ def InstallEmbree(context, force, buildArgs):
############################################################
# AnimX

# This GitHub project has no releases, so we take the latest.
# As of 2023, there have been no commits since 2018.
ANIMX_URL = "https://github.com/Autodesk/animx/archive/refs/heads/master.zip"
# This GitHub project has no releases, so we fixed on the latest commit as of
# 2024-02-06 - 5db8ee4, which was committed on 2018-11-05
ANIMX_URL = "https://github.com/Autodesk/animx/archive/5db8ee416d5fa7050357f498d4dcfaa6ff3f7738.zip"

def InstallAnimX(context, force, buildArgs):
with CurrentWorkingDirectory(DownloadURL(ANIMX_URL, context, force)):
Expand Down
23 changes: 23 additions & 0 deletions cmake/defaults/Options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,29 @@ option(PXR_PREFER_SAFETY_OVER_SPEED
"Enable certain checks designed to avoid crashes or out-of-bounds memory reads with malformed input files. These checks may negatively impact performance."
ON)

if(APPLE)
# Cross Compilation detection as defined in CMake docs
# Required to be handled here so it can configure options later on
# https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-ios-tvos-visionos-or-watchos
# Note: All these SDKs may not be supported by OpenUSD, but are all listed here for future proofing
set(PXR_APPLE_EMBEDDED OFF)
if (CMAKE_SYSTEM_NAME MATCHES "iOS"
OR CMAKE_SYSTEM_NAME MATCHES "tvOS"
OR CMAKE_SYSTEM_NAME MATCHES "visionOS"
OR CMAKE_SYSTEM_NAME MATCHES "watchOS")
set(PXR_APPLE_EMBEDDED ON)
if(${PXR_BUILD_USD_TOOLS})
MESSAGE(STATUS "Setting PXR_BUILD_USD_TOOLS=OFF because they are not supported on Apple embedded platforms")
set(PXR_BUILD_USD_TOOLS OFF)
endif()
if (${PXR_BUILD_IMAGING})
MESSAGE(STATUS "Setting PXR_BUILD_USD_IMAGING=OFF because it is not supported on Apple embedded platforms")
set(PXR_BUILD_IMAGING OFF)
endif ()
endif ()
endif()


# Determine GFX api
# Metal only valid on Apple platforms
set(pxr_enable_metal "OFF")
Expand Down
10 changes: 7 additions & 3 deletions cmake/defaults/Packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,22 @@ if (PXR_BUILD_IMAGING)
add_definitions(-DPXR_METAL_SUPPORT_ENABLED)
endif()
if (PXR_ENABLE_VULKAN_SUPPORT)
message(STATUS "Enabling experimental feature Vulkan support")
if (EXISTS $ENV{VULKAN_SDK})
# Prioritize the VULKAN_SDK includes and packages before any system
# installed headers. This is to prevent linking against older SDKs
# that may be installed by the OS.
# XXX This is fixed in cmake 3.18+
include_directories(BEFORE SYSTEM $ENV{VULKAN_SDK} $ENV{VULKAN_SDK}/include $ENV{VULKAN_SDK}/lib)
set(ENV{PATH} "$ENV{VULKAN_SDK}:$ENV{VULKAN_SDK}/include:$ENV{VULKAN_SDK}/lib:$ENV{PATH}")
include_directories(BEFORE SYSTEM $ENV{VULKAN_SDK} $ENV{VULKAN_SDK}/include $ENV{VULKAN_SDK}/lib $ENV{VULKAN_SDK}/source)
set(ENV{PATH} "$ENV{VULKAN_SDK}:$ENV{VULKAN_SDK}/include:$ENV{VULKAN_SDK}/lib:$ENV{VULKAN_SDK}/source:$ENV{PATH}")
find_package(Vulkan REQUIRED)
list(APPEND VULKAN_LIBS Vulkan::Vulkan)

# Find the extra vulkan libraries we need
set(EXTRA_VULKAN_LIBS shaderc_combined)
if (WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug")
set(EXTRA_VULKAN_LIBS shaderc_combinedd)
endif()
foreach(EXTRA_LIBRARY ${EXTRA_VULKAN_LIBS})
find_library("${EXTRA_LIBRARY}_PATH" NAMES "${EXTRA_LIBRARY}" PATHS $ENV{VULKAN_SDK}/lib)
list(APPEND VULKAN_LIBS "${${EXTRA_LIBRARY}_PATH}")
Expand Down Expand Up @@ -357,4 +361,4 @@ if(REQUIRES_Imath)
endif()
endif()

set(BUILD_SHARED_LIBS "${build_shared_libs}")
set(BUILD_SHARED_LIBS "${build_shared_libs}")
2 changes: 1 addition & 1 deletion cmake/defaults/Version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
# Versioning information
set(PXR_MAJOR_VERSION "0")
set(PXR_MINOR_VERSION "24")
set(PXR_PATCH_VERSION "3") # NOTE: Must not have leading 0 for single digits
set(PXR_PATCH_VERSION "5") # NOTE: Must not have leading 0 for single digits

math(EXPR PXR_VERSION "${PXR_MAJOR_VERSION} * 10000 + ${PXR_MINOR_VERSION} * 100 + ${PXR_PATCH_VERSION}")
Loading

0 comments on commit 2864f3d

Please sign in to comment.