openvinotoolkit / openvino

OpenVINO™ is an open-source toolkit for optimizing and deploying AI inference
https://docs.openvino.ai
Apache License 2.0
6.72k stars 2.16k forks source link

[Build]: openvino breaks DEBUG macro #20463

Closed vient closed 1 month ago

vient commented 10 months ago

OpenVINO Version

2023.1

Operating System

Ubuntu 20.04 (LTS)

Hardware Architecture

x86 (64 bits)

Target Platform

No response

Build issue description

This review fixed issue in openvino code when DEBUG is a defined macro. It tries to return DEBUG value back but it does not work. This breaks the code that includes openvino headers and then expects that DEBUG macro is defined.

Build scrip or step-by-step to reproduce

It does not work even in simplest scenario when DEBUG is just a number: https://godbolt.org/z/be1er5rsb

Relevant log output

I use DEBUG as a debug logging function, in that case output looks like this

/home/vient/proj/test.h:48:5: error: use of undeclared identifier '_OV_WAS_DEBUG'
  246 |     DEBUG() << "setting val3 to " << val3;
      |     ^
/usr/include/openvino/runtime/properties.hpp:588:19: note: expanded from macro 'DEBUG'
  588 | #    define DEBUG _OV_WAS_DEBUG

Issue submission checklist

vient commented 10 months ago

Maybe you can use push_macro/pop_macro instead? https://gcc.gnu.org/onlinedocs/gcc/Push_002fPop-Macro-Pragmas.html If they are available, otherwise fail if DEBUG is defined or something else.

vient commented 10 months ago

cc @ilyachur

github-actions[bot] commented 1 month ago

This issue will be closed in a week because of 9 months of no activity.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stalled for 9 months with no activity.