diff --git a/CMakeLists.txt b/CMakeLists.txt index b796977515b..6019fe63d93 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,12 +63,6 @@ function(build_ngraph) ngraph_set(NGRAPH_PDPD_FRONTEND_ENABLE OFF) endif() - if(ENABLE_PYTHON) - ngraph_set(NGRAPH_PYTHON_BUILD_ENABLE ON) - else() - ngraph_set(NGRAPH_PYTHON_BUILD_ENABLE OFF) - endif() - if(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$") ie_add_compiler_flags(-Wno-error=uninitialized -Wno-error=literal-conversion) elseif(UNIX) diff --git a/inference-engine/ie_bridges/python/CMakeLists.txt b/inference-engine/ie_bridges/python/CMakeLists.txt index 89cdb5cc17f..7b93a4291a2 100644 --- a/inference-engine/ie_bridges/python/CMakeLists.txt +++ b/inference-engine/ie_bridges/python/CMakeLists.txt @@ -68,7 +68,7 @@ if(ENABLE_WHEEL) add_subdirectory(wheel) endif() -if (NGRAPH_PYTHON_BUILD_ENABLE) +if(TARGET _pyngraph) add_dependencies(ie_api _pyngraph) endif() diff --git a/inference-engine/ie_bridges/python/README.md b/inference-engine/ie_bridges/python/README.md index 0b50a0e2a6a..b40a6ded9b0 100644 --- a/inference-engine/ie_bridges/python/README.md +++ b/inference-engine/ie_bridges/python/README.md @@ -61,11 +61,6 @@ sudo apt install patchelf -DENABLE_PYTHON=ON -DENABLE_WHEEL=ON ``` -If you need to include other components to the package you need to enable them too. -For example, to include ngraph python API: -```shellscript --NGRAPH_PYTHON_BUILD_ENABLE=ON -``` ## Running sample diff --git a/model-optimizer/CMakeLists.txt b/model-optimizer/CMakeLists.txt index 60860d7a7aa..19056e1b60c 100644 --- a/model-optimizer/CMakeLists.txt +++ b/model-optimizer/CMakeLists.txt @@ -1,10 +1,8 @@ # Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 -if (NOT NGRAPH_PYTHON_BUILD_ENABLE) - message(WARNING "Please enable nGraph Python API (_pyngraph) target to enable Model Optimizer target") -elseif(NOT ENABLE_PYTHON) - message(WARNING "Please enable IE Python API (ie_api and offline_transformations_api) targets to enable Model Optimizer target") +if(NOT ENABLE_PYTHON) + message(WARNING "Please enable IE & nGraph Python API (ie_api and offline_transformations_api) targets to enable Model Optimizer target") else() add_custom_target(model_optimizer DEPENDS ie_api offline_transformations_api inference_engine_ir_reader) if(ENABLE_TESTS) diff --git a/ngraph/CMakeLists.txt b/ngraph/CMakeLists.txt index 27bba57bc37..20fe4a9af12 100644 --- a/ngraph/CMakeLists.txt +++ b/ngraph/CMakeLists.txt @@ -23,7 +23,6 @@ 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_PYTHON_BUILD_ENABLE "Enable build nGraph python package wheel" OFF) option(NGRAPH_USE_PROTOBUF_LITE "Compiles and links with protobuf-lite" OFF) if (NGRAPH_ONNX_IMPORT_ENABLE OR NGRAPH_PDPD_FRONTEND_ENABLE) @@ -37,7 +36,6 @@ 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_PYTHON_BUILD_ENABLE: ${NGRAPH_PYTHON_BUILD_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}") @@ -202,6 +200,6 @@ add_subdirectory(frontend) add_subdirectory(test) -if (NGRAPH_PYTHON_BUILD_ENABLE) +if (ENABLE_PYTHON) add_subdirectory(python) endif() diff --git a/ngraph/python/BUILDING.md b/ngraph/python/BUILDING.md index 5d4d9c72892..18e395fc9d8 100644 --- a/ngraph/python/BUILDING.md +++ b/ngraph/python/BUILDING.md @@ -48,7 +48,6 @@ set the mentioned flags to `ON`. Note the `CMAKE_INSTALL_PREFIX`, which defaults -DENABLE_OPENCV=OFF \ -DENABLE_VPU=OFF \ -DENABLE_PYTHON=ON \ - -DNGRAPH_PYTHON_BUILD_ENABLE=ON \ -DNGRAPH_ONNX_IMPORT_ENABLE=ON \ -DCMAKE_INSTALL_PREFIX="${OPENVINO_BASEDIR}/openvino_dist" @@ -111,7 +110,6 @@ cmake .. ^ -DENABLE_CLDNN=OFF ^ -DENABLE_OPENCV=OFF ^ -DENABLE_VPU=OFF ^ - -DNGRAPH_PYTHON_BUILD_ENABLE=ON ^ -DNGRAPH_ONNX_IMPORT_ENABLE=ON ^ -DENABLE_PYTHON=ON ^ -DCMAKE_CXX_COMPILER="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110\bin\Hostx64\x64" diff --git a/ngraph/python/setup.py b/ngraph/python/setup.py index e90cc66d6d1..059ccd81acb 100644 --- a/ngraph/python/setup.py +++ b/ngraph/python/setup.py @@ -155,7 +155,7 @@ class BuildCMakeExt(build_ext): ext_args = self.cmake_args.split() if self.cmake_args else [] self.spawn(["cmake", "-H" + root_dir, "-B" + self.build_temp, "-DCMAKE_BUILD_TYPE={}".format(self.config), - "-DNGRAPH_PYTHON_BUILD_ENABLE=ON", + "-DENABLE_PYTHON=ON", "-DNGRAPH_ONNX_IMPORT_ENABLE=ON"] + ext_args) self.announce("Building binaries", level=3)