PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
6.04k stars 1.2k forks source link

USD 21.11 build failing with MaterialX 1.38.3 #1753

Closed efleurant closed 2 years ago

efleurant commented 2 years ago

Description of Issue

USD 21.11 branch/tag failing to build against MaterialX 1.38.3 with the following error:

...
In file included from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Library.h:47,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Export.h:9,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:12,
                 from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Generated.h:19:40: error: ‘namespace MaterialX = MaterialX_v1_38_3;’ conflicts with a previous declaration
   19 | namespace MaterialX = MaterialX_v1_38_3;
      |                                        ^
In file included from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:24:
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.h:33:11: note: previous declaration ‘namespace MaterialX { }’
   33 | namespace MaterialX {
      |           ^~~~~~~~~
[ 76%] Linking CXX executable testHdSceneIndex
[ 76%] Linking CXX shared library hdTiny.so
[ 76%] Built target testHdSceneIndex
[ 76%] Built target hdTiny
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp: In function ‘pxrInternal_v0_21__pxrReserved__::TfToken pxrInternal_v0_21__pxrReserved__::_GetMxNodeType(const DocumentPtr&, const pxrInternal_v0_21__pxrReserved__::TfToken&)’:
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:49:9: error: ‘NodeDefPtr’ is not a member of ‘mx’; did you mean ‘MaterialX_v1_38_3::NodeDefPtr’?
   49 |     mx::NodeDefPtr mxNodeDef = mxDoc->getNodeDef(hdNodeType.GetString());
      |         ^~~~~~~~~~
In file included from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Node.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Material.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Look.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:14,
                 from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Definition.h:32:7: note: ‘MaterialX_v1_38_3::NodeDefPtr’ declared here
   32 | using NodeDefPtr = shared_ptr<NodeDef>;
      |       ^~~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:50:10: error: ‘mxNodeDef’ was not declared in this scope
   50 |     if (!mxNodeDef){
      |          ^~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:55:20: error: ‘mxNodeDef’ was not declared in this scope
   55 |     return TfToken(mxNodeDef->getNodeString());
      |                    ^~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp: In function ‘bool pxrInternal_v0_21__pxrReserved__::_IsInputVector3(const string&)’:
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:65:22: error: ‘StringSet’ in namespace ‘mx’ does not name a type; did you mean ‘StringMap’?
   65 |     static const mx::StringSet Vector3Inputs = {"normal",
      |                      ^~~~~~~~~
      |                      StringMap
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:68:12: error: ‘Vector3Inputs’ was not declared in this scope
   68 |     return Vector3Inputs.count(mxInputName) > 0;
      |            ^~~~~~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp: At global scope:
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:97:12: error: ‘NodePtr’ in namespace ‘mx’ does not name a type
   97 | static mx::NodePtr
      |            ^~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp: In function ‘std::string pxrInternal_v0_21__pxrReserved__::HdMtlxConvertToString(const pxrInternal_v0_21__pxrReserved__::VtValue&)’:
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:176:20: error: ‘EMPTY_STRING’ is not a member of ‘mx’; did you mean ‘MaterialX_v1_38_3::EMPTY_STRING’?
  176 |         return mx::EMPTY_STRING;
      |                    ^~~~~~~~~~~~
In file included from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Element.h:15,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Geom.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Interface.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Definition.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Node.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Material.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Look.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:14,
                 from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Util.h:16:33: note: ‘MaterialX_v1_38_3::EMPTY_STRING’ declared here
   16 | extern MX_CORE_API const string EMPTY_STRING;
      |                                 ^~~~~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp: At global scope:
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:184:9: error: ‘mx::NodeDefPtr’ has not been declared
  184 |     mx::NodeDefPtr const& mxNodeDef,
      |         ^~~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp: In function ‘void pxrInternal_v0_21__pxrReserved__::_GetMxInputInfo(const std::pair<pxrInternal_v0_21__pxrReserved__::TfToken, pxrInternal_v0_21__pxrReserved__::VtValue>&, const int&, std::string*, std::string*, std::string*)’:
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:196:9: error: ‘InputPtr’ is not a member of ‘mx’; did you mean ‘MaterialX_v1_38_3::InputPtr’?
  196 |     mx::InputPtr mxInput = mxNodeDef->getInput(*mxInputName);
      |         ^~~~~~~~
In file included from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Definition.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Node.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Material.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Look.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:14,
                 from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Interface.h:31:7: note: ‘MaterialX_v1_38_3::InputPtr’ declared here
   31 | using InputPtr = shared_ptr<Input>;
      |       ^~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:197:9: error: ‘mxInput’ was not declared in this scope; did you mean ‘mxInputName’?
  197 |     if (mxInput) {
      |         ^~~~~~~
      |         mxInputName
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp: At global scope:
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:203:12: error: ‘NodePtr’ in namespace ‘mx’ does not name a type
  203 | static mx::NodePtr
      |            ^~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:271:9: error: ‘mx::NodeGraphPtr’ has not been declared
  271 |     mx::NodeGraphPtr * mxNodeGraph,
      |         ^~~~~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:272:9: error: ‘mx::StringSet’ has not been declared
  272 |     mx::StringSet * addedNodeNames,
      |         ^~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:273:9: error: ‘mx::NodePtr’ has not been declared
  273 |     mx::NodePtr * mxUpstreamNode,
      |         ^~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp: In function ‘void pxrInternal_v0_21__pxrReserved__::_GatherUpstreamNodes(const pxrInternal_v0_21__pxrReserved__::HdMaterialNetwork2&, const pxrInternal_v0_21__pxrReserved__::HdMaterialConnection2&, const DocumentPtr&, int*, int*, int*, std::set<pxrInternal_v0_21__pxrReserved__::SdfPath>*, const string&, MaterialX::StringMap*, std::set<pxrInternal_v0_21__pxrReserved__::SdfPath>*)’:
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:294:29: error: invalid use of incomplete type ‘using element_type = class MaterialX::Document’ {aka ‘class MaterialX::Document’}
  294 |         *mxNodeGraph = mxDoc->addNodeGraph(nodeGraphName);
      |                             ^~
In file included from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:24:
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.h:34:47: note: forward declaration of ‘using element_type = class MaterialX::Document’ {aka ‘class MaterialX::Document’}
   34 |     using DocumentPtr = std::shared_ptr<class Document>;
      |                                               ^~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:298:9: error: ‘NodePtr’ is not a member of ‘mx’; did you mean ‘MaterialX_v1_38_3::NodePtr’?
  298 |     mx::NodePtr mxCurrNode = _AddMaterialXNode(hdNetwork, hdNode, hdNodePath,
      |         ^~~~~~~
In file included from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Material.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Look.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:14,
                 from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Node.h:24:7: note: ‘MaterialX_v1_38_3::NodePtr’ declared here
   24 | using NodePtr = shared_ptr<Node>;
      |       ^~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:303:10: error: ‘mxCurrNode’ was not declared in this scope
  303 |     if (!mxCurrNode) {
      |          ^~~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:320:17: error: ‘NodePtr’ is not a member of ‘mx’; did you mean ‘MaterialX_v1_38_3::NodePtr’?
  320 |             mx::NodePtr mxNextNode = *mxUpstreamNode;
      |                 ^~~~~~~
In file included from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Material.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Look.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:14,
                 from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Node.h:24:7: note: ‘MaterialX_v1_38_3::NodePtr’ declared here
   24 | using NodePtr = shared_ptr<Node>;
      |       ^~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:323:17: error: ‘InputPtr’ is not a member of ‘mx’; did you mean ‘MaterialX_v1_38_3::InputPtr’?
  323 |             mx::InputPtr mxInput = mxCurrNode->getInput(connName);
      |                 ^~~~~~~~
In file included from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Definition.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Node.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Material.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Look.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:14,
                 from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Interface.h:31:7: note: ‘MaterialX_v1_38_3::InputPtr’ declared here
   31 | using InputPtr = shared_ptr<Input>;
      |       ^~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:324:18: error: ‘mxInput’ was not declared in this scope
  324 |             if (!mxInput){
      |                  ^~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:325:27: error: ‘mxCurrNode’ was not declared in this scope
  325 |                 mxInput = mxCurrNode->addInput(connName, mxNextNode->getType());
      |                           ^~~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:325:58: error: ‘mxNextNode’ was not declared in this scope
  325 |                 mxInput = mxCurrNode->addInput(connName, mxNextNode->getType());
      |                                                          ^~~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:327:13: error: ‘mxInput’ was not declared in this scope
  327 |             mxInput->setConnectedNode(mxNextNode);
      |             ^~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:327:39: error: ‘mxNextNode’ was not declared in this scope
  327 |             mxInput->setConnectedNode(mxNextNode);
      |                                       ^~~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:331:23: error: ‘mxCurrNode’ was not declared in this scope
  331 |     *mxUpstreamNode = mxCurrNode;
      |                       ^~~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp: In function ‘MaterialX::DocumentPtr pxrInternal_v0_21__pxrReserved__::HdMtlxCreateMtlxDocumentFromHdNetwork(const pxrInternal_v0_21__pxrReserved__::HdMaterialNetwork2&, const pxrInternal_v0_21__pxrReserved__::HdMaterialNode2&, const pxrInternal_v0_21__pxrReserved__::SdfPath&, const DocumentPtr&, std::set<pxrInternal_v0_21__pxrReserved__::SdfPath>*, MaterialX::StringMap*, std::set<pxrInternal_v0_21__pxrReserved__::SdfPath>*)’:
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:347:33: error: ‘createDocument’ is not a member of ‘mx’; did you mean ‘MaterialX_v1_38_3::createDocument’?
  347 |     mx::DocumentPtr mxDoc = mx::createDocument();
      |                                 ^~~~~~~~~~~~~~
In file included from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:684:25: note: ‘MaterialX_v1_38_3::createDocument’ declared here
  684 | MX_CORE_API DocumentPtr createDocument();
      |                         ^~~~~~~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:348:10: error: invalid use of incomplete type ‘using element_type = class MaterialX::Document’ {aka ‘class MaterialX::Document’}
  348 |     mxDoc->importLibrary(libraries);
      |          ^~
In file included from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:24:
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.h:34:47: note: forward declaration of ‘using element_type = class MaterialX::Document’ {aka ‘class MaterialX::Document’}
   34 |     using DocumentPtr = std::shared_ptr<class Document>;
      |                                               ^~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:353:9: error: ‘NodePtr’ is not a member of ‘mx’; did you mean ‘MaterialX_v1_38_3::NodePtr’?
  353 |     mx::NodePtr mxShaderNode = mxDoc->addNode(mxType.GetString(),
      |         ^~~~~~~
In file included from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Material.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Look.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:14,
                 from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Node.h:24:7: note: ‘MaterialX_v1_38_3::NodePtr’ declared here
   24 | using NodePtr = shared_ptr<Node>;
      |       ^~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:356:9: error: ‘NodePtr’ is not a member of ‘mx’; did you mean ‘MaterialX_v1_38_3::NodePtr’?
  356 |     mx::NodePtr mxMaterial = mxDoc->addMaterialNode(materialName, mxShaderNode);
      |         ^~~~~~~
In file included from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Material.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Look.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:14,
                 from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Node.h:24:7: note: ‘MaterialX_v1_38_3::NodePtr’ declared here
   24 | using NodePtr = shared_ptr<Node>;
      |       ^~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:359:9: error: ‘NodeGraphPtr’ is not a member of ‘mx’; did you mean ‘MaterialX_v1_38_3::NodeGraphPtr’?
  359 |     mx::NodeGraphPtr mxNodeGraph;
      |         ^~~~~~~~~~~~
In file included from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Material.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Look.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:14,
                 from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Node.h:34:7: note: ‘MaterialX_v1_38_3::NodeGraphPtr’ declared here
   34 | using NodeGraphPtr = shared_ptr<NodeGraph>;
      |       ^~~~~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:360:9: error: ‘StringSet’ is not a member of ‘mx’; did you mean ‘StringMap’?
  360 |     mx::StringSet addedNodeNames;   // Set of NodeNames in the mxNodeGraph
      |         ^~~~~~~~~
      |         StringMap
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:367:17: error: ‘NodePtr’ is not a member of ‘mx’; did you mean ‘MaterialX_v1_38_3::NodePtr’?
  367 |             mx::NodePtr mxUpstreamNode;
      |                 ^~~~~~~
In file included from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Material.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Look.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:14,
                 from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Node.h:24:7: note: ‘MaterialX_v1_38_3::NodePtr’ declared here
   24 | using NodePtr = shared_ptr<Node>;
      |       ^~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:368:69: error: ‘mxNodeGraph’ was not declared in this scope; did you mean ‘mxNodeGraphOutput’?
  368 |             _GatherUpstreamNodes(hdNetwork, currConnection, mxDoc, &mxNodeGraph,
      |                                                                     ^~~~~~~~~~~
      |                                                                     mxNodeGraphOutput
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:369:26: error: ‘addedNodeNames’ was not declared in this scope
  369 |                         &addedNodeNames, &mxUpstreamNode, hdTextureNodes,
      |                          ^~~~~~~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:369:43: error: ‘mxUpstreamNode’ was not declared in this scope
  369 |                         &addedNodeNames, &mxUpstreamNode, hdTextureNodes,
      |                                           ^~~~~~~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:379:17: error: ‘OutputPtr’ is not a member of ‘mx’; did you mean ‘MaterialX_v1_38_3::OutputPtr’?
  379 |             mx::OutputPtr mxOutput = mxNodeGraph->addOutput(fullOutputName,
      |                 ^~~~~~~~~
In file included from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Definition.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Node.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Material.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Look.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:14,
                 from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Interface.h:36:7: note: ‘MaterialX_v1_38_3::OutputPtr’ declared here
   36 | using OutputPtr = shared_ptr<Output>;
      |       ^~~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:381:13: error: ‘mxOutput’ was not declared in this scope
  381 |             mxOutput->setConnectedNode(mxUpstreamNode);
      |             ^~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:384:17: error: ‘InputPtr’ is not a member of ‘mx’; did you mean ‘MaterialX_v1_38_3::InputPtr’?
  384 |             mx::InputPtr mxInput = mxShaderNode->addInput(mxNodeGraphOutput,
      |                 ^~~~~~~~
In file included from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Definition.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Node.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Material.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Look.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:14,
                 from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Interface.h:31:7: note: ‘MaterialX_v1_38_3::InputPtr’ declared here
   31 | using InputPtr = shared_ptr<Input>;
      |       ^~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:386:13: error: ‘mxInput’ was not declared in this scope
  386 |             mxInput->setConnectedOutput(mxOutput);
      |             ^~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:394:13: error: ‘InputPtr’ is not a member of ‘mx’; did you mean ‘MaterialX_v1_38_3::InputPtr’?
  394 |         mx::InputPtr mxInput = mxShaderNode->addInput(mxInputName);
      |             ^~~~~~~~
In file included from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Definition.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Node.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Material.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Look.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:14,
                 from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Interface.h:31:7: note: ‘MaterialX_v1_38_3::InputPtr’ declared here
   31 | using InputPtr = shared_ptr<Input>;
      |       ^~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:400:13: error: ‘mxInput’ was not declared in this scope; did you mean ‘mxInputName’?
  400 |             mxInput->setValue(value);
      |             ^~~~~~~
      |             mxInputName
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:404:13: error: ‘mxInput’ was not declared in this scope; did you mean ‘mxInputName’?
  404 |             mxInput->setValue(value);
      |             ^~~~~~~
      |             mxInputName
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:408:13: error: ‘mxInput’ was not declared in this scope; did you mean ‘mxInputName’?
  408 |             mxInput->setValue(value);
      |             ^~~~~~~
      |             mxInputName
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:415:17: error: ‘mxInput’ was not declared in this scope; did you mean ‘mxInputName’?
  415 |                 mxInput->setValue(mx::Vector3(value.data()[0],
      |                 ^~~~~~~
      |                 mxInputName
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:415:39: error: ‘Vector3’ is not a member of ‘mx’; did you mean ‘MaterialX_v1_38_3::Vector3’?
  415 |                 mxInput->setValue(mx::Vector3(value.data()[0],
      |                                       ^~~~~~~
In file included from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Value.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Element.h:16,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Geom.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Interface.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Definition.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Node.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Material.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Look.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:14,
                 from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Types.h:302:19: note: ‘MaterialX_v1_38_3::Vector3’ declared here
  302 | class MX_CORE_API Vector3 : public VectorN<Vector3, float, 3>
      |                   ^~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:420:17: error: ‘mxInput’ was not declared in this scope; did you mean ‘mxInputName’?
  420 |                 mxInput->setValue(mx::Color3(value.data()[0],
      |                 ^~~~~~~
      |                 mxInputName
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:420:39: error: ‘Color3’ is not a member of ‘mx’; did you mean ‘MaterialX_v1_38_3::Color3’?
  420 |                 mxInput->setValue(mx::Color3(value.data()[0],
      |                                       ^~~~~~
In file included from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Value.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Element.h:16,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Geom.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Interface.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Definition.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Node.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Material.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Look.h:14,
                 from /mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Document.h:14,
                 from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:35:
/mydevpath/dev/opt/install/MaterialX/1.38.3/include/MaterialXCore/Types.h:377:19: note: ‘MaterialX_v1_38_3::Color3’ declared here
  377 | class MX_CORE_API Color3 : public VectorN<Color3, float, 3>
      |                   ^~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:426:13: error: ‘mxShaderNode’ was not declared in this scope; did you mean ‘SdrShaderNode’?
  426 |             mxShaderNode->removeInput(mxInputName);
      |             ^~~~~~~~~~~~
      |             SdrShaderNode
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:435:15: error: invalid use of incomplete type ‘using element_type = class MaterialX::Document’ {aka ‘class MaterialX::Document’}
  435 |     if (!mxDoc->validate(&message)) {
      |               ^~
In file included from /mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:24:
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.h:34:47: note: forward declaration of ‘using element_type = class MaterialX::Document’ {aka ‘class MaterialX::Document’}
   34 |     using DocumentPtr = std::shared_ptr<class Document>;
      |                                               ^~~~~~~~
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:351:25: warning: unused variable ‘materialName’ [-Wunused-variable]
  351 |     const std::string & materialName = materialPath.GetName();
      |                         ^~~~~~~~~~~~
[ 76%] Linking CXX executable testHdDirtyList
[ 76%] Built target testHdDirtyList
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp: At global scope:
/mydevpath/dev/opt/source/USD/pxr/imaging/hdMtlx/hdMtlx.cpp:182:1: warning: ‘void pxrInternal_v0_21__pxrReserved__::_GetMxInputInfo(const std::pair<pxrInternal_v0_21__pxrReserved__::TfToken, pxrInternal_v0_21__pxrReserved__::VtValue>&, const int&, std::string*, std::string*, std::string*)’ defined but not used [-Wunused-function]
  182 | _GetMxInputInfo(
      | ^~~~~~~~~~~~~~~
make[2]: *** [pxr/imaging/hdMtlx/CMakeFiles/hdMtlx.dir/build.make:92: pxr/imaging/hdMtlx/CMakeFiles/hdMtlx.dir/hdMtlx.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:11403: pxr/imaging/hdMtlx/CMakeFiles/hdMtlx.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 76%] Linking CXX executable testHdExtComputationUtils
[ 76%] Built target testHdExtComputationUtils
[ 76%] Linking CXX shared library libusd_usd.so
[ 77%] Built target usd
make: *** [Makefile:160: all] Error 2

Please let me know if I can provide any other useful infos!

System Information (OS, Hardware)

OS: CentOS 7.7.1908 Kernel: 5.4.135-1.el7.elrepo.x86_64 CPU: AMD Ryzen Threadripper 2950X 16-Core Processor

Package Versions

Build Flags

cmake -D PXR_USE_PYTHON_3=ON -D PYTHON_LIBRARY=$HOME/.pyenv/versions/3.7.9/lib/libpython3.7m.so -D PYSIDEUICBINARY=$HOME/.pyenv/versions/3.7.9/lib/python3.7/site-packages/PySide2/uic -D PXR_BUILD_MONOLITHIC=OFF -D PXR_BUILD_OPENIMAGEIO_PLUGIN=ON -D PXR_BUILD_OPENCOLORIO_PLUGIN=OFF -D PXR_BUILD_IMAGING=ON -D PXR_BUILD_ALEMBIC_PLUGIN=ON -D PXR_BUILD_EMBREE_PLUGIN=ON -D PXR_BUILD_USDVIEW=ON -D PXR_BUILD_USD_IMAGING=ON -D PXR_BUILD_USD_TOOLS=ON -D PXR_ENABLE_GL_SUPPORT=ON -D PXR_ENABLE_MATERIALX_SUPPORT=ON -D PXR_ENABLE_OPENVDB_SUPPORT=ON -D PXR_ENABLE_OSL_SUPPORT=OFF -D PXR_ENABLE_PTEX_SUPPORT=ON -D PXR_ENABLE_VULKAN_SUPPORT=OFF -D PXR_ENABLE_HDF5_SUPPORT=ON

sunyab commented 2 years ago

Hi @efleurant, USD currently does not support 1.38.3. There is an outstanding PR to add this support at #1738 but we haven't had a chance to look at pulling it in yet.

jilliene commented 2 years ago

Filed as internal issue #USD-7163

sunyab commented 2 years ago

Support for MaterialX 1.38.3 was merged in PR #1792 and will be part of the upcoming 22.08 release. Closing this out, thanks!