I am working on a project that requires converting obj files to usd and I received a suggestion to look into the Adobe plugin here. I am building on an AWS EC2 instance running Ubuntu. I guess this isn’t directly OpenUSD related, but I’m a little lost with this output:
ubuntu@ip-172-31-23-122:~/USD-Fileformat-plugins$ cmake --build build
[ 1%] Building CXX object _deps/googletest-build/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
[ 3%] Linking CXX static library ../../../lib/libgtest.a
[ 3%] Built target gtest
[ 5%] Building CXX object utils/CMakeFiles/fileformatUtils.dir/test.cpp.o
[ 7%] Linking CXX shared library libfileformatUtils.so
[ 37%] Built target fileformatUtils
[ 39%] Building CXX object _deps/googletest-build/googletest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o
[ 41%] Linking CXX static library ../../../lib/libgtest_main.a
[ 41%] Built target gtest_main
[ 47%] Built target fmt
[ 49%] Linking CXX shared library libusdObj.so
[ 62%] Built target usdObj
[ 64%] Building CXX object obj/tests/CMakeFiles/objSanityTests.dir/sanityTests.cpp.o
[ 66%] Linking CXX executable objSanityTests
/usr/bin/ld: CMakeFiles/objSanityTests.dir/sanityTests.cpp.o: in function `OBJSanityTests_LoadCube_Test::TestBody()':
sanityTests.cpp:(.text+0xae): undefined reference to `pxrInternal_v0_24__pxrReserved__::UsdStage::Open(std::string const&, pxrInternal_v0_24__pxrReserved__::UsdStage::InitialLoadSet)'
collect2: error: ld returned 1 exit status
gmake[2]: *** [obj/tests/CMakeFiles/objSanityTests.dir/build.make:117: obj/tests/objSanityTests] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:454: obj/tests/CMakeFiles/objSanityTests.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2
It’s not exactly verbose so I was hoping it would look familiar to someone here. I used the suggested build commands but for the options I disabled fbx and gltf. I was getting similar errors for the sanity tests for those but disabled them since I only need obj support. It is also worth mentioning that I was getting errors building draco due to some source files missing include statements like the following:
/home/ubuntu/USD_Adobe/src/draco-1.3.6/src/draco/core/hash_utils.h:27:1: error: ‘size_t’ does not name a type
27 | size_t HashCombine(T1 a, T2 b) {
| ^~~~~~
/home/ubuntu/USD_Adobe/src/draco-1.3.6/src/draco/core/hash_utils.h:21:1: note: ‘size_t’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
20 | #include <functional>
+++ |+#include <cstddef>
21 |
/home/ubuntu/USD_Adobe/src/draco-1.3.6/src/draco/core/hash_utils.h:34:1: error: ‘size_t’ does not name a type
34 | size_t HashCombine(T a, size_t hash) {
I went into the OpenUSD python build script and updated the draco version to 1.5.6, which happened to have those missing include statements in the error output.
Hey thanks for posting, feel free to make a git issue on the plugin repository itself if you run into any issues with the plugins. We are monitoring those closely.
As for your issue, the dependencies can get complicated. I’m curious which version of USD you are using? Are you still having an issue, or are things working now that you updated your script locally?
My USD version is 0.24.3. Updating the OpenUSD build script to use draco 1.5.6 solved the draco issues, but not the objSanityTests issue. I used the build command cmake -S . -B build -DCMAKE_INSTALL_PREFIX=bin -DCMAKE_BUILD_TYPE=Release -DUSD_FILEFORMATS_FETCH_DRACO=ON -DUSD_FILEFORMATS_ENABLE_FBX=OFF -DUSD_FILEFORMATS_ENABLE_GLTF=OFF after rebuilding OpenUSD without the --draco tag. Unfortunately that doesn’t fix the issue either.
Thank you for providing the complete build log. First, I’d like to ensure that you are using the -Dpxr_ROOT flag to point to your local USD build directory in your cmake call. Although CMake typically requires this to configure correctly, it’s good to double-check.
Regarding the specific error with the test, it appears there’s an issue with locating the USD libraries. Please verify your environment settings; you should add the paths <USD_INSTALL_PATH>/bin, <USD_INSTALL_PATH>/lib, and <USD_INSTALL_PATH>/lib64 to your LD_LIBRARY_PATH, and <USD_INSTALL_PATH>/lib/python to your PYTHONPATH. For example: