Hi,guys, i am use libtorch and glog in the same codes in c++,but there are indices some files conflict between each other. The libtorch’s logging_is_not_google_glog.h(#define LOG(n)) is conflict with glog’s logging.h(#define LOG(severity) COMPACT_GOOGLE_LOG_ ## severity.stream()).The details problem is:
In file included from libtorch/include/c10/util/Logging.h:28:0,
from /libtorch/include/c10/core/TensorImpl.h:17,
from /libtorch/include/ATen/core/TensorBody.h:11,
from /libtorch/include/ATen/Tensor.h:11,
from //libtorch/include/ATen/Context.h:4,
from /libtorch/include/ATen/ATen.h:5,
from /libtorch/include/torch/csrc/api/include/torch/types.h:3,
from /libtorch/include/torch/script.h:3,
/libtorch/include/c10/util/logging_is_not_google_glog.h:96:0: warning: “LOG” redefined
#define LOG(n)
^
In file included from /glog/linux/include/glog/logging.h:483:0: note: this is the location of the previous definition
#define LOG(severity) COMPACT_GOOGLE_LOG_ ## severity.stream()
^
In file included from /libtorch/include/c10/util/Logging.h:28:0,
from /libtorch/include/c10/core/TensorImpl.h:17,
from /libtorch/include/ATen/core/TensorBody.h:11,
from /libtorch/include/ATen/Tensor.h:11,
from /libtorch/include/ATen/Context.h:4,
from /libtorch/include/ATen/ATen.h:5,
from /libtorch/include/torch/csrc/api/include/torch/types.h:3,
from /libtorch/include/torch/script.h:3,
/libtorch/include/c10/util/logging_is_not_google_glog.h:99:0: warning: “VLOG” redefined
#define VLOG(n) LOG((-n))
^
In file included from /glog/linux/include/glog/logging.h:1068:0: note: this is the location of the previous definition
#define VLOG(verboselevel) LOG_IF(INFO, VLOG_IS_ON(verboselevel))
Does anyone can tell me how to deal with it?My environment is ubuntu16.04 pytorch1.3 libtorch libtorch-cxx11-abi-shared-with-deps-1.3.1.zip,qt5.5. tkx.