From 071485b81d441cc9881a8c0e36cd7220231db24c Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Thu, 24 Sep 2020 12:13:27 +0300 Subject: [PATCH] Fixed docs build on Windows (#2398) --- docs/CMakeLists.txt | 179 +++++++++++++++-------------- docs/IE_PLUGIN_DG/QuantizedNetworks.md | 4 - docs/doxygen/ie_c_api.config | 6 +- docs/doxygen/ie_docs.config | 10 +- docs/doxygen/ie_plugin_api.config | 21 ++-- docs/doxygen/ie_py_api.config | 6 +- inference-engine/thirdparty/CMakeLists.txt | 4 + 7 files changed, 116 insertions(+), 114 deletions(-) diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index bc0b987..6f7d778 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -31,7 +31,6 @@ if(NOT ENABLE_DOCKER) endif() function(build_docs) - find_package(Doxygen REQUIRED dot) find_package(Python3 COMPONENTS Interpreter) find_package(LATEX) @@ -48,52 +47,50 @@ function(build_docs) message(FATAL_ERROR "LATEX is required to build the documentation") endif() - set(DOCS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) - set(DOXYGEN_DIR ${OpenVINO_MAIN_SOURCE_DIR}/docs/doxygen) - set(IE_SOURCE_DIR ${OpenVINO_MAIN_SOURCE_DIR}/inference-engine) - set(PYTHON_API_IN ${IE_SOURCE_DIR}/ie_bridges/python/src/openvino/inference_engine/ie_api.pyx) - set(PYTHON_API_OUT ${DOCS_BINARY_DIR}/python_api/ie_api.pyx) - set(C_API ${IE_SOURCE_DIR}/ie_bridges/c/include) - set(PLUGIN_API_DIR ${DOCS_BINARY_DIR}/IE_PLUGIN_DG) + set(DOCS_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}") + set(DOXYGEN_DIR "${OpenVINO_MAIN_SOURCE_DIR}/docs/doxygen") + set(IE_SOURCE_DIR "${OpenVINO_MAIN_SOURCE_DIR}/inference-engine") + set(PYTHON_API_IN "${IE_SOURCE_DIR}/ie_bridges/python/src/openvino/inference_engine/ie_api.pyx") + set(PYTHON_API_OUT "${DOCS_BINARY_DIR}/python_api/ie_api.pyx") + set(C_API "${IE_SOURCE_DIR}/ie_bridges/c/include") + set(PLUGIN_API_DIR "${DOCS_BINARY_DIR}/IE_PLUGIN_DG") # Preprocessing scripts - set(DOXY_MD_FILTER ${DOXYGEN_DIR}/doxy_md_filter.py) - set(PYX_FILTER ${DOXYGEN_DIR}/pyx_filter.py) + set(DOXY_MD_FILTER "${DOXYGEN_DIR}/doxy_md_filter.py") + set(PYX_FILTER "${DOXYGEN_DIR}/pyx_filter.py") file(GLOB_RECURSE doc_source_files - LIST_DIRECTORIES true - RELATIVE ${OpenVINO_MAIN_SOURCE_DIR} - ${OpenVINO_MAIN_SOURCE_DIR}/docs/*.md - ${OpenVINO_MAIN_SOURCE_DIR}/docs/*.png - ${OpenVINO_MAIN_SOURCE_DIR}/docs/*.gif - ${OpenVINO_MAIN_SOURCE_DIR}/docs/*.jpg - ${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.md - ${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.png - ${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.gif - ${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.jpg - ) + LIST_DIRECTORIES true RELATIVE ${OpenVINO_MAIN_SOURCE_DIR} + "${OpenVINO_MAIN_SOURCE_DIR}/docs/*.md" + "${OpenVINO_MAIN_SOURCE_DIR}/docs/*.png" + "${OpenVINO_MAIN_SOURCE_DIR}/docs/*.gif" + "${OpenVINO_MAIN_SOURCE_DIR}/docs/*.jpg" + "${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.md" + "${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.png" + "${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.gif" + "${OpenVINO_MAIN_SOURCE_DIR}/inference-engine/*.jpg") configure_file(${PYTHON_API_IN} ${PYTHON_API_OUT} @ONLY) - set(IE_CONFIG_SOURCE ${DOXYGEN_DIR}/ie_docs.config) - set(C_CONFIG_SOURCE ${DOXYGEN_DIR}/ie_c_api.config) - set(PY_CONFIG_SOURCE ${DOXYGEN_DIR}/ie_py_api.config) - set(PLUGIN_CONFIG_SOURCE ${DOXYGEN_DIR}/ie_plugin_api.config) + set(IE_CONFIG_SOURCE "${DOXYGEN_DIR}/ie_docs.config") + set(C_CONFIG_SOURCE "${DOXYGEN_DIR}/ie_c_api.config") + set(PY_CONFIG_SOURCE "${DOXYGEN_DIR}/ie_py_api.config") + set(PLUGIN_CONFIG_SOURCE "${DOXYGEN_DIR}/ie_plugin_api.config") - set(IE_CONFIG_BINARY ${DOCS_BINARY_DIR}/ie_docs.config) - set(C_CONFIG_BINARY ${DOCS_BINARY_DIR}/ie_c_api.config) - set(PY_CONFIG_BINARY ${DOCS_BINARY_DIR}/ie_py_api.config) - set(PLUGIN_CONFIG_BINARY ${DOCS_BINARY_DIR}/ie_plugin_api.config) + set(IE_CONFIG_BINARY "${DOCS_BINARY_DIR}/ie_docs.config") + set(C_CONFIG_BINARY "${DOCS_BINARY_DIR}/ie_c_api.config") + set(PY_CONFIG_BINARY "${DOCS_BINARY_DIR}/ie_py_api.config") + set(PLUGIN_CONFIG_BINARY "${DOCS_BINARY_DIR}/ie_plugin_api.config") - set(IE_LAYOUT_SOURCE ${DOXYGEN_DIR}/ie_docs.xml) - set(C_LAYOUT_SOURCE ${DOXYGEN_DIR}/ie_c_api.xml) - set(PY_LAYOUT_SOURCE ${DOXYGEN_DIR}/ie_py_api.xml) - set(PLUGIN_LAYOUT_SOURCE ${DOXYGEN_DIR}/ie_plugin_api.xml) + set(IE_LAYOUT_SOURCE "${DOXYGEN_DIR}/ie_docs.xml") + set(C_LAYOUT_SOURCE "${DOXYGEN_DIR}/ie_c_api.xml") + set(PY_LAYOUT_SOURCE "${DOXYGEN_DIR}/ie_py_api.xml") + set(PLUGIN_LAYOUT_SOURCE "${DOXYGEN_DIR}/ie_plugin_api.xml") - set(IE_LAYOUT_BINARY ${DOCS_BINARY_DIR}/ie_docs.xml) - set(C_LAYOUT_BINARY ${DOCS_BINARY_DIR}/ie_c_api.xml) - set(PY_LAYOUT_BINARY ${DOCS_BINARY_DIR}/ie_py_api.xml) - set(PLUGIN_LAYOUT_BINARY ${DOCS_BINARY_DIR}/ie_plugin_api.xml) + set(IE_LAYOUT_BINARY "${DOCS_BINARY_DIR}/ie_docs.xml") + set(C_LAYOUT_BINARY "${DOCS_BINARY_DIR}/ie_c_api.xml") + set(PY_LAYOUT_BINARY "${DOCS_BINARY_DIR}/ie_py_api.xml") + set(PLUGIN_LAYOUT_BINARY "${DOCS_BINARY_DIR}/ie_plugin_api.xml") # Tables of contents configure_file(${IE_LAYOUT_SOURCE} ${IE_LAYOUT_BINARY} @ONLY) @@ -108,80 +105,84 @@ function(build_docs) configure_file(${PLUGIN_CONFIG_SOURCE} ${PLUGIN_CONFIG_BINARY} @ONLY) # Preprocessing scripts - set(DOXY_MD_FILTER ${DOXYGEN_DIR}/doxy_md_filter.py) - set(PYX_FILTER ${DOXYGEN_DIR}/pyx_filter.py) + set(DOXY_MD_FILTER "${DOXYGEN_DIR}/doxy_md_filter.py") + set(PYX_FILTER "${DOXYGEN_DIR}/pyx_filter.py") + + # C API add_custom_target(c_api - COMMAND ${DOXYGEN_EXECUTABLE} ${C_CONFIG_BINARY} - WORKING_DIRECTORY ${DOCS_BINARY_DIR} - COMMENT "Generating C API Reference" - VERBATIM - ) + COMMAND ${DOXYGEN_EXECUTABLE} ${C_CONFIG_BINARY} + WORKING_DIRECTORY ${DOCS_BINARY_DIR} + COMMENT "Generating C API Reference" + VERBATIM) + + # Python API add_custom_target(py_api - COMMAND ${DOXYGEN_EXECUTABLE} ${PY_CONFIG_BINARY} - WORKING_DIRECTORY ${DOCS_BINARY_DIR} - COMMENT "Generating Python API Reference" - VERBATIM - ) + COMMAND ${DOXYGEN_EXECUTABLE} ${PY_CONFIG_BINARY} + WORKING_DIRECTORY ${DOCS_BINARY_DIR} + COMMENT "Generating Python API Reference" + VERBATIM) - add_custom_target(plugin_api - COMMAND ${DOXYGEN_EXECUTABLE} ${PLUGIN_CONFIG_BINARY} - WORKING_DIRECTORY ${DOCS_BINARY_DIR} - COMMENT "Generating Plugin API Reference" - VERBATIM - ) + add_custom_command(TARGET py_api + PRE_BUILD + COMMAND ${Python3_EXECUTABLE} ${PYX_FILTER} ${PYTHON_API_OUT} + COMMENT "Pre-process Python API") - add_custom_target(preprocess_docs - COMMENT "Pre-process docs" - VERBATIM - ) + # Plugin API - add_custom_target(ie_docs - DEPENDS preprocess_docs - COMMAND ${DOXYGEN_EXECUTABLE} ${IE_CONFIG_BINARY} - WORKING_DIRECTORY ${DOCS_BINARY_DIR} - VERBATIM - ) + add_custom_target(plugin_api + COMMAND ${DOXYGEN_EXECUTABLE} ${PLUGIN_CONFIG_BINARY} + WORKING_DIRECTORY ${DOCS_BINARY_DIR} + COMMENT "Generating Plugin API Reference" + VERBATIM) - add_custom_target(openvino_docs - DEPENDS c_api py_api ie_docs plugin_api - COMMENT "Generating OpenVINO documentation" - VERBATIM - ) + # Preprocess docs - add_custom_command(TARGET py_api - PRE_BUILD - COMMAND ${Python3_EXECUTABLE} ${PYX_FILTER} ${PYTHON_API_OUT} - COMMENT "Pre-process Python API." - ) + add_custom_target(preprocess_docs + COMMENT "Pre-process docs" + VERBATIM) foreach(source_file ${doc_source_files}) - add_custom_command(TARGET preprocess_docs - PRE_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${OpenVINO_MAIN_SOURCE_DIR}/${source_file} ${DOCS_BINARY_DIR}/${source_file}) + list(APPEND commands COMMAND ${CMAKE_COMMAND} -E copy + "${OpenVINO_MAIN_SOURCE_DIR}/${source_file}" "${DOCS_BINARY_DIR}/${source_file}") endforeach() add_custom_command(TARGET preprocess_docs - PRE_BUILD - COMMAND ${Python3_EXECUTABLE} ${DOXY_MD_FILTER} ${DOCS_BINARY_DIR} - COMMENT "Pre-process markdown and image links." - ) + PRE_BUILD + ${commands} + COMMAND ${Python3_EXECUTABLE} ${DOXY_MD_FILTER} ${DOCS_BINARY_DIR} + COMMENT "Pre-process markdown and image links") + + # IE dev guide and C++ API + + add_custom_target(ie_docs + DEPENDS preprocess_docs + COMMAND ${DOXYGEN_EXECUTABLE} ${IE_CONFIG_BINARY} + WORKING_DIRECTORY ${DOCS_BINARY_DIR} + VERBATIM) - set_target_properties(ie_docs PROPERTIES FOLDER docs) + # Umbrella OpenVINO target + + add_custom_target(openvino_docs + DEPENDS c_api py_api ie_docs plugin_api + COMMENT "Generating OpenVINO documentation" + VERBATIM) + + set_target_properties(openvino_docs ie_docs c_api py_api preprocess_docs plugin_api + PROPERTIES FOLDER docs) find_program(browser NAMES xdg-open) if(browser) add_custom_target(ie_docs_open - COMMAND ${browser} "${OpenVINO_MAIN_SOURCE_DIR}/doc/html/index.html" - DEPENDS ie_docs - COMMENT "Open OpenVINO documentation" - VERBATIM) + COMMAND ${browser} "${OpenVINO_MAIN_SOURCE_DIR}/docs/html/index.html" + DEPENDS ie_docs + COMMENT "Open OpenVINO documentation" + VERBATIM) set_target_properties(ie_docs_open PROPERTIES FOLDER docs) endif() - endfunction() -if (ENABLE_DOCS) +if(ENABLE_DOCS) build_docs() endif() diff --git a/docs/IE_PLUGIN_DG/QuantizedNetworks.md b/docs/IE_PLUGIN_DG/QuantizedNetworks.md index 53bf1d3..a8848bc 100644 --- a/docs/IE_PLUGIN_DG/QuantizedNetworks.md +++ b/docs/IE_PLUGIN_DG/QuantizedNetworks.md @@ -46,8 +46,4 @@ Below we define these rules as follows: - Non-unified quantization parameters for Eltwise and Concat operations. - Non-quantized network output, i.e. there are no quantization parameters for it. -## Quantized model inference - -!!! Need details from the runtime team. - [qdq_propagation]: ../images/qdq_propagation.png diff --git a/docs/doxygen/ie_c_api.config b/docs/doxygen/ie_c_api.config index 889d55e..e967861 100644 --- a/docs/doxygen/ie_c_api.config +++ b/docs/doxygen/ie_c_api.config @@ -16,10 +16,10 @@ PREDEFINED = "__attribute__(x)=" \ FILE_PATTERNS = *.h -LAYOUT_FILE = @C_LAYOUT_BINARY@ +LAYOUT_FILE = "@C_LAYOUT_BINARY@" -INPUT = @C_API@ +INPUT = "@C_API@" HTML_OUTPUT = ie_c_api -GENERATE_TAGFILE = @DOCS_BINARY_DIR@/ie_c_api.tag +GENERATE_TAGFILE = "@DOCS_BINARY_DIR@/ie_c_api.tag" diff --git a/docs/doxygen/ie_docs.config b/docs/doxygen/ie_docs.config index ff95d6e..48dca68 100644 --- a/docs/doxygen/ie_docs.config +++ b/docs/doxygen/ie_docs.config @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = @DOCS_BINARY_DIR@/html +OUTPUT_DIRECTORY = "@DOCS_BINARY_DIR@/html" # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -823,8 +823,8 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = @DOCS_BINARY_DIR@ \ - @IE_SOURCE_DIR@/include +INPUT = "@DOCS_BINARY_DIR@" \ + "@IE_SOURCE_DIR@/include" # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -2262,7 +2262,7 @@ TAGFILES = # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = @DOCS_BINARY_DIR@/ie_api.tag +GENERATE_TAGFILE = "@DOCS_BINARY_DIR@/ie_api.tag" # If the ALLEXTERNALS tag is set to YES, all external class will be listed in # the class index. If set to NO, only the inherited external classes will be @@ -2496,7 +2496,7 @@ INTERACTIVE_SVG = NO # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = +DOT_PATH = "@DOXYGEN_DOT_EXECUTABLE@" # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile diff --git a/docs/doxygen/ie_plugin_api.config b/docs/doxygen/ie_plugin_api.config index d37ceb0..4d6dea7 100644 --- a/docs/doxygen/ie_plugin_api.config +++ b/docs/doxygen/ie_plugin_api.config @@ -1,15 +1,15 @@ @INCLUDE = @IE_CONFIG_BINARY@ -LAYOUT_FILE = @PLUGIN_LAYOUT_BINARY@ +LAYOUT_FILE = "@PLUGIN_LAYOUT_BINARY@" HTML_OUTPUT = ie_plugin_api -GENERATE_TAGFILE = @DOCS_BINARY_DIR@/ie_plugin_api.tag +GENERATE_TAGFILE = "@DOCS_BINARY_DIR@/ie_plugin_api.tag" EXTRACT_LOCAL_CLASSES = NO -INPUT = @DOCS_BINARY_DIR@/docs/IE_PLUGIN_DG \ - @IE_SOURCE_DIR@/src/plugin_api +INPUT = "@DOCS_BINARY_DIR@/docs/IE_PLUGIN_DG" \ + "@IE_SOURCE_DIR@/src/plugin_api" FILE_PATTERNS = *.c \ *.cpp \ @@ -27,14 +27,15 @@ EXCLUDE_PATTERNS = cnn_network_ngraph_impl.hpp \ EXCLUDE_SYMBOLS = -EXAMPLE_PATH = @CMAKE_CURRENT_SOURCE_DIR@/template_plugin/src \ - @CMAKE_CURRENT_SOURCE_DIR@/template_plugin/include \ - @CMAKE_CURRENT_SOURCE_DIR@/template_plugin/src/CMakeLists.txt \ - @CMAKE_CURRENT_SOURCE_DIR@/template_plugin/tests/functional/CMakeLists.txt \ - @CMAKE_CURRENT_SOURCE_DIR@/examples +EXAMPLE_PATH = "@CMAKE_CURRENT_SOURCE_DIR@/template_plugin/src" \ + "@CMAKE_CURRENT_SOURCE_DIR@/template_plugin/include" \ + "@CMAKE_CURRENT_SOURCE_DIR@/template_plugin/src/CMakeLists.txt" \ + "@CMAKE_CURRENT_SOURCE_DIR@/template_plugin/tests/functional/" + CMakeLists.txt \ + "@CMAKE_CURRENT_SOURCE_DIR@/examples" EXAMPLE_PATTERNS = *.cpp \ - *.hpp + *.hpp ENUM_VALUES_PER_LINE = 1 diff --git a/docs/doxygen/ie_py_api.config b/docs/doxygen/ie_py_api.config index d65a7c0..caeb7fc 100644 --- a/docs/doxygen/ie_py_api.config +++ b/docs/doxygen/ie_py_api.config @@ -26,10 +26,10 @@ EXTENSION_MAPPING = pyx=Python FILE_PATTERNS = *.pyx -LAYOUT_FILE = @PY_LAYOUT_BINARY@ +LAYOUT_FILE = "@PY_LAYOUT_BINARY@" -INPUT = @PYTHON_API_OUT@ +INPUT = "@PYTHON_API_OUT@" HTML_OUTPUT = ie_python_api -GENERATE_TAGFILE = @DOCS_BINARY_DIR@/ie_python_api.tag +GENERATE_TAGFILE = "@DOCS_BINARY_DIR@/ie_python_api.tag" diff --git a/inference-engine/thirdparty/CMakeLists.txt b/inference-engine/thirdparty/CMakeLists.txt index 9eba9a8..a2550bf 100644 --- a/inference-engine/thirdparty/CMakeLists.txt +++ b/inference-engine/thirdparty/CMakeLists.txt @@ -42,6 +42,10 @@ function(build_with_lto) endif() add_subdirectory(clDNN) + + # disable CLDNN docs build + set_target_properties(docs PROPERTIES EXCLUDE_FROM_ALL ON + FOLDER docs) endif() function(ie_build_pugixml) -- 2.7.4