diff --git a/.ci/azure/linux.yml b/.ci/azure/linux.yml index 24f59d96be3aa3..7b1ee18d792d74 100644 --- a/.ci/azure/linux.yml +++ b/.ci/azure/linux.yml @@ -109,7 +109,6 @@ jobs: -DENABLE_WHEEL=ON -DENABLE_TESTS=ON -DNGRAPH_ONNX_IMPORT_ENABLE=ON - -DNGRAPH_ONNX_EDITOR_ENABLE=ON -DENABLE_FASTER_BUILD=ON -DENABLE_STRICT_DEPENDENCIES=OFF -DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules diff --git a/.ci/azure/linux_onnxruntime.yml b/.ci/azure/linux_onnxruntime.yml index bc8248256455fc..fce8fdddcc4f91 100644 --- a/.ci/azure/linux_onnxruntime.yml +++ b/.ci/azure/linux_onnxruntime.yml @@ -95,7 +95,6 @@ jobs: -DENABLE_SAMPLES=OFF -DENABLE_SPEECH_DEMO=OFF -DNGRAPH_ONNX_IMPORT_ENABLE=ON - -DNGRAPH_ONNX_EDITOR_ENABLE=ON -DNGRAPH_DEBUG_ENABLE=OFF $(REPO_DIR) workingDirectory: $(BUILD_DIR) diff --git a/.ci/openvino-onnx/Dockerfile b/.ci/openvino-onnx/Dockerfile index 45fb6d12a8ca0e..9b0f48cf66cc3e 100644 --- a/.ci/openvino-onnx/Dockerfile +++ b/.ci/openvino-onnx/Dockerfile @@ -69,7 +69,6 @@ RUN cmake .. \ -DENABLE_PYTHON=ON \ -DPYTHON_EXECUTABLE=/usr/bin/python3 \ -DNGRAPH_ONNX_IMPORT_ENABLE=ON \ - -DNGRAPH_ONNX_EDITOR_ENABLE=ON \ -DNGRAPH_DEBUG_ENABLE=OFF \ -DCMAKE_INSTALL_PREFIX=/openvino/dist \ -DNGRAPH_USE_PROTOBUF_LITE=${PROTOBUF_LITE} diff --git a/cmake/coverage.cmake b/cmake/coverage.cmake index 22709e927de48f..60c137337b3173 100644 --- a/cmake/coverage.cmake +++ b/cmake/coverage.cmake @@ -93,15 +93,8 @@ ie_coverage_genhtml(INFO_FILE "ngraph" if(NGRAPH_ONNX_IMPORT_ENABLE) ie_coverage_extract(INPUT "openvino" OUTPUT "onnx_importer" PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/ngraph/frontend/onnx_common*" + "${OV_COVERAGE_BASE_DIRECTORY}/ngraph/frontend/onnx_editor*" "${OV_COVERAGE_BASE_DIRECTORY}/ngraph/frontend/onnx_import*") ie_coverage_genhtml(INFO_FILE "onnx_importer" PREFIX "${OV_COVERAGE_BASE_DIRECTORY}") endif() - -if(NGRAPH_ONNX_EDITOR_ENABLE) - ie_coverage_extract(INPUT "openvino" OUTPUT "onnx_editor" - PATTERNS "${OV_COVERAGE_BASE_DIRECTORY}/ngraph/frontend/onnx_editor*") - ie_coverage_genhtml(INFO_FILE "onnx_editor" - PREFIX "${OV_COVERAGE_BASE_DIRECTORY}") -endif() - diff --git a/cmake/developer_package/compile_flags/os_flags.cmake b/cmake/developer_package/compile_flags/os_flags.cmake index b1fca6240c231c..072f2a0dcee22a 100644 --- a/cmake/developer_package/compile_flags/os_flags.cmake +++ b/cmake/developer_package/compile_flags/os_flags.cmake @@ -313,5 +313,6 @@ else() elseif(LINUX) set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections -Wl,--exclude-libs,ALL") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--gc-sections -Wl,--exclude-libs,ALL") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections -Wl,--exclude-libs,ALL") endif() endif() diff --git a/inference-engine/include/gpu/gpu_ocl_wrapper.hpp b/inference-engine/include/gpu/gpu_ocl_wrapper.hpp index 496f0974ad51e1..85ca2521a76346 100644 --- a/inference-engine/include/gpu/gpu_ocl_wrapper.hpp +++ b/inference-engine/include/gpu/gpu_ocl_wrapper.hpp @@ -39,7 +39,7 @@ # pragma GCC system_header #endif -#include +#include #ifdef __GNUC__ # pragma GCC diagnostic pop diff --git a/ngraph/CMakeLists.txt b/ngraph/CMakeLists.txt index 20fe4a9af12a52..ede1e561ed2fb3 100644 --- a/ngraph/CMakeLists.txt +++ b/ngraph/CMakeLists.txt @@ -21,64 +21,20 @@ option(NGRAPH_UNIT_TEST_ENABLE "Control the building of unit tests" ON) option(NGRAPH_UNIT_TEST_BACKENDS_ENABLE "Control the building of unit tests using backends" ON) option(NGRAPH_DEBUG_ENABLE "Enable output for NGRAPH_DEBUG statements" OFF) option(NGRAPH_ONNX_IMPORT_ENABLE "Enable ONNX importer" OFF) -option(NGRAPH_ONNX_EDITOR_ENABLE "Enable ONNX Editor" OFF) option(NGRAPH_PDPD_FRONTEND_ENABLE "Enable PaddlePaddle FrontEnd" OFF) option(NGRAPH_USE_PROTOBUF_LITE "Compiles and links with protobuf-lite" OFF) if (NGRAPH_ONNX_IMPORT_ENABLE OR NGRAPH_PDPD_FRONTEND_ENABLE) option(NGRAPH_USE_SYSTEM_PROTOBUF "Use system provided Protobuf shared object" OFF) endif() -if(NGRAPH_ONNX_EDITOR_ENABLE AND NOT NGRAPH_ONNX_IMPORT_ENABLE) - message(FATAL_ERROR "ONNX Editor component requires ONNX Importer. Set NGRAPH_ONNX_IMPORT_ENABLE=ON.") -endif() message(STATUS "NGRAPH_DEBUG_ENABLE: ${NGRAPH_DEBUG_ENABLE}") message(STATUS "NGRAPH_ONNX_IMPORT_ENABLE: ${NGRAPH_ONNX_IMPORT_ENABLE}") -message(STATUS "NGRAPH_ONNX_EDITOR_ENABLE: ${NGRAPH_ONNX_EDITOR_ENABLE}") message(STATUS "NGRAPH_PDPD_FRONTEND_ENABLE: ${NGRAPH_PDPD_FRONTEND_ENABLE}") message(STATUS "NGRAPH_USE_PROTOBUF_LITE: ${NGRAPH_USE_PROTOBUF_LITE}") message(STATUS "NGRAPH_UNIT_TEST_ENABLE: ${NGRAPH_UNIT_TEST_ENABLE}") message(STATUS "NGRAPH_UNIT_TEST_BACKENDS_ENABLE: ${NGRAPH_UNIT_TEST_BACKENDS_ENABLE}") -# Setup CMAKE_ARGS to be forwarded to External Projects -set(NGRAPH_FORWARD_CMAKE_ARGS - -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} - -DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD} - -DCMAKE_CXX_STANDARD_REQUIRED:BOOL=${CMAKE_CXX_STANDARD_REQUIRED} - -DCMAKE_CXX_EXTENSIONS:BOOL=${CMAKE_CXX_EXTENSIONS} - -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=${CMAKE_EXPORT_COMPILE_COMMANDS} - -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=${CMAKE_POSITION_INDEPENDENT_CODE} - -DCMAKE_DEBUG_POSTFIX=${CMAKE_DEBUG_POSTFIX} - -DCMAKE_RELEASE_POSTFIX=${CMAKE_RELEASE_POSTFIX} - ) - -if(CMAKE_TOOLCHAIN_FILE) - set(NGRAPH_FORWARD_CMAKE_ARGS - ${NGRAPH_FORWARD_CMAKE_ARGS} - -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} - ) -endif() - -if (CMAKE_OSX_SYSROOT) - set(NGRAPH_FORWARD_CMAKE_ARGS - ${NGRAPH_FORWARD_CMAKE_ARGS} - -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT} - ) -endif() - -if (NOT MSVC) - if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE) - endif() - - set(NGRAPH_FORWARD_CMAKE_ARGS - ${NGRAPH_FORWARD_CMAKE_ARGS} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - ) -endif() -message(STATUS "NGRAPH_FORWARD_CMAKE_ARGS ${NGRAPH_FORWARD_CMAKE_ARGS}") - #----------------------------------------------------------------------------------------------- # Installation logic... #----------------------------------------------------------------------------------------------- @@ -154,12 +110,7 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ngraphConfig.cmake DESTINATION "deployment_tools/ngraph/cmake" COMPONENT ngraph_dev) -set(USE_STATIC_PROTOBUF OFF) -if (NGRAPH_PDPD_FRONTEND_ENABLE) # add more frontends here which depend on static protobuf - set(USE_STATIC_PROTOBUF ON) -endif() - -if (NGRAPH_ONNX_IMPORT_ENABLE OR USE_STATIC_PROTOBUF) +if (NGRAPH_ONNX_IMPORT_ENABLE OR NGRAPH_PDPD_FRONTEND_ENABLE) if (MSVC) # When we build dll libraries. These flags make sure onnx and protobuf build with /MD, not /MT. # These two options can't be mixed, because they requires link two imcompatiable runtime. @@ -174,8 +125,7 @@ if (NGRAPH_ONNX_IMPORT_ENABLE OR USE_STATIC_PROTOBUF) endif() set(BEFORE_ONNX_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) - set(BUILD_SHARED_LIBS ON) - set(BUILD_STANDALONE_STATIC OFF) + set(BUILD_SHARED_LIBS OFF) if (NOT NGRAPH_USE_SYSTEM_PROTOBUF) add_subdirectory(${CMAKE_SOURCE_DIR}/thirdparty/protobuf ${CMAKE_BINARY_DIR}/_deps/protobuf) @@ -193,7 +143,6 @@ if (NGRAPH_ONNX_IMPORT_ENABLE OR USE_STATIC_PROTOBUF) set(BUILD_SHARED_LIBS ${BEFORE_ONNX_BUILD_SHARED_LIBS}) unset(BEFORE_ONNX_BUILD_SHARED_LIBS) - unset(BUILD_STANDALONE_STATIC) endif() add_subdirectory(frontend) diff --git a/ngraph/frontend/CMakeLists.txt b/ngraph/frontend/CMakeLists.txt index b4afff783dbb94..ae62678e9d7a66 100644 --- a/ngraph/frontend/CMakeLists.txt +++ b/ngraph/frontend/CMakeLists.txt @@ -2,41 +2,6 @@ # SPDX-License-Identifier: Apache-2.0 # -if(NOT WIN32) - # There seems no suitable other way to identify exact output binary name for libprotobuf - if(CMAKE_BUILD_TYPE STREQUAL "Debug") - # Use 'protobufd' directly as it is done in the same way in protobuf cmake files - set(PROTOBUF_STATIC_LIB_OUTPUT - ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${CMAKE_STATIC_LIBRARY_PREFIX}protobufd${CMAKE_STATIC_LIBRARY_SUFFIX}) - else(CMAKE_BUILD_TYPE STREQUAL "Debug") - set(PROTOBUF_STATIC_LIB_OUTPUT ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/${CMAKE_STATIC_LIBRARY_PREFIX}protobuf${CMAKE_STATIC_LIBRARY_SUFFIX}) - endif() - - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/libprotobuf_static) - add_custom_command( - OUTPUT - ${PROTOBUF_STATIC_LIB_OUTPUT} - COMMAND ${CMAKE_COMMAND} ${CMAKE_SOURCE_DIR}/thirdparty/cmake_static_protobuf - -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} - -DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=${CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY} - -DCMAKE_PDB_OUTPUT_DIRECTORY=${CMAKE_PDB_OUTPUT_DIRECTORY} - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} - -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} - -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} - -DCMAKE_CXX_VISIBILITY_PRESET=${CMAKE_CXX_VISIBILITY_PRESET} - -DNGRAPH_INSTALL_LIB=${NGRAPH_INSTALL_LIB} - -DSYSTEM_PROTOC=${SYSTEM_PROTOC} - ${NGRAPH_FORWARD_CMAKE_ARGS} - COMMAND ${CMAKE_COMMAND} --build . --target libprotobuf - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/libprotobuf_static - COMMENT "Build Protobuf Static Library" - ) - - add_custom_target(libprotobuf_static - DEPENDS ${PROTOBUF_STATIC_LIB_OUTPUT}) -endif() - set(FRONTEND_INSTALL_INCLUDE "${NGRAPH_INSTALL_INCLUDE}/ngraph/frontend") add_subdirectory(frontend_manager) @@ -46,10 +11,6 @@ if (NGRAPH_ONNX_IMPORT_ENABLE) add_subdirectory(onnx_import) endif() -if (NGRAPH_ONNX_EDITOR_ENABLE) - add_subdirectory(onnx_editor) -endif() - if (NGRAPH_PDPD_FRONTEND_ENABLE) add_subdirectory(paddlepaddle) endif() diff --git a/ngraph/frontend/onnx_common/CMakeLists.txt b/ngraph/frontend/onnx_common/CMakeLists.txt index e245490bf0f3ae..f1046b3ab0d433 100644 --- a/ngraph/frontend/onnx_common/CMakeLists.txt +++ b/ngraph/frontend/onnx_common/CMakeLists.txt @@ -2,6 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 # +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF) + set(TARGET_NAME "onnx_common") file(GLOB_RECURSE LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) diff --git a/ngraph/frontend/onnx_editor/CMakeLists.txt b/ngraph/frontend/onnx_editor/CMakeLists.txt index f0cec14b1f7089..90cf30f3c25a74 100644 --- a/ngraph/frontend/onnx_editor/CMakeLists.txt +++ b/ngraph/frontend/onnx_editor/CMakeLists.txt @@ -2,39 +2,39 @@ # SPDX-License-Identifier: Apache-2.0 # -set(TARGET_NAME "onnx_editor") +#set(TARGET_NAME "onnx_editor") -file(GLOB_RECURSE LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) -file(GLOB_RECURSE LIBRARY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp) -file(GLOB_RECURSE LIBRARY_PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp) +#file(GLOB_RECURSE LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) +#file(GLOB_RECURSE LIBRARY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp) +#file(GLOB_RECURSE LIBRARY_PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp) # Create named folders for the sources within the .vcproj # Empty name lists them directly under the .vcproj -source_group("src" FILES ${LIBRARY_SRC}) -source_group("include" FILES ${LIBRARY_HEADERS}) -source_group("public include" FILES ${LIBRARY_PUBLIC_HEADERS}) +#source_group("src" FILES ${LIBRARY_SRC}) +#source_group("include" FILES ${LIBRARY_HEADERS}) +#source_group("public include" FILES ${LIBRARY_PUBLIC_HEADERS}) # Create static library -add_library(${TARGET_NAME} STATIC ${LIBRARY_SRC} ${LIBRARY_HEADERS} ${LIBRARY_PUBLIC_HEADERS}) -add_library(ngraph::onnx_editor ALIAS ${TARGET_NAME}) +#add_library(${TARGET_NAME} OBJECT ${LIBRARY_SRC} ${LIBRARY_HEADERS} ${LIBRARY_PUBLIC_HEADERS}) +#add_library(ngraph::onnx_editor ALIAS ${TARGET_NAME}) # TODO Add handling ie_faster_build -target_link_libraries(${TARGET_NAME} PRIVATE onnx_common onnx_importer - PUBLIC ngraph) +#target_link_libraries(${TARGET_NAME} PRIVATE onnx_common +# PUBLIC ngraph) -set(ONNX_EDITOR_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) -set(ONNX_EDITOR_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src) +#set(ONNX_EDITOR_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) +#set(ONNX_EDITOR_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src) -target_include_directories(${TARGET_NAME} PUBLIC $ - $) +#target_include_directories(${TARGET_NAME} PUBLIC $ +# $) -target_include_directories(${TARGET_NAME} PRIVATE ${ONNX_EDITOR_SRC_DIR}) +#target_include_directories(${TARGET_NAME} PRIVATE ${ONNX_EDITOR_SRC_DIR}) -if(NGRAPH_USE_PROTOBUF_LITE) - target_compile_definitions(${TARGET_NAME} PRIVATE NGRAPH_USE_PROTOBUF_LITE) -endif() +#if(NGRAPH_USE_PROTOBUF_LITE) +# target_compile_definitions(${TARGET_NAME} PRIVATE NGRAPH_USE_PROTOBUF_LITE) +#endif() -add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}) +#add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}) diff --git a/ngraph/frontend/onnx_editor/include/onnx_editor/edge_mapper.hpp b/ngraph/frontend/onnx_editor/include/onnx_editor/edge_mapper.hpp index 3e2c6afaa07df5..2829d536b01744 100644 --- a/ngraph/frontend/onnx_editor/include/onnx_editor/edge_mapper.hpp +++ b/ngraph/frontend/onnx_editor/include/onnx_editor/edge_mapper.hpp @@ -26,7 +26,7 @@ namespace ngraph class EdgeMapper { public: - EdgeMapper() = default; + ONNX_IMPORTER_API EdgeMapper() = default; /// \brief Creates an edge mapper based on a GraphProto object. /// @@ -51,7 +51,8 @@ namespace ngraph /// /// \param input An EditorInput helper structure created based on a input name /// or a input index. - InputEdge find_input_edge(const EditorNode& node, const EditorInput& input) const; + ONNX_IMPORTER_API InputEdge find_input_edge(const EditorNode& node, + const EditorInput& input) const; /// \brief Returns an OutputEdge based on a node (node name or output name) /// and an output (output name or output index). @@ -68,7 +69,8 @@ namespace ngraph /// /// \param output An EditorOutput helper structure created based on a output name /// or a output index. - OutputEdge find_output_edge(const EditorNode& node, const EditorOutput& output) const; + ONNX_IMPORTER_API OutputEdge find_output_edge(const EditorNode& node, + const EditorOutput& output) const; /// \brief Returns an OutputEdge based on a output name. /// @@ -76,7 +78,7 @@ namespace ngraph /// /// \param output_name A node output name. /// - OutputEdge find_output_edge(const std::string& output_name) const; + ONNX_IMPORTER_API OutputEdge find_output_edge(const std::string& output_name) const; /// \brief Returns a vector of InputEdges which consume an output of a node /// determined by provided output name. @@ -85,7 +87,8 @@ namespace ngraph /// /// \param output_name A node output name. /// - std::vector find_output_consumers(const std::string& output_name) const; + ONNX_IMPORTER_API std::vector + find_output_consumers(const std::string& output_name) const; /// \brief Returns true if a provided node is correct (exists in a graph) /// and is not ambiguous (identification of an ONNX node can be ambiguous @@ -94,7 +97,7 @@ namespace ngraph /// \param node An EditorNode helper structure created based on a node name /// or a node output name. /// - bool is_correct_and_unambiguous_node(const EditorNode& node) const; + ONNX_IMPORTER_API bool is_correct_and_unambiguous_node(const EditorNode& node) const; private: std::vector find_node_indexes(const std::string& node_name, diff --git a/ngraph/frontend/onnx_editor/include/onnx_editor/editor.hpp b/ngraph/frontend/onnx_editor/include/onnx_editor/editor.hpp index b93b568141e287..4f31ab2d323c35 100644 --- a/ngraph/frontend/onnx_editor/include/onnx_editor/editor.hpp +++ b/ngraph/frontend/onnx_editor/include/onnx_editor/editor.hpp @@ -15,13 +15,6 @@ #include "onnx_editor/editor.hpp" #include "onnx_editor/editor_types.hpp" -namespace ONNX_NAMESPACE -{ - // forward declaration to avoid the necessity of include paths setting in components - // that don't directly depend on the ONNX library - class ModelProto; -} // namespace ONNX_NAMESPACE - namespace ngraph { namespace onnx_editor @@ -31,7 +24,7 @@ namespace ngraph /// \note This class can be used to modify an ONNX model before it gets translated to /// an ngraph::Function by the import_onnx_model function. It lets you modify the /// model's input types and shapes, extract a subgraph and more. - class ONNXModelEditor final + class ONNX_IMPORTER_API ONNXModelEditor final { public: ONNXModelEditor() = delete; diff --git a/ngraph/frontend/onnx_editor/include/onnx_editor/editor_types.hpp b/ngraph/frontend/onnx_editor/include/onnx_editor/editor_types.hpp index 16e4828236cf98..9c2fccd207818d 100644 --- a/ngraph/frontend/onnx_editor/include/onnx_editor/editor_types.hpp +++ b/ngraph/frontend/onnx_editor/include/onnx_editor/editor_types.hpp @@ -7,6 +7,8 @@ #include #include +#include "onnx_import/utils/onnx_importer_visibility.hpp" + namespace ngraph { enum class EdgeType @@ -85,7 +87,7 @@ namespace ngraph /// /// The optional argument "new_input_name" can be used to set a custom input name /// which can be created during cutting a graph. - struct EditorInput + struct ONNX_IMPORTER_API EditorInput { EditorInput() = delete; EditorInput(std::string input_name, std::string new_input_name = "") @@ -110,7 +112,7 @@ namespace ngraph /// ----(in_A)----> | test_node | /// +-----------+ ---(out2)---> /// You can indicate out2 as EditorOutput("out2") or EditorOutput(1) - struct EditorOutput + struct ONNX_IMPORTER_API EditorOutput { EditorOutput() = delete; EditorOutput(std::string output_name) @@ -135,7 +137,7 @@ namespace ngraph /// You can indicate test_node by name as EditorNode("test_node") /// or by assigned output as EditorNode(EditorOutput("out1")) /// or EditorNode(EditorOutput("out2")) - struct EditorNode + struct ONNX_IMPORTER_API EditorNode { EditorNode(std::string node_name) : m_node_name{std::move(node_name)} diff --git a/ngraph/frontend/onnx_import/CMakeLists.txt b/ngraph/frontend/onnx_import/CMakeLists.txt index bb6a4e7ff99580..f3ef5e8c68d2b5 100644 --- a/ngraph/frontend/onnx_import/CMakeLists.txt +++ b/ngraph/frontend/onnx_import/CMakeLists.txt @@ -2,12 +2,17 @@ # SPDX-License-Identifier: Apache-2.0 # +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF) set(ONNX_OPSET_VERSION 13 CACHE INTERNAL "Supported version of ONNX operator set") file(GLOB_RECURSE LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) file(GLOB_RECURSE LIBRARY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/*.hpp) file(GLOB_RECURSE LIBRARY_PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp) +file(GLOB_RECURSE EDITOR_LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../onnx_editor/src/*.cpp) +file(GLOB_RECURSE EDITOR_LIBRARY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../onnx_editor/src/*.hpp) +file(GLOB_RECURSE EDITOR_LIBRARY_PUBLIC_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../onnx_editor/include/*.hpp) + # Remove disabled ops list(REMOVE_ITEM LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/op/conv_integer.cpp @@ -23,12 +28,13 @@ set(ONNX_IMPORT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include) # Create named folders for the sources within the .vcproj # Empty name lists them directly under the .vcproj -source_group("src" FILES ${LIBRARY_SRC}) -source_group("include" FILES ${LIBRARY_HEADERS}) -source_group("public include" FILES ${LIBRARY_PUBLIC_HEADERS}) +source_group("src" FILES ${LIBRARY_SRC} ${EDITOR_LIBRARY_SRC}) +source_group("include" FILES ${LIBRARY_HEADERS} ${EDITOR_LIBRARY_HEADERS}) +source_group("public include" FILES ${LIBRARY_PUBLIC_HEADERS} ${EDITOR_LIBRARY_PUBLIC_HEADERS}) # Create shared library -add_library(onnx_importer SHARED ${LIBRARY_SRC} ${LIBRARY_HEADERS} ${LIBRARY_PUBLIC_HEADERS}) +add_library(onnx_importer SHARED ${LIBRARY_SRC} ${LIBRARY_HEADERS} ${LIBRARY_PUBLIC_HEADERS} + ${EDITOR_LIBRARY_SRC} ${EDITOR_LIBRARY_HEADERS} ${EDITOR_LIBRARY_PUBLIC_HEADERS}) add_library(ngraph::onnx_importer ALIAS onnx_importer) add_clang_format_target(onnx_importer_clang FOR_TARGETS onnx_importer) @@ -55,6 +61,12 @@ target_include_directories(onnx_importer PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src target_compile_definitions(onnx_importer PRIVATE ONNX_OPSET_VERSION=${ONNX_OPSET_VERSION}) +set(ONNX_EDITOR_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../onnx_editor/include) +set(ONNX_EDITOR_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../onnx_editor/src) + +target_include_directories(onnx_importer PUBLIC $) +target_include_directories(onnx_importer PRIVATE ${ONNX_EDITOR_SRC_DIR}) + if(NGRAPH_USE_PROTOBUF_LITE) target_compile_definitions(onnx_importer PRIVATE NGRAPH_USE_PROTOBUF_LITE) endif() diff --git a/ngraph/frontend/onnx_import/include/onnx_import/core/node.hpp b/ngraph/frontend/onnx_import/include/onnx_import/core/node.hpp index cb5d11fde31e5c..097c100e28f8de 100644 --- a/ngraph/frontend/onnx_import/include/onnx_import/core/node.hpp +++ b/ngraph/frontend/onnx_import/include/onnx_import/core/node.hpp @@ -48,6 +48,7 @@ namespace ngraph { public: Node() = delete; + // TODO: hide this ctor since it uses protobufs generated structures Node(const ONNX_NAMESPACE::NodeProto& node_proto, const Graph& graph); Node(Node&&) noexcept; diff --git a/ngraph/frontend/onnx_import/include/onnx_import/utils/onnx_internal.hpp b/ngraph/frontend/onnx_import/include/onnx_import/utils/onnx_internal.hpp index 58554bd3c99234..92df626cd24e6b 100644 --- a/ngraph/frontend/onnx_import/include/onnx_import/utils/onnx_internal.hpp +++ b/ngraph/frontend/onnx_import/include/onnx_import/utils/onnx_internal.hpp @@ -36,7 +36,6 @@ namespace ngraph /// /// \return An nGraph function that represents a single output from the created /// graph. - ONNX_IMPORTER_API std::shared_ptr import_onnx_model(ONNX_NAMESPACE::ModelProto& model_proto, const std::string& model_path); } // namespace detail diff --git a/ngraph/frontend/paddlepaddle/CMakeLists.txt b/ngraph/frontend/paddlepaddle/CMakeLists.txt index cc6f300f8dabd2..bef18337ae2171 100644 --- a/ngraph/frontend/paddlepaddle/CMakeLists.txt +++ b/ngraph/frontend/paddlepaddle/CMakeLists.txt @@ -40,7 +40,8 @@ foreach(INFILE ${proto_files}) COMMAND ${PDPD_PROTOC_EXECUTABLE} ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} -I ${FILE_DIR} ${FILE_WE}.proto DEPENDS ${PDPD_PROTOC_EXECUTABLE} ${GENERATED_PROTO} COMMENT "Running C++ protocol buffer compiler (${PDPD_PROTOC_EXECUTABLE}) on ${GENERATED_PROTO}" - VERBATIM) + VERBATIM + COMMAND_EXPAND_LISTS) list(APPEND PROTO_SRCS "${OUTPUT_PB_SRC}") list(APPEND PROTO_HDRS "${OUTPUT_PB_HEADER}") endforeach() @@ -55,12 +56,7 @@ set_source_files_properties(${PROTO_SRCS} ${PROTO_HDRS} PROPERTIES COMPILE_OPTIO # Create shared library add_library(${TARGET_NAME} SHARED ${LIBRARY_SRC} ${LIBRARY_HEADERS} ${LIBRARY_PUBLIC_HEADERS} ${PROTO_SRCS} ${PROTO_HDRS}) -add_dependencies(${TARGET_NAME} libprotobuf paddlepaddle_ngraph_frontend_proto) - -if(NOT WIN32) - # Addition dependency on static libprotobuf for non-Windows - add_dependencies(${TARGET_NAME} libprotobuf_static) -endif() +add_dependencies(${TARGET_NAME} paddlepaddle_ngraph_frontend_proto) target_include_directories(${TARGET_NAME} PUBLIC @@ -76,11 +72,7 @@ if(COMMAND ie_add_vs_version_file) FILEDESCRIPTION "FrontEnd to load and convert PaddlePaddle file format") endif() -if(WIN32) - target_link_libraries(${TARGET_NAME} PRIVATE libprotobuf) -else() - target_link_libraries(${TARGET_NAME} PRIVATE ${PROTOBUF_STATIC_LIB_OUTPUT}) -endif() +target_link_libraries(${TARGET_NAME} PRIVATE ${Protobuf_LIBRARIES}) target_link_libraries(${TARGET_NAME} PUBLIC frontend_manager PRIVATE ngraph::builder) diff --git a/ngraph/test/CMakeLists.txt b/ngraph/test/CMakeLists.txt index 91520b6be2664e..cc265ed2456cf1 100644 --- a/ngraph/test/CMakeLists.txt +++ b/ngraph/test/CMakeLists.txt @@ -531,7 +531,7 @@ if (NGRAPH_ONNX_IMPORT_ENABLE AND NOT NGRAPH_USE_PROTOBUF_LITE) onnx/onnx_tensor_names.cpp) endif() -if (NGRAPH_ONNX_EDITOR_ENABLE) +if (NGRAPH_ONNX_IMPORT_ENABLE) list(APPEND SRC onnx/onnx_editor.cpp) list(APPEND MULTI_TEST_SRC onnx/onnx_test_utils.in.cpp @@ -636,10 +636,6 @@ if (NGRAPH_ONNX_IMPORT_ENABLE) target_link_libraries(unit-test PRIVATE onnx_importer) endif() -if (NGRAPH_ONNX_EDITOR_ENABLE) - target_link_libraries(unit-test PRIVATE onnx_editor) -endif() - target_link_libraries(unit-test PRIVATE interpreter_backend) install(TARGETS unit-test diff --git a/ngraph/test/frontend/paddlepaddle/basic_api.cpp b/ngraph/test/frontend/paddlepaddle/basic_api.cpp index 633e8edbcf4ef4..d191e4fccda3af 100644 --- a/ngraph/test/frontend/paddlepaddle/basic_api.cpp +++ b/ngraph/test/frontend/paddlepaddle/basic_api.cpp @@ -21,8 +21,8 @@ static const std::vector models{ }; INSTANTIATE_TEST_SUITE_P(PDPDBasicTest, - FrontEndBasicTest, - ::testing::Combine(::testing::Values(PDPD), - ::testing::Values(std::string(TEST_PDPD_MODELS)), - ::testing::ValuesIn(models)), - FrontEndBasicTest::getTestCaseName); + FrontEndBasicTest, + ::testing::Combine(::testing::Values(PDPD), + ::testing::Values(std::string(TEST_PDPD_MODELS)), + ::testing::ValuesIn(models)), + FrontEndBasicTest::getTestCaseName); diff --git a/ngraph/test/frontend/paddlepaddle/cut_specific_model.cpp b/ngraph/test/frontend/paddlepaddle/cut_specific_model.cpp index c4f00198b26d0d..3251762b6f9421 100644 --- a/ngraph/test/frontend/paddlepaddle/cut_specific_model.cpp +++ b/ngraph/test/frontend/paddlepaddle/cut_specific_model.cpp @@ -28,6 +28,6 @@ static CutModelParam getTestData_2in_2out() } INSTANTIATE_TEST_SUITE_P(PDPDCutTest, - FrontEndCutModelTest, - ::testing::Values(getTestData_2in_2out()), - FrontEndCutModelTest::getTestCaseName); \ No newline at end of file + FrontEndCutModelTest, + ::testing::Values(getTestData_2in_2out()), + FrontEndCutModelTest::getTestCaseName); \ No newline at end of file diff --git a/ngraph/test/frontend/paddlepaddle/load_from.cpp b/ngraph/test/frontend/paddlepaddle/load_from.cpp index 0f3256fc2bcac6..2950c3d271f4f7 100644 --- a/ngraph/test/frontend/paddlepaddle/load_from.cpp +++ b/ngraph/test/frontend/paddlepaddle/load_from.cpp @@ -24,6 +24,6 @@ static LoadFromFEParam getTestData() } INSTANTIATE_TEST_SUITE_P(PDPDCutTest, - FrontEndLoadFromTest, - ::testing::Values(getTestData()), - FrontEndLoadFromTest::getTestCaseName); \ No newline at end of file + FrontEndLoadFromTest, + ::testing::Values(getTestData()), + FrontEndLoadFromTest::getTestCaseName); \ No newline at end of file diff --git a/ngraph/test/frontend/paddlepaddle/op_fuzzy.cpp b/ngraph/test/frontend/paddlepaddle/op_fuzzy.cpp index a2d29bfb6e6aa6..dd01cc1e2aefbe 100644 --- a/ngraph/test/frontend/paddlepaddle/op_fuzzy.cpp +++ b/ngraph/test/frontend/paddlepaddle/op_fuzzy.cpp @@ -4,11 +4,11 @@ #include -#include "util/engine/test_engines.hpp" -#include "util/test_control.hpp" #include -#include "op_fuzzy.hpp" #include "ngraph/ngraph.hpp" +#include "op_fuzzy.hpp" +#include "util/engine/test_engines.hpp" +#include "util/test_control.hpp" using namespace ngraph; using namespace InferenceEngine; diff --git a/ngraph/test/frontend/paddlepaddle/partial_shape.cpp b/ngraph/test/frontend/paddlepaddle/partial_shape.cpp index 0cef8886760e2f..ddb7213f9ec75f 100644 --- a/ngraph/test/frontend/paddlepaddle/partial_shape.cpp +++ b/ngraph/test/frontend/paddlepaddle/partial_shape.cpp @@ -62,13 +62,13 @@ static PartShape getTestShape_conv2d_relu() } INSTANTIATE_TEST_SUITE_P(PDPDPartialShapeTest, - FrontEndPartialShapeTest, - ::testing::Combine(::testing::Values(BaseFEParam{ - PDPD, std::string(TEST_PDPD_MODELS)}), - ::testing::ValuesIn(std::vector{ - getTestShape_2in_2out(), - getTestShape_conv2d_relu(), - getTestShape_conv2d(), - getTestShape_conv2d_setDynamicBatch(), - getTestShape_2in_2out_dynbatch()})), - FrontEndPartialShapeTest::getTestCaseName); \ No newline at end of file + FrontEndPartialShapeTest, + ::testing::Combine(::testing::Values(BaseFEParam{ + PDPD, std::string(TEST_PDPD_MODELS)}), + ::testing::ValuesIn(std::vector{ + getTestShape_2in_2out(), + getTestShape_conv2d_relu(), + getTestShape_conv2d(), + getTestShape_conv2d_setDynamicBatch(), + getTestShape_2in_2out_dynbatch()})), + FrontEndPartialShapeTest::getTestCaseName); \ No newline at end of file diff --git a/ngraph/test/frontend/paddlepaddle/set_element_type.cpp b/ngraph/test/frontend/paddlepaddle/set_element_type.cpp index c14ce0c8b6f9c3..e53ea790ac869f 100644 --- a/ngraph/test/frontend/paddlepaddle/set_element_type.cpp +++ b/ngraph/test/frontend/paddlepaddle/set_element_type.cpp @@ -21,6 +21,6 @@ static SetTypeFEParam getTestData_relu() } INSTANTIATE_TEST_SUITE_P(PDPDCutTest, - FrontEndElementTypeTest, - ::testing::Values(getTestData_relu()), - FrontEndElementTypeTest::getTestCaseName); \ No newline at end of file + FrontEndElementTypeTest, + ::testing::Values(getTestData_relu()), + FrontEndElementTypeTest::getTestCaseName); \ No newline at end of file diff --git a/ngraph/test/frontend/shared/include/op_fuzzy.hpp b/ngraph/test/frontend/shared/include/op_fuzzy.hpp index 0d11df6c8b51b0..20ee6330292538 100644 --- a/ngraph/test/frontend/shared/include/op_fuzzy.hpp +++ b/ngraph/test/frontend/shared/include/op_fuzzy.hpp @@ -31,5 +31,6 @@ class FrontEndFuzzyOpTest : public ::testing::TestWithParam void doLoadFromFile(); - void runConvertedModel(const std::shared_ptr function, const std::string& model_file); + void runConvertedModel(const std::shared_ptr function, + const std::string& model_file); }; diff --git a/ngraph/test/frontend/shared/src/op_fuzzy.cpp b/ngraph/test/frontend/shared/src/op_fuzzy.cpp index 526207d25a66ce..d7fa7ca8784a81 100644 --- a/ngraph/test/frontend/shared/src/op_fuzzy.cpp +++ b/ngraph/test/frontend/shared/src/op_fuzzy.cpp @@ -4,10 +4,10 @@ #include +#include "op_fuzzy.hpp" #include "util/engine/test_engines.hpp" #include "util/test_case.hpp" #include "util/test_control.hpp" -#include "op_fuzzy.hpp" #include "utils.hpp" using namespace ngraph; diff --git a/thirdparty/cmake_static_protobuf/CMakeLists.txt b/thirdparty/cmake_static_protobuf/CMakeLists.txt deleted file mode 100644 index 121b20659ce816..00000000000000 --- a/thirdparty/cmake_static_protobuf/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (C) 2018-2021 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 -# - -cmake_minimum_required(VERSION 3.13) - -project(libprotobuf_static) - -message("Add PROTOBUF dependency - static") - -set(BUILD_SHARED_LIBS_OLD ${BUILD_SHARED_LIBS}) -set(BUILD_STANDALONE_STATIC_OLD ${BUILD_STANDALONE_STATIC}) -set(USE_STATIC_PROTOBUF_OLD ${USE_STATIC_PROTOBUF}) - -set(BUILD_SHARED_LIBS OFF) -set(BUILD_STANDALONE_STATIC ON) -set(USE_STATIC_PROTOBUF ON) - -add_subdirectory(../protobuf ${CMAKE_BINARY_DIR}/_deps/static-protobuf) - -set(BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS_OLD}) -set(BUILD_STANDALONE_STATIC ${BUILD_STANDALONE_STATIC_OLD}) -set(USE_STATIC_PROTOBUF ${USE_STATIC_PROTOBUF_OLD}) diff --git a/thirdparty/onnx/CMakeLists.txt b/thirdparty/onnx/CMakeLists.txt index 9c212d03a01d10..244b165f752b33 100644 --- a/thirdparty/onnx/CMakeLists.txt +++ b/thirdparty/onnx/CMakeLists.txt @@ -2,6 +2,8 @@ # SPDX-License-Identifier: Apache-2.0 # +set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF) + #------------------------------------------------------------------------------ # Configure and install libonnx ... #------------------------------------------------------------------------------ @@ -17,22 +19,9 @@ macro(onnx_set_target_properties) elseif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$") target_compile_options(onnx PRIVATE -Wno-all) target_compile_options(onnx_proto PRIVATE -Wno-all -Wno-unused-variable) - - # it fixes random problems with double registration of descriptors to protobuf database - set_target_properties(onnx_proto PROPERTIES - CXX_VISIBILITY_PRESET default - C_VISIBILITY_PRESET default - VISIBILITY_INLINES_HIDDEN OFF) endif() target_compile_definitions(onnx PUBLIC ONNX_BUILD_SHARED_LIBS) - - install(TARGETS onnx_proto - RUNTIME DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT ngraph - ARCHIVE DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT ngraph - LIBRARY DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT ngraph) - - export(TARGETS onnx onnx_proto NAMESPACE ngraph:: APPEND FILE "${NGRAPH_TARGETS_FILE}") endmacro() set(ONNX_USE_PROTOBUF_SHARED_LIBS ${BUILD_SHARED_LIBS} CACHE BOOL "Use dynamic protobuf by ONNX library") diff --git a/thirdparty/protobuf/CMakeLists.txt b/thirdparty/protobuf/CMakeLists.txt index 611e26d200bed0..0503e094b92498 100644 --- a/thirdparty/protobuf/CMakeLists.txt +++ b/thirdparty/protobuf/CMakeLists.txt @@ -3,7 +3,7 @@ # #------------------------------------------------------------------------------ -# Configure and install Google Protobuf ... +# Configure Google Protobuf ... #------------------------------------------------------------------------------ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF) @@ -13,7 +13,7 @@ if (MSVC) endif() if(CMAKE_CROSSCOMPILING) - find_program(SYSTEM_PROTOC protoc PATHS ENV PATH) + find_host_program(SYSTEM_PROTOC protoc PATHS ENV PATH) if(SYSTEM_PROTOC) execute_process( @@ -33,38 +33,14 @@ if(CMAKE_CROSSCOMPILING) set(protobuf_BUILD_PROTOC_BINARIES OFF CACHE BOOL "Build libprotoc and protoc compiler" FORCE) endif() -if (CMAKE_GENERATOR STREQUAL "Ninja") - set(MAKE_UTIL make) -else() - set(MAKE_UTIL $(MAKE)) -endif() - +set(protobuf_BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libs") set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build tests") set(protobuf_WITH_ZLIB OFF CACHE BOOL "Build with zlib support") -if (NOT BUILD_STANDALONE_STATIC) - add_subdirectory(protobuf/cmake EXCLUDE_FROM_ALL) - get_directory_property(protobuf_VERSION DIRECTORY protobuf/cmake DEFINITION protobuf_VERSION) -endif() -if (USE_STATIC_PROTOBUF) - include(FetchContent) - FetchContent_Declare( - ext_protobuf_static - URL ${CMAKE_CURRENT_SOURCE_DIR}/protobuf - ) - FetchContent_GetProperties(ext_protobuf_static) - if((NOT ext_protobuf_static_POPULATED) AND BUILD_STANDALONE_STATIC) - FetchContent_Populate(ext_protobuf_static) - add_subdirectory(${ext_protobuf_static_SOURCE_DIR}/cmake ${ext_protobuf_static_BINARY_DIR} EXCLUDE_FROM_ALL) - get_directory_property(protobuf_VERSION DIRECTORY ${ext_protobuf_static_SOURCE_DIR}/cmake DEFINITION protobuf_VERSION) - endif() -endif() +add_subdirectory(protobuf/cmake EXCLUDE_FROM_ALL) +get_directory_property(protobuf_VERSION DIRECTORY protobuf/cmake DEFINITION protobuf_VERSION) -if (BUILD_STANDALONE_STATIC) - set(Protobuf_INCLUDE_DIRS ${ext_protobuf_static_SOURCE_DIR}/src) -else() - set(Protobuf_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/protobuf/src) -endif() +set(Protobuf_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/protobuf/src) if(NGRAPH_USE_PROTOBUF_LITE) set(Protobuf_LIBRARIES libprotobuf-lite) @@ -75,18 +51,21 @@ endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$") set(_proto_libs ${Protobuf_LIBRARIES}) if(TARGET libprotoc) - list(APPEND _proto_libs libprotoc) - target_compile_options(libprotoc PRIVATE -Wno-all -Wno-unused-variable) + target_compile_options(libprotoc PRIVATE -Wno-all -Wno-unused-variable) + + # required for protoc compiler + set_target_properties(libprotoc PROPERTIES + CXX_VISIBILITY_PRESET default + C_VISIBILITY_PRESET default + VISIBILITY_INLINES_HIDDEN OFF) endif() - set_target_properties(${_proto_libs} PROPERTIES - CXX_VISIBILITY_PRESET default - C_VISIBILITY_PRESET default - VISIBILITY_INLINES_HIDDEN OFF) - foreach(target libprotobuf libprotobuf-lite) + foreach(target libprotobuf libprotobuf-lite) + if(TARGET ${target}) target_compile_options(${target} PRIVATE -Wno-all -Wno-unused-variable -Wno-inconsistent-missing-override PUBLIC -Wno-undef) - endforeach() + endif() + endforeach() endif() if(NGRAPH_USE_PROTOBUF_LITE) @@ -110,15 +89,6 @@ if(CMAKE_CROSSCOMPILING AND NOT PROTOC_VERSION VERSION_EQUAL protobuf_VERSION) message(WARNING "system protobuf version does not match with the compiled one, please update system protobuf or submodule") endif() -if (NOT BUILD_STANDALONE_STATIC) - message("NGRAPH_INSTALL_LIB = ${NGRAPH_INSTALL_LIB}") - install(TARGETS ${Protobuf_LIBRARIES} - RUNTIME DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT ngraph - ARCHIVE DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT ngraph - LIBRARY DESTINATION ${NGRAPH_INSTALL_LIB} COMPONENT ngraph) - export(TARGETS ${Protobuf_LIBRARIES} NAMESPACE ngraph:: APPEND FILE "${NGRAPH_TARGETS_FILE}") -endif() - # forward variables used in the other places set(SYSTEM_PROTOC ${SYSTEM_PROTOC} PARENT_SCOPE) set(Protobuf_LIBRARIES ${Protobuf_LIBRARIES} PARENT_SCOPE)