openusd: propagate dependencies OpenGL#414827
Conversation
|
sorry for taking so long to get to this.
but wouldn't we instead want to otherwise, it looks like this approach brings us closer in line with arch, which seems fine to me, so i'll approve if you have a good reason |
Do you mean we can patch upstream materialx to use non-blocking find_dependency(OpenGL) in their MaterialConfig.cmake file, I have not taken this approch into account before. Now I am bit understood why openusd dev opened AcademySoftwareFoundation/MaterialX#2421. Also, I think the archlinux patch is more accurate to propagate dependency OpenGL, since disable PXR_ENABLE_GL_SUPPORT |
somewhere in materialx, yes. i haven't looked into the project to know if i'd add it to that specific file
that does seem smart! |
|
actually, looks like it should already find opengl? https://github.com/howetuft/MaterialX/blob/97505091af01390b888905237ff6aef432bff2dc/source/MaterialXRenderGlsl/CMakeLists.txt#L34 weird that we'd still need to add it then. |
|
IMO, However, by looking into the generated file MaterialXConfig.cmake in nixpkgs#materialx, i did not find any word matching "find_dependency(". |
|
Still, i am confused on which package should declare the dependency opengl. namely openusd or materialx. If materialx should, materialx should support optional components.
|
|
hmm, interesting at this point, i don't have a strong preference for how it should be done, so pick whichever seems best to you!
|
Part of VTK 9.2.6 → 9.4.2: #407910
Related upstream pull request: PixarAnimationStudios/OpenUSD#3648
Why OpenUSD should propagate OpenGL and X11:
OpenUSD exports the target
usd_ms, which links to the target MaterialXRenderGlsl, defined in MaterialX.As we can see in the MaterialX source,
MaterialXRenderGlsllinks to additional OpenGL and X11 targets.Since not all MaterialX targets defined in
MaterialXTargets.cmakerequire OpenGL/X11, it is not the responsibility of MaterialX to propagate these dependencies viafind_dependency(OpenGL/X11)in theirmaterialxConfig.cmakemodule.In contrast,
pxrTargets,cmake(OpenUSD) only defines one target (usd_ms) that links toMaterialXRenderGlsl. This is why OpenUSD should explicitly propagate the OpenGL and X11 dependencies.Why OpenUSD is blocking the upgrade of VTK from 9.2.6 to 9.4.2 in the package
f3d:VTK > 9.2 uses Glad to find the available OpenGL implementation via
dlopen, rather than linking toOpenGL::GL. As a result,vtkConfig.cmakeno longer propagates OpenGL viafind_dependency(OpenGL).However, we do need the OpenGL target when compiling
f3dwith OpenUSD support. Since OpenUSD does not correctly propagate OpenGL, we miss theOpenGL::GLtarget during the CMake configurePhase.I have tried to contact the OpenUSD upstream to fix this problem first, but they insist on blaming it on
nixpkgs/materialx.Therefore, let's fix the problem ourselves.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.