PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
6.19k stars 1.23k forks source link

Windows - extension class wrapper for base class struct pxrInternal_v0_20__pxrReserved__::Tf_PyEnumWrapper has not been created yet #1155

Closed fdan closed 4 years ago

fdan commented 4 years ago

I followed the instructions to build on windows using the python build script

Steps to Reproduce

  1. python build_usd.py --no-imaging --no-alembic --no-draco --no-materialx --no-katana --no-houdini --no-tests "C:\usd\build"

terminal output indicates success:

Building with settings:
  USD source directory          c:\Users\dan\git\USD
  USD install directory         C:\usd\build
  3rd-party source directory    C:\usd\build\src
  3rd-party install directory   C:\usd\build
  Build directory               C:\usd\build\build
  CMake generator               Default
  Downloader                    curl

  Building                      Shared libraries
    Config                      Release
    Imaging                     Off
      Ptex support:             Off
      OpenVDB support:          Off
      OpenImageIO support:      Off
      OpenColorIO support:      Off
      PRMan support:            Off
    UsdImaging                  Off
      usdview:                  Off
    Python support              On
    Documentation               Off
    Tests                       Off
    Alembic Plugin              Off
      HDF5 support:             Off
    Draco Plugin                Off
    MaterialX Plugin            Off
    Katana Plugin               Off
    Houdini Plugin              Off

  Dependencies                  zlib, boost, TBB
STATUS: Installing zlib...
STATUS: Installing boost...
STATUS: Installing TBB...
STATUS: Installing USD...

Success! To use USD, please ensure that you have:

    The following in your PYTHONPATH environment variable:
    C:\usd\build\lib\python

    The following in your PATH environment variable:
    C:\usd\build\bin
    C:\usd\build\lib
  1. Set env vars in windows env var manager, confirm in cmd prompt - both env vars are correctly set as instructed above

  2. Try to use usdcat on some simple usd, see this error:

C:\Users\--\world_set\assets\setPiece\groundPiece01\description\description>usdcat groundPiece01_description_description.v003.usd
Traceback (most recent call last):
  File "C:\usd\build\bin\usdcat", line 241, in <module>
    sys.exit(main())
  File "C:\usd\build\bin\usdcat", line 165, in main
    from pxr import Usd
  File "C:\usd\build\lib\python\pxr\Usd\__init__.py", line 24, in <module>
    import _usd
RuntimeError: extension class wrapper for base class struct pxrInternal_v0_20__pxrReserved__::Tf_PyEnumWrapper has not been created yet

System Information (OS, Hardware)

Windows 10

Package Versions

Python 2.7 Visual Studio 19 Cmake 3.17

Build Flags

fdan commented 4 years ago

I tried building with Visual Studio 17, followed the instructions and used the x86 Native Tools Command Prompt for VS 2017 prompt, got a huge number of errors ending with:

call "C:\Users\dan\AppData\Local\Temp\b2_msvc_14.1_vcvarsx86_amd64_.cmd" >nul

cl /Zm800 -nologo @"C:\usd\build\build\boost\bin.v2\libs\regex\build\msvc-14.1\release\address-model-64\threading-multi\regex.obj.rsp"

...failed compile-c-c++ C:\usd\build\build\boost\bin.v2\libs\regex\build\msvc-14.1\release\address-model-64\threading-multi\regex.obj... compile-c-c++ C:\usd\build\build\boost\bin.v2\libs\regex\build\msvc-14.1\release\address-model-64\threading-multi\winstances.obj 'cl' is not recognized as an internal or external command, operable program or batch file.

call "C:\Users\dan\AppData\Local\Temp\b2_msvc_14.1_vcvarsx86_amd64_.cmd" >nul

cl /Zm800 -nologo @"C:\usd\build\build\boost\bin.v2\libs\regex\build\msvc-14.1\release\address-model-64\threading-multi\winstances.obj.rsp"

...failed compile-c-c++ C:\usd\build\build\boost\bin.v2\libs\regex\build\msvc-14.1\release\address-model-64\threading-multi\winstances.obj... compile-c-c++ C:\usd\build\build\boost\bin.v2\libs\regex\build\msvc-14.1\release\address-model-64\threading-multi\usinstances.obj 'cl' is not recognized as an internal or external command, operable program or batch file.

call "C:\Users\dan\AppData\Local\Temp\b2_msvc_14.1_vcvarsx86_amd64_.cmd" >nul

cl /Zm800 -nologo @"C:\usd\build\build\boost\bin.v2\libs\regex\build\msvc-14.1\release\address-model-64\threading-multi\usinstances.obj.rsp"

