rijulg opened a new issue #7989:
URL: https://github.com/apache/tvm/issues/7989


   While compiling on main branch [commit 
9bf213d408305df01e1c207fc85cee32f54a5799] I receive the following redefinition 
warnings
   
   ```
   ...
   In file included from /opt/tvm/3rdparty/dmlc-core/include/dmlc/common.h:14:0,
                    from /opt/tvm/include/tvm/runtime/logging.h:32,
                    from /opt/tvm/include/tvm/runtime/container.h:33,
                    from /opt/tvm/include/tvm/runtime/ndarray.h:28,
                    from /opt/tvm/include/tvm/runtime/device_api.h:28,
                    from /opt/tvm/src/runtime/c_runtime_api.cc:27,
                    from ../runtime.cc:41:
   /opt/tvm/3rdparty/dmlc-core/include/dmlc/./logging.h:279:0: note: this is 
the location of the previous definition
    #define DLOG(severity) true ? (void)0 : dmlc::LogMessageVoidify() & 
LOG(severity)
    
   In file included from /opt/tvm/include/tvm/runtime/container.h:33:0,
                    from /opt/tvm/include/tvm/runtime/ndarray.h:28,
                    from /opt/tvm/include/tvm/runtime/device_api.h:28,
                    from /opt/tvm/src/runtime/c_runtime_api.cc:27,
                    from ../runtime.cc:41:
   /opt/tvm/include/tvm/runtime/logging.h:477:0: warning: "DLOG_IF" redefined
    #define DLOG_IF(severity, condition) \
    
   In file included from /opt/tvm/3rdparty/dmlc-core/include/dmlc/common.h:14:0,
                    from /opt/tvm/include/tvm/runtime/logging.h:32,
                    from /opt/tvm/include/tvm/runtime/container.h:33,
                    from /opt/tvm/include/tvm/runtime/ndarray.h:28,
                    from /opt/tvm/include/tvm/runtime/device_api.h:28,
                    from /opt/tvm/src/runtime/c_runtime_api.cc:27,
                    from ../runtime.cc:41:
   /opt/tvm/3rdparty/dmlc-core/include/dmlc/./logging.h:280:0: note: this is 
the location of the previous definition
    #define DLOG_IF(severity, condition) \
   ...
   ```
   
   I looked a bit into the issue and it appears like there is no easy fix since 
the values are duplicated between 3rd party library in `dmlc/logging.h` and 
`runtime/logging.h`. Neither of the libraries have namespaced definitions as 
well which could be a simple fix by updating the namespace in tvm's logging 
library.
   
   I suspect include guards are needed for these definitions, but can't 
ascertain whether they should be setup in this repo or the 3rd party, or both.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to