maya-usd icon indicating copy to clipboard operation
maya-usd copied to clipboard

Include tbb12 library for LookdevXUfe on Windows-Maya2026.0 only

Open raph080 opened this issue 5 months ago • 3 comments

Overview

Add support for tbb12 library dependency on Windows for Maya 2026.0 Only to prevent a crash: LINK : fatal error LNK1104: cannot open file 'tbb12.lib'.

The problem

I was trying to compile MayaUSD for Windows 11 - Maya 2026.0 and I face this error during compilation: LINK : fatal error LNK1104: cannot open file 'tbb12.lib' [C:\Users\raphael.jouretz\tmp\MayaUSD-0.33.0-complied\build\RelWithDebInfo\lib\lookdevXUsd\lookdevXUsd.vcxproj]

After some investigation, I noticed that devkitBase\devkit\ufe\extensions\lookdevXUfe\lib is the only 2026 version that contains an extra dependency: tbb12.lib. Other 2026.X and OS do not have that lib. See https://aps.autodesk.com/developer/overview/maya -> Download SDKs 2019–2026 for Windows -> Maya 2026 win64 DevKit.

The fix

lookdevXUsd will complain that it does not find tbb12.lib, so we need to add that extra lib in the target link libraries. Currently it contains ${LookdevXUfe_LIBRARY} https://github.com/Autodesk/maya-usd/blob/d1fb61847a534cd3fff953ff068da372c61fc6b1/lib/lookdevXUsd/CMakeLists.txt#L134 which points to LookdevXUfe_1_0.lib only. In order to not be too intrusive for other builds, my fix will replace the single value of ${LookdevXUfe_LIBRARY} by a list containing both LookdevXUfe_1_0.lib and ttb12.lib. It would have been better to rename it to ${LookdevXUfe_LIBRARIES} but as I am suspecting that dependency was not expected, this quick fix is good enough.

I am creating this MR in order to keep track so other people who face the same problem have a quick fix. Not sure if we need to patch the official branch as it should not be a problem for future versions/other OSs.

raph080 avatar Oct 19 '25 03:10 raph080

@raph080 Thanks for your interest in contributing to our repo maya-usd. Before we can accept PR from a new contributor, we need you to fill, sign and email the proper CLA (individual or corporate) from the link below: https://github.com/Autodesk/maya-usd/tree/dev/doc/CLA

seando-adsk avatar Oct 20 '25 13:10 seando-adsk

Hi @seando-adsk, thanks for the update. I will fill the CLA as soon as possible.

In the meantime I tried to compile the plugin MayaUSD for Windows and Maya 2026.2. Even if ttb12.lib does not appears in the lib folder for lookdevXUfe anymore (devkitBase\devkit\ufe\extensions\lookdevXUfe\lib), it still seems to be a equired dependency. I just faced the same error. We might need to modify the building process so it could get the one from devkitBase\lib instead. I might work on it later. Thank you!

raph080 avatar Oct 20 '25 18:10 raph080

@raph080 Tbb is part of the Maya devkit, but it should also be part of your USD build and included as a dependency by USD in the pxrConfig.cmake.

Sean

seando-adsk avatar Oct 21 '25 12:10 seando-adsk

Hi @seando-adsk,

I think the main concern is that lookdevXUfe is looking exclusively for tbb12.lib. OpenUSD embeds tbb.lib, which is missing the version number.

raph080 avatar Oct 29 '25 15:10 raph080

Maya 2026 was built with OneTBB and ships with a tbb12.lib. We build USD v24.11 with that same OneTBB and I can see in our pxrTargets.cmake that our USD build links with tbb12.lib.

set_target_properties(tf PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${PXR_USD_LOCATION}/include;${PYTHON_INCLUDE_DIR}"
  INTERFACE_LINK_LIBRARIES "arch;python;Shlwapi.lib;${PXR_USD_LOCATION}/lib/tbb12.lib;Python3::Python"
  INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${PXR_USD_LOCATION}/include;${PYTHON_INCLUDE_DIR}"
)

Are you using your own USD build or the one that ships with MayaUsd? If you use the one that ships with MayaUsd, make sure to extract the file devkit.zip (which contains the USD headers and libs - which is where tbb12.lib is).

Sean

seando-adsk avatar Nov 06 '25 15:11 seando-adsk