adobe / USD-Fileformat-plugins

A collection of USD fileformat plugins
298 stars 22 forks source link

Build Failure (sanityTests.cpp) #15

Closed hzwus closed 4 months ago

hzwus commented 4 months ago

I'm building the plugin library on a Docker container, but encountering the following error during the Linking CXX executable fbxSanityTests phase.

 Building CXX object fbx/tests/CMakeFiles/fbxSanityTests.dir/sanityTests.cpp.o
[ 64%] Linking CXX executable fbxSanityTests
/usr/bin/ld: CMakeFiles/fbxSanityTests.dir/sanityTests.cpp.o: in function `Sanity_LoadCube_Test::TestBody()':
sanityTests.cpp:(.text+0x79): undefined reference to `pxrInternal_v0_24__pxrReserved__::UsdStage::Open(std::string const&, pxrInternal_v0_24__pxrReserved__::UsdStage::InitialLoadSet)'
/usr/bin/ld: sanityTests.cpp:(.text+0xc7): undefined reference to `pxrInternal_v0_24__pxrReserved__::SdfPath::SdfPath(std::string const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [fbx/tests/CMakeFiles/fbxSanityTests.dir/build.make:117: fbx/tests/fbxSanityTests] Error 1
make[1]: *** [CMakeFiles/Makefile2:722: fbx/tests/CMakeFiles/fbxSanityTests.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
root@0626f6fe76d7:/opt/USD-Fileformat-plugins#

One thing to note is that if I set -DUSD_FILEFORMATS_BUILD_TESTS=OFF in the first cmake command, then the build completes. However, the plugins don't work, with the below error if I run something like usdcat mayacube.fbx

Failed to open "mayacube.fbx" - Failed to load plugin 'usdFbx_plugin': /opt/USD-Fileformat-plugins/bin/lib/libfileformatUtils.so: undefined symbol: _ZNK32pxrInternal_v0_24__pxrReserved__7VtValue11GetTypeNameEv in '/opt/USD-Fileformat-plugins/bin/plugin/usd/libusdFbx.so'
Failed to load plugin 'usdFbx_plugin': /opt/USD-Fileformat-plugins/bin/lib/libfileformatUtils.so: undefined symbol: _ZNK32pxrInternal_v0_24__pxrReserved__7VtValue11GetTypeNameEv in '/opt/USD-Fileformat-plugins/bin/plugin/usd/libusdFbx.so'
Cannot determine file format for @mayacube.fbx@

Platform and Version

Ubuntu 20.04 cmake 3.24.0 FBX SDK 2020.2.1 python 3.8.10 OpenUSD 24.03

Steps to Reproduce

I will keep attempting with perhaps a newer Ubuntu release and version of python, but this is the closest I've come to a successful build (I remember getting errors building OpenUSD with Ubuntu 22.04 and later)

hzwus commented 4 months ago

Two mistakes on my part:

Build is successful and plugins are working.

issacclee commented 3 months ago

Hi, Would you mind share the Dockerfile? Thanks!