Added frontends RPMs generation (#13618)

* cmake/packaging/rpm.cmake: Added Frontends

* rpm_post_build: Added link to Fedoraproject wiki with rpmlint errors info

* RPM: Throw warning for rpmlint findings instead of FATAL ERROR till there is no filtering/suppression of errors

debian.cmake: Added one more error to suppress
thirdparty/CMakeLists.txt: added CentOS(RHEL) for gflags shared libs case
install_openvino_dependencies: Added gflags installation

* Fixed gflags issues for RHEL/CentOS

Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
This commit is contained in:
Artyom Anokhov 2022-10-27 08:08:54 +02:00 committed by GitHub
parent 728c9631b7
commit 65293b1492
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 92 additions and 18 deletions

View File

@ -251,7 +251,7 @@ macro(ov_rpm_add_latest_component comp)
ov_rpm_add_rpmlint_suppression(${comp_name}
# it's umbrella package
"empty-binary-package")
"no-binary")
# add latest to a list of rpm packages
list(APPEND CPACK_COMPONENTS_ALL ${comp_name})

View File

@ -37,5 +37,6 @@ foreach(rpm_file IN LISTS CPACK_PACKAGE_FILES)
endforeach()
if(NOT rpmlint_passed)
message(FATAL_ERROR "rpmlint has found some mistakes")
# till there is no filtering/suppression for rpmlint errors - throw warning instead fatal error
message(WARNING "rpmlint has found some mistakes. You can get more info regarding issues on site https://fedoraproject.org/wiki/Common_Rpmlint_issues")
endif()

View File

@ -343,7 +343,9 @@ macro(ov_cpack_settings)
ov_debian_generate_conflicts(openvino ${conflicting_versions})
ov_debian_add_lintian_suppression(openvino
# it's umbrella package
"empty-binary-package")
"empty-binary-package"
# reproduced only on ubu18
"description-starts-with-package-name")
list(APPEND CPACK_COMPONENTS_ALL "libraries;libraries_dev;openvino")

View File

