Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWIG build step failing #361

Closed
nickblockFB opened this issue Mar 30, 2023 · 2 comments
Closed

SWIG build step failing #361

nickblockFB opened this issue Mar 30, 2023 · 2 comments

Comments

@nickblockFB
Copy link

I cannot get past the SWIG build step.

Windows 10,
MSVC 2019
Swig 3.0.12
USD 22.08
Unity 2022.1.8f1

Built USD using the command line in BUILDING.md

When running:

python3 bin/build.py --usd_version 20.08 --library_path ..\artifacts-usd-22.08 --unity_version 2022.1.8f1

output looks good until:

INFO:root:================================================================================
INFO:root:Running CMake:
cmake -S . -B ./build_usdcs  -DPXR_USD_LOCATION="C:\Users\me\Documents\artifacts-usd-22.08\usd-v20.08-python36\usd-v20.08_no_python" -DPXR_USD_LOCATION_PYTHON_BUILD="C:\Users\me\Documents\artifacts-usd-22.08\usd-v20.08-python36\usd-v20.08" -DUNITY_VERSION=2022.1.8f1  -DBUILD_USDCS=True  -DBUILD_USD_NET=False  -DBUILD_TESTS=False  -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_MODULE_PATH=./cmake/modules -DUSE_CUSTOM_MONO=False -G "Visual Studio 16 2019"


-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19044.
C:\Users\me\Documents\artifacts-usd-22.08\usd-v20.08-python36\usd-v20.08
-- USD include dir: C:/Users/me/Documents/artifacts/usd-v20.08-python36/usd-v20.08_no_python/include
-- USD library dir: C:/Users/me/Documents/artifacts/usd-v20.08-python36/usd-v20.08_no_python/lib
-- USD bin dir: C:/Users/me/Documents/artifacts/usd-v20.08-python36/usd-v20.08_no_python/bin
-- USD version:
Python exec     
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/me/Documents/usd-unity-sdk/build_usdcs
INFO:root:


INFO:root:Running CMake build:
cmake --build ./build_usdcs --config RelWithDebInfo --target install


Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  -[ Generating type info from USD python ]-
  Generating Sdf 
  Generating Vt 
  Generating UsdGeom
  Generating UsdLux
  Generating UsdRi
  Generating UsdShade
  Generating UsdSkel
  Generating Kind
  Swig compile C:/Users/me/Documents/usd-unity-sdk/src/Swig/usdCs.i for csharp
C:\Users\me\Documents\usd-unity-sdk\src\Swig\pxr\pxr.i(79): error : Unable to find 'pxr\base\tf\declarePtrs.h' [C:\Users\me\Documents\usd-unity-sdk\build_usdcs\src\UsdCs\UsdCs.vcx
proj]
C:\Users\me\Documents\usd-unity-sdk\src\Swig\pxr\base\tf\tfStringUtils.i(30): error : Unable to find 'pxr\base\tf\stringUtils.h' [C:\Users\me\Documents\usd-unity-sdk\build_usdcs\s 
rc\UsdCs\UsdCs.vcxproj]
C:\Users\me\Documents\usd-unity-sdk\src\Swig\pxr\base\tf\tfToken.i(40): error : Unable to find 'pxr\base\tf\token.h' [C:\Users\me\Documents\usd-unity-sdk\build_usdcs\src\UsdCs\Usd 
Cs.vcxproj]
C:\Users\me\Documents\usd-unity-sdk\src\Swig\pxr\base\tf\tf.i(30): error : Unable to find 'pxr\base\tf\token.h' [C:\Users\me\Documents\usd-unity-sdk\build_usdcs\src\UsdCs\UsdCs.vc 
xproj]
C:\Users\me\Documents\usd-unity-sdk\src\Swig\pxr\base\js\jsValue.i(23): error : Unable to find 'pxr\base\js\value.h' [C:\Users\me\Documents\usd-unity-sdk\build_usdcs\src\UsdCs\Usd 
Cs.vcxproj]
C:\Users\me\Documents\usd-unity-sdk\src\Swig\pxr\base\js\jsTypes.i(30): error : Unable to find 'pxr\base\js\types.h' [C:\Users\me\Documents\usd-unity-sdk\build_usdcs\src\UsdCs\Usd 
Cs.vcxproj]

...and many more errors alike.

i tried calling swig manually with the include path to the USD artifact:

swig -csharp -I<localpath>\artifacts-usd-22.08\usd-v20.08-python36\usd-v20.08\include <localpath>/usd-unity-sdk/src/Swig/usdCs.i

siimlar but different:


<localpath>\usd-unity-sdk\src\Swig\pxr\usd\usdLux\lightPortal.i(22) : Error: Unable to find 'pxr\usd\usdLux\lightPortal.h'
<localpath>\usd-unity-sdk\src\Swig\pxr\usd\usdLux\light.i(22) : Error: Unable to find 'pxr\usd\usdLux\light.h'
<localpath>\usd-unity-sdk\src\Swig\pxr\usd\usdRi\lightFilterAPI.i(22) : Error: Unable to find 'pxr\usd\usdRi\lightFilterAPI.h'
<localpath>\usd-unity-sdk\src\Swig\pxr\usd\usdRi\lightPortalAPI.i(22) : Error: Unable to find 'pxr\usd\usdRi\lightPortalAPI.h'
<localpath>\usd-unity-sdk\src\Swig\pxr\usd\usdRi\pxrAovLight.i(20) : Error: Unable to find 'pxr\usd\usdRi\pxrAovLight.h'
<localpath>\usd-unity-sdk\src\Swig\pxr\usd\usdRi\pxrBarnLightFilter.i(20) : Error: Unable to find 'pxr\usd\usdRi\pxrBarnLightFilter.h'

these files like "pxr\usd\usdLux\lightPortal.h" dont exist in USD at all.

Any ideas?

@SimonBoorer
Copy link
Collaborator

Hi @nickblockFB,

USD 22.08 is not currently supported.

That said, CMake should be taking care of passing the USD include directory to Swig:
https://github.com/Unity-Technologies/usd-unity-sdk/blob/dev/src/UsdCs/CMakeLists.txt#L52-L60

You can try adding:
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON

To the CMake arguments in bin/build.py to see how it is invoking SWIG:
https://github.com/Unity-Technologies/usd-unity-sdk/blob/dev/bin/build.py#L128-L143

The errors that you are getting after calling SWIG manually are due to changes to the USD API between USD 20.08 and 22.08 that have not been reflected in the bindings, e.g. UsdLuxLight was replaced with the UsdLuxLightAPI, UsdLuxLightPortal was replaced with UsdLuxPortalLight.

@nickblockFB
Copy link
Author

Ah wrong version!!

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants