You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2021/05/06 14:57:56 UTC

[GitHub] [tvm] rijulg opened a new issue #7989: Duplicate log definitions from runtime/logging.h

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:
users@infra.apache.org



[GitHub] [tvm] tkonolige edited a comment on issue #7989: Duplicate log definitions from runtime/logging.h

Posted by GitBox <gi...@apache.org>.
tkonolige edited a comment on issue #7989:
URL: https://github.com/apache/tvm/issues/7989#issuecomment-833928507


   1. Are your submodules up to date?
   2. What are you compiling?
   
   You're likely missing a `-DDMLC_USE_LOGGING_LIBRARY=<tvm/runtime/logging.h>` in your compiler flags.


-- 
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:
users@infra.apache.org



[GitHub] [tvm] tkonolige commented on issue #7989: Duplicate log definitions from runtime/logging.h

Posted by GitBox <gi...@apache.org>.
tkonolige commented on issue #7989:
URL: https://github.com/apache/tvm/issues/7989#issuecomment-833928507


   1. Are your submodules up to date?
   2. What are you compiling?


-- 
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:
users@infra.apache.org



[GitHub] [tvm] rijulg closed issue #7989: Duplicate log definitions from runtime/logging.h

Posted by GitBox <gi...@apache.org>.
rijulg closed issue #7989:
URL: https://github.com/apache/tvm/issues/7989


   


-- 
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:
users@infra.apache.org



[GitHub] [tvm] rijulg edited a comment on issue #7989: Duplicate log definitions from runtime/logging.h

Posted by GitBox <gi...@apache.org>.
rijulg edited a comment on issue #7989:
URL: https://github.com/apache/tvm/issues/7989#issuecomment-834012327


   Submodules look up to date
   ```
   root@e47558967e49:/opt/tvm# git status
   HEAD detached at 9bf213d40
   nothing to commit, working tree clean
   root@e47558967e49:/opt/tvm# git submodule status
    a07f962d446b577adf4baef2b347a0f3a2a20617 3rdparty/dlpack (v0.4)
    21cc7de0dc9fd6acb796e1be6181fa8e6b6c8f41 3rdparty/dmlc-core (v0.4-8-g21cc7de)
    08f7c7e69f8ea61a0c4151359bc8023be8e9217b 3rdparty/libbacktrace (heads/master)
    cabe04d6d6b05356fa8f9741704924788f0dd762 3rdparty/rang (v3.1.0-5-gcabe04d)
    43194178b4e570a5f1dd4f3f9d37ee16fc1b65be 3rdparty/vta-hw (remotes/origin/master-13-g4319417)
   ```
   I am compiling a copy of `apps/howto_deploy/tvm_runtime_pack.cc ` with `cmake .. -DDMLC_USE_LOGGING_LIBRARY=/usr/local/include/tvm/runtime/logging.h -DCMAKE_BUILD_TYPE=Debug -GNinja
   `
   CMake complains about unused variables now
   ```
   CMake Warning:
     Manually-specified variables were not used by the project:
   
       DMLC_USE_LOGGING_LIBRARY
   ```


-- 
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:
users@infra.apache.org



[GitHub] [tvm] rijulg commented on issue #7989: Duplicate log definitions from runtime/logging.h

Posted by GitBox <gi...@apache.org>.
rijulg commented on issue #7989:
URL: https://github.com/apache/tvm/issues/7989#issuecomment-834012327


   Submodules look up to date
   ```
   root@e47558967e49:/opt/tvm# git submodule status
    a07f962d446b577adf4baef2b347a0f3a2a20617 3rdparty/dlpack (v0.4)
    21cc7de0dc9fd6acb796e1be6181fa8e6b6c8f41 3rdparty/dmlc-core (v0.4-8-g21cc7de)
    08f7c7e69f8ea61a0c4151359bc8023be8e9217b 3rdparty/libbacktrace (heads/master)
    cabe04d6d6b05356fa8f9741704924788f0dd762 3rdparty/rang (v3.1.0-5-gcabe04d)
    43194178b4e570a5f1dd4f3f9d37ee16fc1b65be 3rdparty/vta-hw (remotes/origin/master-13-g4319417)
   root@e47558967e49:/opt/tvm#
   ```
   I am compiling a copy of `apps/howto_deploy/tvm_runtime_pack.cc ` with `cmake .. -DDMLC_USE_LOGGING_LIBRARY=/usr/local/include/tvm/runtime/logging.h -DCMAKE_BUILD_TYPE=Debug -GNinja
   `
   CMake complains about unused variables now
   ```
   CMake Warning:
     Manually-specified variables were not used by the project:
   
       DMLC_USE_LOGGING_LIBRARY
   ```


-- 
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:
users@infra.apache.org



[GitHub] [tvm] rijulg edited a comment on issue #7989: Duplicate log definitions from runtime/logging.h

Posted by GitBox <gi...@apache.org>.
rijulg edited a comment on issue #7989:
URL: https://github.com/apache/tvm/issues/7989#issuecomment-834012327


   Submodules look up to date
   ```
   root@e47558967e49:/opt/tvm# git status
   HEAD detached at 9bf213d40
   nothing to commit, working tree clean
   root@e47558967e49:/opt/tvm# git submodule status
    a07f962d446b577adf4baef2b347a0f3a2a20617 3rdparty/dlpack (v0.4)
    21cc7de0dc9fd6acb796e1be6181fa8e6b6c8f41 3rdparty/dmlc-core (v0.4-8-g21cc7de)
    08f7c7e69f8ea61a0c4151359bc8023be8e9217b 3rdparty/libbacktrace (heads/master)
    cabe04d6d6b05356fa8f9741704924788f0dd762 3rdparty/rang (v3.1.0-5-gcabe04d)
    43194178b4e570a5f1dd4f3f9d37ee16fc1b65be 3rdparty/vta-hw (remotes/origin/master-13-g4319417)
   ```
   I am compiling a copy of `apps/howto_deploy/tvm_runtime_pack.cc ` with `cmake .. -DDMLC_USE_LOGGING_LIBRARY=/usr/local/include/tvm/runtime/logging.h -DCMAKE_BUILD_TYPE=Debug -GNinja
   `
   CMake complains about unused variables now
   ```
   CMake Warning:
     Manually-specified variables were not used by the project:
   
       DMLC_USE_LOGGING_LIBRARY
   ```
   Edit:
   I forgot to add the compile definition in my CMakeLists file. All errors fixed after adding `target_compile_definitions`.


-- 
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:
users@infra.apache.org