-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[usd] 23.05 Runtime plugins of OpenUSD installed incorrectly #37947
Comments
@LittleCoinCoin, Thanks for your issue, I will reproduce your issue locally and fix it. |
This takes two things:
|
Hello @dg0yt, If I understand correctly, you are suggesting that it's up to me to indicate in CMake which plugins I want to grab from where they are installed by default by vcpkg, and bring them somewhere my .exe can find them? If so, I've thought about it, but ignoring the fact that I don't know how to write that in CMake, I got confused by the work done in the portfile.cmake of the vcpkg/ports/usd/portfile.cmake Lines 87 to 92 in c5da4ba
The port file already does some work to fix the plugin's json, so I started thinking that the default intended behaviour of the portfile was to add every found plugins in the loop. I suppose I am wrong? 🤔 |
So the first bullet point is probably solved. add_custom_command(TARGET ${your_executable}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:${your_executable}>/<plugin-subdir>"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "<plugin-from-vcpkg-install>" "$<TARGET_FILE_DIR:${your_executable}>/<plugin-subdir>"
) (untested) |
Hello, I got it to work. Before I explain, I set up a public template repo for anyone who wants to jumpstart from the project that worked for me: https://github.com/LittleCoinCoin/OpenUSD-setup-vcpkg-template Thank you @dg0yt for pointing me in the right direction. I'm still very skeptical about the fact that
# ./CMakeList.txt
cmake_minimum_required (VERSION 3.20)
project ("USDTest")
# Because the USD plugin file directory resolution expects the dlls to be in a "/bin" folder
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin" CACHE STRING "" )
add_subdirectory ("USDTest") So that all dynamic libraries built by CMake are copied in a
Case i. is the easy solution where you bring everything over. I'll close this issue. Thank you for your support |
Describe the bug
The .exe using OpenUSD delivered by vcpkg systematically crashes at runtime with message `Failed to find plugin for ArDefaultResolver``
Configuration and build of the port itself terminates without errors but it seems the install of OpenUSD (port name
usd
in vcpkg) by vcpkg seem to cause problems to find runtime plugins of OpenUSD.The same issue was mentioned at the end of the PR for port update to version 23.02 of OpenUSD: #29688 (comment)
This issue seem to be related to the tree of directories, and the solution when doing a manual install of OpenUSD (i.e., without vcpkg) is discussed in this issue: PixarAnimationStudios/OpenUSD#1788
Environment
To Reproduce
USDTest
path/to/project/USDTest/
.path/to/project/USDTest/vcpkg.json
:path/to/project/USDTest/CMakeLists.txt
;path/to/project/USDTest/USDTest/CMakeLists.txt
:path/to/project/USDTest/USDTest/headers/main.h
:path/to/project/USDTest/USDTest/src/main.cpp
:Expected behavior
I expect the the exe to find the plugins at runtime and the .exe to exit without error messages.
Failure logs
When running the .exe:
Coding Error: in _GetPluginForType at line 147 of C:path\to\project\vcpkg\buildtrees\usd\src\v23.05-16c1648942.clean\pxr\usd\ar\resolver.cpp -- Failed to find plugin for ArDefaultResolver
Additional context
No other context at this time.
The text was updated successfully, but these errors were encountered: