pxrConfig.cmake: request MaterialX RenderGlsl component#3648
Conversation
|
Filed as internal issue #USD-11039 ❗ Please make sure that a signed CLA has been submitted! (This is an automated message. See here for more information.) |
|
You can fix this problem(if it is) yourself. I contribute my code for free. |
|
Hi @qbisi , we don't believe these changes should be necessary, as those dependencies should get picked up transitively from the MaterialX CMake config shipping with MaterialX. Can you provide more context on
|
I am not sure if downstream MaterialX should declare dependency of opengl and x11 in their materiaxconfig.cmake module, as not all targets listed in materiaxtarget.cmake link to opengl/x11. Here is the contents of MateriaXTargets.cmake in nixpkgs |
|
OK, unless other folks see something, I suspect that, since the MaterialX package will build fine on its own, and using OpenUSD's build_usd.py to build USD with MaterialX also works fine (we've not had this error before), that this may be an issue with the nix configuration for OpenUSD. We are unfortunately not able to help or support nix or other external package management systems. |
|
Arch do patch pxrConfig.cmake |
|
@qbisi , we are hoping the workaround in archlinux would be sufficient, and we're very wary of adding an X11 dependency, which we also think should not be required. Can you tell us what happens for you if you just add the OpenGL dependency, and amend your PR? Also, we really do need a CLA if you want the PR and its commit to go into the repo. Otherwise, we can make the fix independently. |
|
If you do propogate dependency opengl, then i can build f3d with vtk-9.4.2( which no longer require opengl in version >9.3) and openusd support. This is a block for me to update vtk from 9.2.6 to 9.4.2 in nixpkgs. For the dependency x11, i catch this dep by analyzing the src code in materiax. Since most downstream project that make use of openusd/materialx will mostly require the x11 dependency themself. This interior propagated dependency of x11 may not be catched/reported by downstream project. Also, i am not sure if materiax should declare find_dependency(X11) itself. Finally, this pr is more than a issue to pull request, you can fix the problem youself, i am satisfied with either propagating dependency opengl or both of opengl and x11. |
|
The reason this happens is that every build in Nix is hermetic, which means that any dependencies needed for the build must to be declared, i.e. nothing can "leak" in. So in the case of MaterialX for example, that uses X11 and GL headers in their public header files, they need to propagate those dependencies up. When constructing this build without Nix, you would essentially make sure X11 and GL dev files (headers and libs) are installed. This will result in the MaterialX build working but it will also have the side effect of any downstream dependency working without declaring that dependency because X11 and GL headers+libs happen to be installed. The correct way to handle this is that any external dependencies that are exposed (used in public headers) need to be declared as "PUBLIC" dependencies (link type) in CMake and then declared (with That said, I do think this specific issue is fixed in MaterialX. |
|
This should be fixed in AcademySoftwareFoundation/MaterialX#2752. I am waiting for the new release of materialX 1.39.5 , downstream openusd can now declare the usage of component MaterialXRenderHw when finding materialX (this component require extra opengl inputs, note not all downstream project use MaterialXRenderHw hence i make it optional). |
Description of Change(s)
When MaterialX support is enabled, OpenUSD now first asks MaterialX for the
RenderGlslCMake package component:OpenUSD links MaterialX render targets such as
MaterialXRenderGlsl, and MaterialX 1.39.5 teaches its package config to propagate the dependencies needed by that component. This lets MaterialX own its OpenGL/X11 dependency propagation instead of OpenUSD spelling those dependencies out directly.For compatibility with MaterialX versions before 1.39.5, which do not support package components, the lookup falls back to the previous plain MaterialX package lookup. The fallback can be removed later if OpenUSD raises its minimum supported MaterialX version to 1.39.5 or newer.
The generated
pxrConfig.cmakeuses the same lookup pattern so downstream projects that consume OpenUSD also get the MaterialX component dependency handling when available.Related MaterialX fix: AcademySoftwareFoundation/MaterialX#2752
Link to proposal (if applicable)
Fixes Issue(s)
Checklist
I have created this PR based on the dev branch
I have followed the coding conventions
I have added unit tests that exercise this functionality (Reference:
testing guidelines)
I have verified that all unit tests pass with the proposed changes
I have submitted a signed Contributor License Agreement (Reference:
Contributor License Agreement instructions)