Conda-forge fixes (#13392)
This commit is contained in:
@@ -176,7 +176,7 @@ ov_set_if_not_defined(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FO
|
||||
ov_set_if_not_defined(CMAKE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
ov_set_if_not_defined(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
|
||||
|
||||
if(CPACK_GENERATOR STREQUAL "DEB")
|
||||
if(CPACK_GENERATOR MATCHES "^(DEB|RPM)$")
|
||||
# to make sure that lib/<multiarch-tuple> is created on Debian
|
||||
set(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "Cmake install prefix" FORCE)
|
||||
endif()
|
||||
|
||||
@@ -7,13 +7,13 @@ if(ENABLE_CLANG_FORMAT)
|
||||
find_host_program(CLANG_FORMAT NAMES ${CLANG_FORMAT_FILENAME} PATHS ENV PATH)
|
||||
if(CLANG_FORMAT)
|
||||
execute_process(COMMAND ${CLANG_FORMAT} ${CMAKE_CURRENT_SOURCE_DIR} ARGS --version OUTPUT_VARIABLE CLANG_VERSION)
|
||||
if(NOT CLANG_VERSION OR CLANG_VERSION STREQUAL "")
|
||||
if(NOT CLANG_VERSION)
|
||||
message(WARNING "Supported clang-format version is 9!")
|
||||
set(ENABLE_CLANG_FORMAT OFF)
|
||||
else()
|
||||
string(REGEX REPLACE "[^0-9]+([0-9]+)\\..*" "\\1" CLANG_FORMAT_MAJOR_VERSION ${CLANG_VERSION})
|
||||
if(NOT ${CLANG_FORMAT_MAJOR_VERSION} EQUAL "9")
|
||||
message(WARNING "Supported clang-format version is 9!")
|
||||
if(NOT CLANG_FORMAT_MAJOR_VERSION EQUAL 9)
|
||||
message(WARNING "Supported clang-format version is 9! Provided version ${CLANG_FORMAT_MAJOR_VERSION}")
|
||||
set(ENABLE_CLANG_FORMAT OFF)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -47,8 +47,6 @@ ie_dependent_option (ENABLE_AVX2 "Enable AVX2 optimizations" ON "X86_64 OR X86"
|
||||
|
||||
ie_dependent_option (ENABLE_AVX512F "Enable AVX512 optimizations" ON "X86_64 OR X86" OFF)
|
||||
|
||||
# Type of build, we add this as an explicit option to default it to ON
|
||||
# FIXME: Ah this moment setting this to OFF will only build ngraph a static library
|
||||
ie_option (BUILD_SHARED_LIBS "Build as a shared library" ON)
|
||||
|
||||
# Android does not support SOVERSION
|
||||
|
||||
71
cmake/developer_package/packaging/common-libraries.cmake
Normal file
71
cmake/developer_package/packaging/common-libraries.cmake
Normal file
@@ -0,0 +1,71 @@
|
||||
# Copyright (C) 2018-2022 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
#
|
||||
# ov_common_libraries_cpack_set_dirs()
|
||||
#
|
||||
# Set directories for cpack
|
||||
#
|
||||
macro(ov_common_libraries_cpack_set_dirs)
|
||||
# override default locations for common libraries
|
||||
set(OV_CPACK_TOOLSDIR ${CMAKE_INSTALL_BINDIR}) # only C++ tools are here
|
||||
set(OV_CPACK_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
set(OV_CPACK_LIBRARYDIR ${CMAKE_INSTALL_LIBDIR})
|
||||
set(OV_CPACK_RUNTIMEDIR ${CMAKE_INSTALL_LIBDIR})
|
||||
set(OV_WHEEL_RUNTIMEDIR ${OV_CPACK_RUNTIMEDIR})
|
||||
set(OV_CPACK_ARCHIVEDIR ${CMAKE_INSTALL_LIBDIR})
|
||||
set(OV_CPACK_PLUGINSDIR ${CMAKE_INSTALL_LIBDIR})
|
||||
set(OV_CPACK_IE_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/inferenceengine${OpenVINO_VERSION})
|
||||
set(OV_CPACK_NGRAPH_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/ngraph${OpenVINO_VERSION})
|
||||
set(OV_CPACK_OPENVINO_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/openvino${OpenVINO_VERSION})
|
||||
set(OV_CPACK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc/openvino-${OpenVINO_VERSION})
|
||||
|
||||
ov_get_pyversion(pyversion)
|
||||
if(pyversion)
|
||||
set(OV_CPACK_PYTHONDIR ${CMAKE_INSTALL_LIBDIR}/${pyversion}/site-packages)
|
||||
endif()
|
||||
|
||||
# non-native stuff
|
||||
set(OV_CPACK_SHAREDIR ${CMAKE_INSTALL_DATADIR}/openvino) # internal
|
||||
set(OV_CPACK_SAMPLESDIR ${OV_CPACK_SHAREDIR}/samples)
|
||||
set(OV_CPACK_DEVREQDIR ${OV_CPACK_SHAREDIR})
|
||||
unset(OV_CPACK_SHAREDIR)
|
||||
|
||||
# skipped during common libraries packaging
|
||||
set(OV_CPACK_WHEELSDIR "tools")
|
||||
|
||||
# for BW compatibility
|
||||
set(IE_CPACK_LIBRARY_PATH ${OV_CPACK_LIBRARYDIR})
|
||||
set(IE_CPACK_RUNTIME_PATH ${OV_CPACK_RUNTIMEDIR})
|
||||
set(IE_CPACK_ARCHIVE_PATH ${OV_CPACK_ARCHIVEDIR})
|
||||
endmacro()
|
||||
|
||||
ov_common_libraries_cpack_set_dirs()
|
||||
|
||||
#
|
||||
# Override CPack components name for common libraries generator
|
||||
# This is needed to change the granularity, i.e. merge several components
|
||||
# into a single one
|
||||
#
|
||||
|
||||
macro(ov_override_component_names)
|
||||
# merge C++ and C runtimes
|
||||
set(OV_CPACK_COMP_CORE_C "${OV_CPACK_COMP_CORE}")
|
||||
set(OV_CPACK_COMP_CORE_C_DEV "${OV_CPACK_COMP_CORE_DEV}")
|
||||
# merge all pythons into a single component
|
||||
set(OV_CPACK_COMP_PYTHON_OPENVINO "pyopenvino")
|
||||
set(OV_CPACK_COMP_PYTHON_IE_API "${OV_CPACK_COMP_PYTHON_OPENVINO}")
|
||||
set(OV_CPACK_COMP_PYTHON_NGRAPH "${OV_CPACK_COMP_PYTHON_OPENVINO}")
|
||||
# merge all C / C++ samples as a single samples component
|
||||
set(OV_CPACK_COMP_CPP_SAMPLES "samples")
|
||||
set(OV_CPACK_COMP_C_SAMPLES "${OV_CPACK_COMP_CPP_SAMPLES}")
|
||||
# move requirements.txt to core-dev
|
||||
set(OV_CPACK_COMP_DEV_REQ_FILES "${OV_CPACK_COMP_CORE_DEV}")
|
||||
# move core_tools to core-dev
|
||||
set(OV_CPACK_COMP_CORE_TOOLS "${OV_CPACK_COMP_CORE_DEV}")
|
||||
endmacro()
|
||||
|
||||
ov_override_component_names()
|
||||
@@ -23,8 +23,12 @@ macro(ov_debian_cpack_set_dirs)
|
||||
set(OV_CPACK_OPENVINO_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/openvino${OpenVINO_VERSION})
|
||||
set(OV_CPACK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc/openvino-${OpenVINO_VERSION})
|
||||
|
||||
ov_get_pyversion(pyversion)
|
||||
if(pyversion)
|
||||
set(OV_CPACK_PYTHONDIR ${CMAKE_INSTALL_LIBDIR}/${pyversion}/site-packages)
|
||||
endif()
|
||||
|
||||
# non-native stuff
|
||||
set(OV_CPACK_PYTHONDIR ${OV_CPACK_PLUGINSDIR})
|
||||
set(OV_CPACK_SHAREDIR ${CMAKE_INSTALL_DATADIR}/openvino) # internal
|
||||
set(OV_CPACK_SAMPLESDIR ${OV_CPACK_SHAREDIR}/samples)
|
||||
set(OV_CPACK_DEVREQDIR ${OV_CPACK_SHAREDIR})
|
||||
|
||||
@@ -4,6 +4,18 @@
|
||||
|
||||
include(CPackComponent)
|
||||
|
||||
#
|
||||
# ov_get_pyversion()
|
||||
#
|
||||
function(ov_get_pyversion pyversion)
|
||||
find_package(PythonInterp 3 QUIET)
|
||||
if(PYTHONINTERP_FOUND)
|
||||
set(${pyversion} "python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" PARENT_SCOPE)
|
||||
else()
|
||||
set(${pyversion} "NOT-FOUND" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
#
|
||||
# ov_cpack_set_dirs()
|
||||
#
|
||||
@@ -18,11 +30,15 @@ macro(ov_cpack_set_dirs)
|
||||
set(OV_CPACK_OPENVINO_CMAKEDIR runtime/cmake)
|
||||
set(OV_CPACK_DOCDIR docs)
|
||||
set(OV_CPACK_SAMPLESDIR samples)
|
||||
set(OV_CPACK_PYTHONDIR python)
|
||||
set(OV_CPACK_WHEELSDIR tools)
|
||||
set(OV_CPACK_TOOLSDIR tools)
|
||||
set(OV_CPACK_DEVREQDIR tools)
|
||||
|
||||
ov_get_pyversion(pyversion)
|
||||
if(pyversion)
|
||||
set(OV_CPACK_PYTHONDIR python/${pyversion})
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(OV_CPACK_LIBRARYDIR runtime/lib/${ARCH_FOLDER}/$<CONFIG>)
|
||||
set(OV_CPACK_RUNTIMEDIR runtime/bin/${ARCH_FOLDER}/$<CONFIG>)
|
||||
@@ -118,14 +134,12 @@ ov_define_component_names()
|
||||
# - ov_add_latest_component()
|
||||
if(CPACK_GENERATOR STREQUAL "DEB")
|
||||
include(packaging/debian)
|
||||
endif()
|
||||
|
||||
if(CPACK_GENERATOR STREQUAL "RPM")
|
||||
elseif(CPACK_GENERATOR STREQUAL "RPM")
|
||||
include(packaging/rpm)
|
||||
endif()
|
||||
|
||||
if(CPACK_GENERATOR STREQUAL "NSIS")
|
||||
elseif(CPACK_GENERATOR STREQUAL "NSIS")
|
||||
include(packaging/nsis)
|
||||
elseif(CPACK_GENERATOR MATCHES "^(CONDA-FORGE|BREW)$")
|
||||
include(packaging/common-libraries)
|
||||
endif()
|
||||
|
||||
macro(ie_cpack)
|
||||
@@ -180,14 +194,6 @@ macro(ie_cpack)
|
||||
set(CPACK_SYSTEM_NAME "${OS_FOLDER}")
|
||||
endif()
|
||||
|
||||
# generator specific variables
|
||||
if(CPACK_GENERATOR MATCHES "^(7Z|TBZ2|TGZ|TXZ|TZ|ZIP)$")
|
||||
# New in version 3.18
|
||||
set(CPACK_ARCHIVE_THREADS 8)
|
||||
# multiple packages are generated
|
||||
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
|
||||
endif()
|
||||
|
||||
# include GENERATOR dedicated per-component configuration file
|
||||
# NOTE: private modules need to define ov_cpack_settings macro
|
||||
# for custom packages configuration
|
||||
@@ -195,5 +201,13 @@ macro(ie_cpack)
|
||||
ov_cpack_settings()
|
||||
endif()
|
||||
|
||||
# generator specific variables
|
||||
if(CPACK_GENERATOR MATCHES "^(7Z|TBZ2|TGZ|TXZ|TZ|ZIP)$")
|
||||
# New in version 3.18
|
||||
set(CPACK_ARCHIVE_THREADS 8)
|
||||
# multiple packages are generated
|
||||
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
|
||||
endif()
|
||||
|
||||
include(CPack)
|
||||
endmacro()
|
||||
|
||||
@@ -23,8 +23,12 @@ macro(ov_rpm_cpack_set_dirs)
|
||||
set(OV_CPACK_OPENVINO_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/openvino${OpenVINO_VERSION})
|
||||
set(OV_CPACK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc/openvino-${OpenVINO_VERSION})
|
||||
|
||||
ov_get_pyversion(pyversion)
|
||||
if(pyversion)
|
||||
set(OV_CPACK_PYTHONDIR ${CMAKE_INSTALL_LIBDIR}/${pyversion}/site-packages)
|
||||
endif()
|
||||
|
||||
# non-native stuff
|
||||
set(OV_CPACK_PYTHONDIR ${OV_CPACK_PLUGINSDIR})
|
||||
set(OV_CPACK_SHAREDIR ${CMAKE_INSTALL_DATADIR}/openvino-${OpenVINO_VERSION}) # internal
|
||||
set(OV_CPACK_SAMPLESDIR ${OV_CPACK_SHAREDIR}/samples)
|
||||
set(OV_CPACK_DEVREQDIR ${OV_CPACK_SHAREDIR})
|
||||
|
||||
@@ -175,7 +175,7 @@ ie_dependent_option(ENABLE_SYSTEM_PROTOBUF "Use system protobuf" OFF
|
||||
|
||||
ie_dependent_option(ENABLE_OV_CORE_UNIT_TESTS "Enables OpenVINO core unit tests" ON "ENABLE_TESTS" OFF)
|
||||
ie_option(ENABLE_OPENVINO_DEBUG "Enable output for OPENVINO_DEBUG statements" OFF)
|
||||
ie_option(ENABLE_REQUIREMENTS_INSTALL "Dynamic dependencies install" ON)
|
||||
ie_dependent_option(ENABLE_REQUIREMENTS_INSTALL "Dynamic dependencies install" ON "ENABLE_TESTS" OFF)
|
||||
|
||||
if(NOT BUILD_SHARED_LIBS AND ENABLE_OV_TF_FRONTEND)
|
||||
set(FORCE_FRONTENDS_USE_PROTOBUF ON)
|
||||
|
||||
40
cmake/packaging/common-libraries.cmake
Normal file
40
cmake/packaging/common-libraries.cmake
Normal file
@@ -0,0 +1,40 @@
|
||||
# Copyright (C) 2018-2022 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
#
|
||||
# OpenVINO Core components including frontends, plugins, etc
|
||||
#
|
||||
macro(ov_cpack_settings)
|
||||
# fill a list of components which are part of conda
|
||||
set(cpack_components_all ${CPACK_COMPONENTS_ALL})
|
||||
unset(CPACK_COMPONENTS_ALL)
|
||||
foreach(item IN LISTS cpack_components_all)
|
||||
# filter out some components, which are not needed to be wrapped to conda-forge
|
||||
if(# python wheels are not needed to be wrapped by conda | brew packages
|
||||
NOT item STREQUAL OV_CPACK_COMP_PYTHON_WHEELS AND
|
||||
# skip C / C++ / Python samples
|
||||
NOT item STREQUAL OV_CPACK_COMP_CPP_SAMPLES AND
|
||||
NOT item STREQUAL OV_CPACK_COMP_C_SAMPLES AND
|
||||
NOT item STREQUAL OV_CPACK_COMP_PYTHON_SAMPLES AND
|
||||
# even for case of system TBB we have installation rules for wheels packages
|
||||
# so, need to skip this explicitly since they are installed in `host` section
|
||||
NOT item MATCHES "^tbb(_dev)?$" AND
|
||||
# the same for pugixml
|
||||
NOT item STREQUAL "pugixml" AND
|
||||
# TF component is not released
|
||||
NOT item STREQUAL "tensorflow" AND
|
||||
# we have `license_file` field in conda meta.yml
|
||||
NOT item STREQUAL OV_CPACK_COMP_LICENSING AND
|
||||
# not appropriate components
|
||||
NOT item STREQUAL OV_CPACK_COMP_DEPLOYMENT_MANAGER AND
|
||||
NOT item STREQUAL OV_CPACK_COMP_INSTALL_DEPENDENCIES AND
|
||||
NOT item STREQUAL OV_CPACK_COMP_SETUPVARS)
|
||||
list(APPEND CPACK_COMPONENTS_ALL ${item})
|
||||
endif()
|
||||
endforeach()
|
||||
list(REMOVE_DUPLICATES CPACK_COMPONENTS_ALL)
|
||||
|
||||
# override generator
|
||||
set(CPACK_GENERATOR "TGZ")
|
||||
endmacro()
|
||||
@@ -3,9 +3,11 @@
|
||||
#
|
||||
|
||||
if(CPACK_GENERATOR STREQUAL "DEB")
|
||||
include(cmake/packaging/debian.cmake)
|
||||
include(cmake/packaging/debian.cmake)
|
||||
elseif(CPACK_GENERATOR STREQUAL "RPM")
|
||||
include(cmake/packaging/rpm.cmake)
|
||||
include(cmake/packaging/rpm.cmake)
|
||||
elseif(CPACK_GENERATOR MATCHES "^(CONDA-FORGE|BREW)$")
|
||||
include(cmake/packaging/common-libraries.cmake)
|
||||
elseif(CPACK_GENERATOR STREQUAL "NSIS")
|
||||
include(cmake/packaging/nsis.cmake)
|
||||
include(cmake/packaging/nsis.cmake)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user