PixarAnimationStudios / OpenUSD

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

Build Error on Mac OS Ventura 13.4.1 #2612

Closed goetzmoritz closed 8 months ago

goetzmoritz commented 1 year ago

Description of Issue

I cannot complete the build with: python3.10 USD/build_scripts/build_usd.py ~/usd --no-examples --no-tests --no-docs --no-ptex --no-openvdb --no-draco --no-materialx --no-examples --prefer-speed-over-safety

System Information (OS, Hardware)

Mac OS Ventura 13.4.1, Apple M1 Hardware cmake 3.27.20230822-g93e09f0 PySide6 6.5.2 PyOpenGL 3.1.7

I get this error:

Undefined symbols for architecture arm64:
  "OpenSubdiv::v3_4_4::Far::TopologyRefiner::TopologyRefiner(OpenSubdiv::v3_4_4::Sdc::SchemeType, OpenSubdiv::v3_4_4::Sdc::Options)", referenced from:
      pxrInternal_v0_23__pxrReserved__::PxOsdRefinerFactory::Create(pxrInternal_v0_23__pxrReserved__::PxOsdMeshTopology const&, std::__1::vector<pxrInternal_v0_23__pxrReserved__::VtArray<int>, std::__1::allocator<pxrInternal_v0_23__pxrReserved__::VtArray<int>>> const&, pxrInternal_v0_23__pxrReserved__::TfToken) in refinerFactory.cpp.o
  "OpenSubdiv::v3_4_4::Far::TopologyRefiner::~TopologyRefiner()", referenced from:
      pxrInternal_v0_23__pxrReserved__::PxOsdRefinerFactory::Create(pxrInternal_v0_23__pxrReserved__::PxOsdMeshTopology const&, std::__1::vector<pxrInternal_v0_23__pxrReserved__::VtArray<int>, std::__1::allocator<pxrInternal_v0_23__pxrReserved__::VtArray<int>>> const&, pxrInternal_v0_23__pxrReserved__::TfToken) in refinerFactory.cpp.o
      std::__1::__shared_ptr_pointer<OpenSubdiv::v3_4_4::Far::TopologyRefiner*, std::__1::shared_ptr<OpenSubdiv::v3_4_4::Far::TopologyRefiner>::__shared_ptr_default_delete<OpenSubdiv::v3_4_4::Far::TopologyRefiner, OpenSubdiv::v3_4_4::Far::TopologyRefiner>, std::__1::allocator<OpenSubdiv::v3_4_4::Far::TopologyRefiner>>::__on_zero_shared() in refinerFactory.cpp.o
  "OpenSubdiv::v3_4_4::Far::TopologyRefinerFactoryBase::prepareFaceVaryingChannels(OpenSubdiv::v3_4_4::Far::TopologyRefiner&)", referenced from:
      pxrInternal_v0_23__pxrReserved__::PxOsdRefinerFactory::Create(pxrInternal_v0_23__pxrReserved__::PxOsdMeshTopology const&, std::__1::vector<pxrInternal_v0_23__pxrReserved__::VtArray<int>, std::__1::allocator<pxrInternal_v0_23__pxrReserved__::VtArray<int>>> const&, pxrInternal_v0_23__pxrReserved__::TfToken) in refinerFactory.cpp.o
  "OpenSubdiv::v3_4_4::Far::TopologyRefinerFactoryBase::prepareComponentTopologySizing(OpenSubdiv::v3_4_4::Far::TopologyRefiner&)", referenced from:
      pxrInternal_v0_23__pxrReserved__::PxOsdRefinerFactory::Create(pxrInternal_v0_23__pxrReserved__::PxOsdMeshTopology const&, std::__1::vector<pxrInternal_v0_23__pxrReserved__::VtArray<int>, std::__1::allocator<pxrInternal_v0_23__pxrReserved__::VtArray<int>>> const&, pxrInternal_v0_23__pxrReserved__::TfToken) in refinerFactory.cpp.o
  "OpenSubdiv::v3_4_4::Far::TopologyRefinerFactoryBase::prepareComponentTagsAndSharpness(OpenSubdiv::v3_4_4::Far::TopologyRefiner&)", referenced from:
      pxrInternal_v0_23__pxrReserved__::PxOsdRefinerFactory::Create(pxrInternal_v0_23__pxrReserved__::PxOsdMeshTopology const&, std::__1::vector<pxrInternal_v0_23__pxrReserved__::VtArray<int>, std::__1::allocator<pxrInternal_v0_23__pxrReserved__::VtArray<int>>> const&, pxrInternal_v0_23__pxrReserved__::TfToken) in refinerFactory.cpp.o
  "OpenSubdiv::v3_4_4::Far::TopologyRefinerFactoryBase::prepareComponentTopologyAssignment(OpenSubdiv::v3_4_4::Far::TopologyRefiner&, bool, void (*)(OpenSubdiv::v3_4_4::Vtr::internal::Level::TopologyError, char const*, void const*), void const*)", referenced from:
      pxrInternal_v0_23__pxrReserved__::PxOsdRefinerFactory::Create(pxrInternal_v0_23__pxrReserved__::PxOsdMeshTopology const&, std::__1::vector<pxrInternal_v0_23__pxrReserved__::VtArray<int>, std::__1::allocator<pxrInternal_v0_23__pxrReserved__::VtArray<int>>> const&, pxrInternal_v0_23__pxrReserved__::TfToken) in refinerFactory.cpp.o
  "OpenSubdiv::v3_4_4::Vtr::internal::Level::createFVarChannel(int, OpenSubdiv::v3_4_4::Sdc::Options const&)", referenced from:
      pxrInternal_v0_23__pxrReserved__::PxOsdRefinerFactory::Create(pxrInternal_v0_23__pxrReserved__::PxOsdMeshTopology const&, std::__1::vector<pxrInternal_v0_23__pxrReserved__::VtArray<int>, std::__1::allocator<pxrInternal_v0_23__pxrReserved__::VtArray<int>>> const&, pxrInternal_v0_23__pxrReserved__::TfToken) in refinerFactory.cpp.o
  "OpenSubdiv::v3_4_4::Vtr::internal::Level::getFaceFVarValues(int, int)", referenced from:
      pxrInternal_v0_23__pxrReserved__::PxOsdRefinerFactory::Create(pxrInternal_v0_23__pxrReserved__::PxOsdMeshTopology const&, std::__1::vector<pxrInternal_v0_23__pxrReserved__::VtArray<int>, std::__1::allocator<pxrInternal_v0_23__pxrReserved__::VtArray<int>>> const&, pxrInternal_v0_23__pxrReserved__::TfToken) in refinerFactory.cpp.o
  "OpenSubdiv::v3_4_4::Vtr::internal::Level::findEdge(int, int) const", referenced from:
      pxrInternal_v0_23__pxrReserved__::PxOsdRefinerFactory::Create(pxrInternal_v0_23__pxrReserved__::PxOsdMeshTopology const&, std::__1::vector<pxrInternal_v0_23__pxrReserved__::VtArray<int>, std::__1::allocator<pxrInternal_v0_23__pxrReserved__::VtArray<int>>> const&, pxrInternal_v0_23__pxrReserved__::TfToken) in refinerFactory.cpp.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [pxr/imaging/pxOsd/libusd_pxOsd.dylib] Error 1