@ -39,6 +39,9 @@ function(_ov_add_plugin comp is_pseudo)
set(installed_plugins "${installed_plugins}" PARENT_SCOPE)
endfunction()
macro(ov_cpack_settings)
# fill a list of components which are part of rpm
set(cpack_components_all ${CPACK_COMPONENTS_ALL})
@ -85,7 +88,74 @@ macro(ov_cpack_settings)
# - 2022.1.0 is the last public release with rpm packages from Intel install team
# - 2022.1.1 does not have rpm packages enabled, distributed only as archives
2022.1.0)
#
# Frontends
#
if(ENABLE_OV_IR_FRONTEND)
set(CPACK_COMPONENT_IR_DESCRIPTION "OpenVINO IR Frontend")
set(CPACK_COMPONENT_IR_DEPENDS "${OV_CPACK_COMP_CORE}")
set(CPACK_RPM_IR_PACKAGE_NAME "libopenvino-ir-frontend-${cpack_name_ver}")
set(CPACK_RPM_IR_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
ov_rpm_add_rpmlint_suppression(ir
# we have different package name strategy; it suggests libopenvino-ir-frontend202230
"package-name-doesnt-match-sonames"
# IR FE should not linked directly by end users
"package-must-activate-ldconfig-trigger")
list(APPEND frontends ir)
endif()
if(ENABLE_OV_ONNX_FRONTEND)
set(CPACK_COMPONENT_ONNX_DESCRIPTION "OpenVINO ONNX Frontend")
set(CPACK_COMPONENT_ONNX_DEPENDS "${OV_CPACK_COMP_CORE}")
set(CPACK_RPM_ONNX_PACKAGE_NAME "libopenvino-onnx-frontend-${cpack_name_ver}")
# since we ONNX FE is linkable target, we need to call ldconfig (i.e. `def_triggers`)
set(CPACK_RPM_ONNX_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm};${def_triggers}")
ov_rpm_add_rpmlint_suppression(onnx
# we have different package name strategy; it suggests libopenvino-onnx-frontend202230
"package-name-doesnt-match-sonames")
list(APPEND frontends onnx)
endif()
if(ENABLE_OV_TF_FRONTEND AND "tensorflow" IN_LIST CPACK_COMPONENTS_ALL)
set(CPACK_COMPONENT_TENSORFLOW_DESCRIPTION "OpenVINO TensorFlow Frontend")
set(CPACK_COMPONENT_TENSORFLOW_DEPENDS "${OV_CPACK_COMP_CORE}")
set(CPACK_RPM_TENSORFLOW_PACKAGE_NAME "libopenvino-tensorflow-frontend-${cpack_name_ver}")
# since we TF FE is linkable target, we need to call ldconfig (i.e. `def_triggers`)
set(CPACK_RPM_TENSORFLOW_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm};${def_triggers}")
ov_rpm_add_rpmlint_suppression(tensorflow
# we have different package name strategy; it suggests libopenvino-tensorflow-frontend202230
"package-name-doesnt-match-sonames")
list(APPEND frontends tensorflow)
endif()
if(ENABLE_OV_PADDLE_FRONTEND)
set(CPACK_COMPONENT_PADDLE_DESCRIPTION "OpenVINO Paddle Frontend")
set(CPACK_COMPONENT_PADDLE_DEPENDS "${OV_CPACK_COMP_CORE}")
set(CPACK_RPM_PADDLE_PACKAGE_NAME "libopenvino-paddle-frontend-${cpack_name_ver}")
# since we PADDLE FE is linkable target, we need to call ldconfig (i.e. `def_triggers`)
set(CPACK_RPM_PADDLE_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm};${def_triggers}")
ov_rpm_add_rpmlint_suppression(paddle
# we have different package name strategy; it suggests libopenvino-paddle-frontend202230
"package-name-doesnt-match-sonames")
list(APPEND frontends paddle)
endif()
#
# core_dev: depends on core and frontends (since frontends don't want to provide its own dev packages)
#
set(CPACK_COMPONENT_CORE_DEV_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit C / C++ Development files")
set(CPACK_COMPONENT_CORE_DEV_DEPENDS "${OV_CPACK_COMP_CORE};${frontends}")
set(CPACK_RPM_CORE_DEV_PACKAGE_NAME "libopenvino-devel-${cpack_name_ver}")
ov_rpm_generate_conflicts("${OV_CPACK_COMP_CORE_DEV}" ${conflicting_versions})
ov_rpm_add_rpmlint_suppression("${OV_CPACK_COMP_CORE_DEV}"
# CVS-79409: create man page for compile_tool
"binary-without-manpage")
# core
set(CPACK_COMPONENT_CORE_DESCRIPTION "OpenVINO C / C++ Runtime libraries")
set(CPACK_RPM_CORE_PACKAGE_NAME "libopenvino-${cpack_name_ver}")
@ -99,15 +169,6 @@ macro(ov_cpack_settings)
"shlib-without-versioned-soname"
"package-name-doesnt-match-sonames")
# core_dev
set(CPACK_COMPONENT_CORE_DEV_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit C / C++ Development files")
set(CPACK_COMPONENT_CORE_DEV_DEPENDS "core")
set(CPACK_RPM_CORE_DEV_PACKAGE_NAME "libopenvino-dev-${cpack_name_ver}")
ov_rpm_generate_conflicts(core_dev ${conflicting_versions})
ov_rpm_add_rpmlint_suppression(core_dev
# CVS-79409: create man page for compile_tool
"binary-without-manpage")
#
# Plugins
@ -258,16 +319,16 @@ macro(ov_cpack_settings)
ov_rpm_add_rpmlint_suppression(libraries
# it's umbrella package
"empty-binary-package")
"no-binary")
# all libraries-dev
set(CPACK_COMPONENT_LIBRARIES_DEV_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Libraries and Development files")
set(CPACK_COMPONENT_LIBRARIES_DEV_DEPENDS "core_dev;libraries")
set(CPACK_RPM_LIBRARIES_DEV_PACKAGE_NAME "openvino-libraries-dev-${cpack_name_ver}")
set(CPACK_RPM_LIBRARIES_DEV_PACKAGE_NAME "openvino-libraries-devel-${cpack_name_ver}")
ov_rpm_generate_conflicts(libraries_dev ${conflicting_versions})
ov_rpm_add_rpmlint_suppression(libraries_dev
# it's umbrella package
"empty-binary-package")
"no-binary")
# all openvino
set(CPACK_COMPONENT_OPENVINO_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Libraries and Development files")
@ -276,7 +337,7 @@ macro(ov_cpack_settings)
ov_rpm_generate_conflicts(openvino ${conflicting_versions})
ov_rpm_add_rpmlint_suppression(openvino
# it's umbrella package
"empty-binary-package")
"no-binary")
list(APPEND CPACK_COMPONENTS_ALL "libraries;libraries_dev;openvino")

View File

@ -110,6 +110,9 @@ if(NOT TARGET gflags)
if(TARGET gflags_nothreads-static)
# arm cross-compilation
set(GFLAGS_TARGET gflags_nothreads-static)
elseif(TARGET gflags_nothreads-shared)
# centos/rhel8
set(GFLAGS_TARGET gflags_nothreads-shared)
else()
message(FATAL_ERROR "Failed to set GFLAGS_TARGET target")
endif()

View File

@ -154,7 +154,10 @@ elif [ "$os" == "rhel8" ] ; then
pkgs_core=(libtbb2 libpugixml1v5)
pkgs_opencv_req=(gtk3)
pkgs_python=(python38 python38-pip)
pkgs_dev=(gcc gcc-c++ make glibc libstdc++ libgcc cmake pkg-config zlib-devel.i686 curl sudo)
pkgs_dev=(
gcc gcc-c++ make glibc libstdc++ libgcc cmake pkg-config zlib-devel.i686 curl sudo
https://vault.centos.org/centos/8/PowerTools/x86_64/os/Packages/gflags-2.1.2-6.el8.x86_64.rpm
)
pkgs_myriad=()
pkgs_opencv_opt=(
https://vault.centos.org/centos/8/AppStream/x86_64/os/Packages/libcdio-2.0.0-3.el8.x86_64.rpm

View File

@ -185,7 +185,7 @@ if(NOT APPLE OR CPACK_GENERATOR MATCHES "^(BREW|CONDA-FORGE)$")
# - on Apple only dynamic libraries are available
# also, we can easily mix arm64 and x86_64 binaries when cross-compile for Intel CPU
if(CPACK_GENERATOR MATCHES "^(BREW|CONDA-FORGE)$" OR DEFINED ENV{HOMEBREW_PREFIX} OR LINUX_OS_NAME MATCHES "(Fedora)")
if(CPACK_GENERATOR MATCHES "^(BREW|CONDA-FORGE)$" OR DEFINED ENV{HOMEBREW_PREFIX} OR LINUX_OS_NAME MATCHES "(Fedora|CentOS)")
# conda-forge and brew contains only shared version of gflags
find_package(gflags QUIET COMPONENTS nothreads_shared)
else()
@ -196,6 +196,10 @@ endif()
if(gflags_FOUND)
if(TARGET gflags)
set_target_properties(gflags PROPERTIES IMPORTED_GLOBAL ON)
elseif(TARGET gflags_nothreads-shared)
# gflags shared case for CentOS/RHEL8
set_target_properties(gflags_nothreads-shared PROPERTIES IMPORTED_GLOBAL ON)
add_library(gflags ALIAS gflags_nothreads-shared)
elseif(TARGET gflags_nothreads-static)
# debian_9_arm case
set_target_properties(gflags_nothreads-static PROPERTIES IMPORTED_GLOBAL ON)