...failed compile-c-c++ C:\usd\build\build\boost\bin.v2\libs\regex\build\msvc-14.1\release\address-model-64\threading-multi\usinstances.obj... ...skipped <pC:\usd\build\build\boost\bin.v2\libs\regex\build\msvc-14.1\release\address-model-64\threading-multi>boost_regex-vc141-mt-1_65_1.dll for lack of <pC:\usd\build\build\boost\bin.v2\libs\regex\build\msvc-14.1\release\address-model-64\threading-multi>c_regex_traits.obj... ...skipped <pC:\usd\build\lib>boost_regex-vc141-mt-1_65_1.dll for lack of <pC:\usd\build\build\boost\bin.v2\libs\regex\build\msvc-14.1\release\address-model-64\threading-multi>boost_regex-vc141-mt-1_65_1.dll... ...skipped <pC:\usd\build\build\boost\bin.v2\libs\regex\build\msvc-14.1\release\address-model-64\threading-multi>boost_regex-vc141-mt-1_65_1.lib for lack of <pC:\usd\build\build\boost\bin.v2\libs\regex\build\msvc-14.1\release\address-model-64\threading-multi>c_regex_traits.obj... ...skipped <pC:\usd\build\lib>boost_regex-vc141-mt-1_65_1.lib for lack of <pC:\usd\build\build\boost\bin.v2\libs\regex\build\msvc-14.1\release\address-model-64\threading-multi>boost_regex-vc141-mt-1_65_1.lib... ...failed updating 56 targets... ...skipped 16 targets... ...updated 13595 targets...

ERROR: Failed to run 'b2 --prefix="C:\usd\build" --build-dir="C:\usd\build\build" -j12 address-model=64 link=shared runtime-link=shared threading=multi variant=release --with-atomic --with-program_options --with-regex --with-python toolset=msvc-14.1 install' See C:\usd\build\src\boost_1_65_1\log.txt for more details.

sunyab commented 4 years ago

Hi @fdan, you are running into two separate issues, both of which have been fixed in the 'dev' branch and will be part of the upcoming 20.05 release:

So you can either try to build the 'dev' branch with VS2019 or use the "x64 Native Tools Command Prompt" to build the 20.02 release with VS2017. Hope that helps!

fdan commented 4 years ago

Ahah, cheers. I have tried with VS 2015 and that seemed to work ok. I can use various utils like usdcat and the python modules successfully.

I tried building the maya plugin, using Maya 2018 (this is using the 19-11 release). I know this has basically been deprecated and moved over to the Autodesk repository, but I was just curious that the build output seemed to indicate success, however there was no "third_party" directory to be found in the build location:

c:\Users\dan\git\USD-19.11\USD-19.11\build_scripts>python build_usd.py --no-imaging --no-alembic --no-draco --no-materialx --no-katana --no-houdini --no-tests --maya --maya-location "C:\Program Files\Autodesk\Maya2018"  "C:\usd_19_11_maya\build"

Building with settings:
  USD source directory          c:\Users\dan\git\USD-19.11\USD-19.11
  USD install directory         C:\usd_19_11_maya\build
  3rd-party source directory    C:\usd_19_11_maya\build\src
  3rd-party install directory   C:\usd_19_11_maya\build
  Build directory               C:\usd_19_11_maya\build\build
  CMake generator               Default
  Downloader                    curl

  Building                      Shared libraries
    Config                      Release
    Imaging                     Off
      Ptex support:             Off
      OpenImageIO support:      Off
      OpenColorIO support:      Off
      PRMan support:            Off
    UsdImaging                  Off
      usdview:                  Off
    Python support              On
    Documentation               Off
    Tests                       Off
    Alembic Plugin              Off
      HDF5 support:             Off
    Draco Plugin                Off
    MaterialX Plugin            Off
    Maya Plugin                 On
    Katana Plugin               Off
    Houdini Plugin              Off

  Dependencies                  zlib, boost, TBB
STATUS: Installing zlib...
STATUS: Installing boost...
STATUS: Installing TBB...
STATUS: Installing USD...

Success! To use USD, please ensure that you have:

    The following in your PYTHONPATH environment variable:
    C:\usd_19_11_maya\build\lib\python

    The following in your PATH environment variable:
    C:\usd_19_11_maya\build\bin
    C:\usd_19_11_maya\build\lib

See documentation at http://openusd.org/docs/Maya-USD-Plugins.html for setting up the Maya plugin.