make[1]: *** [pxr/imaging/pxOsd/CMakeFiles/pxOsd.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

I tried to get past this by installing opensubdiv from homebrew: brew install opensubdiv But it did not help.

jesschimein commented 1 year ago

Filed as internal issue #USD-8609

dgovil commented 1 year ago

Is your homebrew running as x86_64? The error is most likely because your opensubdiv install is being found from homebrew and it's an Intel build.

Recommended steps would be either of the following:

  1. Remove the homebrew version of opensubdiv and run the build again. Your build should then build opensubdiv as arm64
  2. Switch your homebrew to native arm64 https://github.com/orgs/Homebrew/discussions/2434 and reinstall opensubdiv
  3. Build opensubdiv yourself as arm64 and tell USD where it is
  4. Build USD as x86_64 (not recommended because you'll leave performance on the table)
goetzmoritz commented 1 year ago

Build opensubdiv yourself as arm64 and tell USD where it is <= How do I do this?

dgovil commented 1 year ago

I'd recommend trying the first step I mentioned above before trying a custom build. I'd also recommend trying the second step in general because your homebrew is installing Intel binaries which means you're not getting all the performance you could from your homebrew packages.

But anyway if you did want to proceed with a custom build , the general steps are:

You'd clone https://github.com/PixarAnimationStudios/OpenSubdiv, run the cmake build with CMAAKE_OSX_ARCHITECTURES set to arm64, and then pass OPENSUBDIV_ROOT to the usd build script or cmake.

But again, if you're not comfortable building these libraries, I'd really recommend starting with the first two steps.

goetzmoritz commented 1 year ago

I was successful getting the arm64 version of opensubdiv with homebrew. Now, my question is: How do I tell build_usd.py that I have my "own" opensubdiv downloaded via homebrew?

meshula commented 1 year ago

The FindOpenSubdiv.cmake script looks for this variable: OPENSUBDIV_ROOT_DIR so you can pass that in via

-DOPENSUBDIV_ROOT_DIR=/path/to/my/OpenSubdiv

Note however that this should have worked automatically.

Since you are installing to ~/usd according to your command line, in the directory ~/usd/build/usd there should be a file named CMakeCache.txt.

If you look in that file, you should find a line similar to this:

//Details about finding OpenSubdiv
FIND_PACKAGE_MESSAGE_DETAILS_OpenSubdiv:INTERNAL=[/Users/yourname/usd/include][/Users/yourname/usd/lib/libosdCPU.dylib;/Users/yourname/usd/lib/libosdGPU.dylib][v3.5.0(3)]

could you check that and report what you see?

goetzmoritz commented 1 year ago

I did:

FIND_PACKAGE_MESSAGE_DETAILS_OpenSubdiv:INTERNAL=[/opt/local/USD/lib/opensubdiv.framework [/Users/myuser/usd/lib/libosdCPU.dylib;/Users/myuser/usd/lib/libosdGPU.dylib][v(3)]

spiffmon commented 1 year ago

Hi @goetzmoritz , sorry for the silence - did you find a resolution for this?

spiffmon commented 8 months ago

Closing - please reopen if you have further questions - thanks!