Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions recipes/opencv/4.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1045,11 +1045,11 @@ def requirements(self):
# dnn module dependencies
if self.options.get_safe("with_protobuf"):
# Symbols are exposed https://github.com/conan-io/conan-center-index/pull/16678#issuecomment-1507811867
self.requires("protobuf/3.21.12", transitive_libs=True)
self.requires("protobuf/[>=3.21.12 <7]", transitive_libs=True)
if self.options.get_safe("with_vulkan"):
self.requires("vulkan-headers/1.3.268.0")
if self.options.get_safe("with_openvino"):
self.requires("openvino/[>=2024.5.0 <=2025.0.0]")
self.requires("openvino/[>=2024.5.0 <=2025.4.0]")
# gapi module dependencies
if self.options.gapi:
self.requires("ade/0.1.2d")
Expand Down
35 changes: 0 additions & 35 deletions recipes/openvino/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,3 @@ sources:
"onednn_gpu":
url: "https://github.com/oneapi-src/oneDNN/archive/29d64fe0ec0f1f20d7f80aa76630d58a6011a869.tar.gz"
sha256: "90139a1193b9773f94ff3310cd6118d3b6ccf1adb24461c84aa87890caa5ee77"
"2024.6.0":
"openvino":
url: "https://github.com/openvinotoolkit/openvino/archive/refs/tags/2024.6.0.tar.gz"
sha256: "93f417409f3bf12445cb0d72b2af13d849d2b5125d5330d832f1bae55283e5b7"
"arm_compute":
url: "https://github.com/ARM-software/ComputeLibrary/archive/refs/tags/v24.09.tar.gz"
sha256: "49b8620f21cbbe49e825a131d9eacd548532646289b50e070b83860bd88087fe"
"onednn_cpu":
url: "https://github.com/openvinotoolkit/oneDNN/archive/c60a9946aa2386890e5c9f5587974facb7624227.tar.gz"
sha256: "37cea8af9772053fd6d178817f64d59e3aa7de9fd8f1aa21873075bb0664240f"
"mlas":
url: "https://github.com/openvinotoolkit/mlas/archive/d1bc25ec4660cddd87804fcf03b2411b5dfb2e94.tar.gz"
sha256: "0a44fbfd4b13e8609d66ddac4b11a27c90c1074cde5244c91ad197901666004c"
"onednn_gpu":
url: "https://github.com/oneapi-src/oneDNN/archive/0f269193c7466313888d3338209d0d06a22cc6fa.tar.gz"
sha256: "abad1ff4ac138c593b7a927ef2099b01447af1f7364848392a950ba17b32bcd8"
"2023.3.0":
"openvino":
url: "https://github.com/openvinotoolkit/openvino/archive/refs/tags/2023.3.0.tar.gz"
sha256: "27cff20ac0662f5495d2c2eec47cbe5469ab2f225aa091d223f8bfc9d32f4fc3"
"arm_compute":
url: "https://github.com/ARM-software/ComputeLibrary/archive/refs/tags/v23.08.tar.gz"
sha256: "62f514a555409d4401e5250b290cdf8cf1676e4eb775e5bd61ea6a740a8ce24f"
"onednn_cpu":
url: "https://github.com/openvinotoolkit/oneDNN/archive/cb3060bbf4694e46a1359a3d4dfe70500818f72d.tar.gz"
sha256: "9dea3da8dab8511677db3db68ff4d9cdbfd31d8614bf04fd79a7610892bb991c"
"mlas":
url: "https://github.com/openvinotoolkit/mlas/archive/7a35e48a723944972088627be1a8b60841e8f6a5.tar.gz"
sha256: "b7fdd19523a88373d19fd8d5380f64c2834040fa50a6f0774acf08f3fa858daa"
"onednn_gpu":
url: "https://github.com/oneapi-src/oneDNN/archive/cb77937ffcf5e83b5d1cf2940c94e8b508d8f7b4.tar.gz"
sha256: "2ca304c033786aa5c3ec1ec6f8fc3936ae5c6874d5964b586311da11bec2ec4a"
patches:
"2025.2.0":
- patch_file: "patches/2025.2.0-dont-disable-macos-adhoc-codesign.patch"
104 changes: 19 additions & 85 deletions recipes/openvino/all/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
from conan import ConanFile
from conan.errors import ConanException, ConanInvalidConfiguration
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.scm import Version
from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout
from conan.tools.env import VirtualBuildEnv, VirtualRunEnv
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
import functools
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, rmdir
import os
import yaml

required_conan_version = ">=2.1"

Expand Down Expand Up @@ -65,24 +61,6 @@ class OpenvinoConan(ConanFile):
"enable_pytorch_frontend": True
}

@property
def _dependencies_filename(self):
return f"dependencies-{self.version}.yml"

@property
@functools.lru_cache(1)
def _dependencies_versions(self):
dependencies_filepath = os.path.join(self.recipe_folder, "dependencies", self._dependencies_filename)
if not os.path.isfile(dependencies_filepath):
raise ConanException(f"Cannot find {dependencies_filepath}")
cached_dependencies = yaml.safe_load(open(dependencies_filepath, encoding='UTF-8'))
return cached_dependencies

def _require(self, dependency):
if dependency not in self._dependencies_versions:
raise ConanException(f"{dependency} is missing in {self._dependencies_filename}")
return f"{dependency}/{self._dependencies_versions[dependency]}"

@property
def _protobuf_required(self):
return self.options.enable_tf_frontend or self.options.enable_onnx_frontend or self.options.enable_paddle_frontend
Expand All @@ -95,22 +73,14 @@ def _target_arm(self):
def _target_x86_64(self):
return self.settings.arch == "x86_64"

@property
def _gna_option_available(self):
return self.settings.os in ["Linux", "Windows"] and self._target_x86_64 and Version(self.version) < "2024.0.0"

@property
def _npu_option_available(self):
return self.settings.os in ["Linux", "Windows"] and self._target_x86_64 and Version(self.version) >= "2024.1.0"
return self.settings.os in ["Linux", "Windows"] and self._target_x86_64

@property
def _gpu_option_available(self):
return self.settings.os != "Macos" and self._target_x86_64

@property
def _preprocessing_available(self):
return "ade" in self._dependencies_versions

def source(self):
get(self, **self.conan_data["sources"][self.version]["openvino"], strip_root=True)
get(self, **self.conan_data["sources"][self.version]["onednn_cpu"], strip_root=True,
Expand All @@ -121,15 +91,11 @@ def source(self):
destination=f"{self.source_folder}/src/plugins/intel_cpu/thirdparty/ComputeLibrary")
get(self, **self.conan_data["sources"][self.version]["onednn_gpu"], strip_root=True,
destination=f"{self.source_folder}/src/plugins/intel_gpu/thirdparty/onednn_gpu")
if Version(self.version) >= "2025.1.0":
get(self, **self.conan_data["sources"][self.version]["arm_kleidiai"], strip_root=True,
destination=f"{self.source_folder}/src/plugins/intel_cpu/thirdparty/kleidiai")
get(self, **self.conan_data["sources"][self.version]["arm_kleidiai"], strip_root=True,
destination=f"{self.source_folder}/src/plugins/intel_cpu/thirdparty/kleidiai")
rmdir(self, f"{self.source_folder}/src/plugins/intel_gpu/thirdparty/rapidjson")
apply_conandata_patches(self)

def export(self):
copy(self, f"dependencies/{self._dependencies_filename}", self.recipe_folder, self.export_folder)

def export_sources(self):
export_conandata_patches(self)

Expand Down Expand Up @@ -158,23 +124,20 @@ def build_requirements(self):
def requirements(self):
self.requires("onetbb/2021.10.0")
self.requires("pugixml/1.14")
if Version(self.version) >= "2025.1.0":
self.requires("nlohmann_json/3.11.3")
self.requires("nlohmann_json/3.11.3")
if self._target_x86_64:
self.requires("xbyak/6.73")
if self.options.get_safe("enable_gpu"):
self.requires("opencl-icd-loader/2023.04.17")
self.requires("rapidjson/cci.20220822")
if self._protobuf_required:
self.requires("protobuf/3.21.12")
self.requires("protobuf/[>=3.21.12 <7]")
if self.options.enable_tf_frontend:
self.requires("snappy/1.1.10")
if self.options.enable_onnx_frontend:
self.requires(self._require("onnx"))
self.requires("onnx/1.20.0")
if self.options.enable_tf_lite_frontend:
self.requires("flatbuffers/23.5.26")
if self._preprocessing_available:
self.requires(self._require("ade"))

def layout(self):
cmake_layout(self, src_folder="src")
Expand All @@ -189,12 +152,10 @@ def generate(self):
if self._gpu_option_available:
toolchain.cache_variables["ENABLE_INTEL_GPU"] = self.options.enable_gpu
toolchain.cache_variables["ENABLE_ONEDNN_FOR_GPU"] = (
Version(self.version) >= "2024.4.0" and self.options.enable_gpu
self.options.enable_gpu
or not self.options.enable_cpu
or self.options.shared
)
if self._gna_option_available:
toolchain.cache_variables["ENABLE_INTEL_GNA"] = False
if self._npu_option_available:
toolchain.cache_variables["ENABLE_INTEL_NPU"] = False
# SW plugins
Expand All @@ -209,8 +170,7 @@ def generate(self):
toolchain.cache_variables["ENABLE_OV_TF_LITE_FRONTEND"] = self.options.enable_tf_lite_frontend
toolchain.cache_variables["ENABLE_OV_ONNX_FRONTEND"] = self.options.enable_onnx_frontend
toolchain.cache_variables["ENABLE_OV_PYTORCH_FRONTEND"] = self.options.enable_pytorch_frontend
if Version(self.version) >= "2024.3.0":
toolchain.cache_variables["ENABLE_OV_JAX_FRONTEND"] = False
toolchain.cache_variables["ENABLE_OV_JAX_FRONTEND"] = False
# Dependencies
toolchain.cache_variables["ENABLE_SYSTEM_TBB"] = True
toolchain.cache_variables["ENABLE_TBBBIND_2_5"] = False
Expand All @@ -224,8 +184,6 @@ def generate(self):
if self.options.get_safe("enable_gpu"):
toolchain.cache_variables["ENABLE_SYSTEM_OPENCL"] = True
# misc
if self._preprocessing_available:
toolchain.cache_variables["ENABLE_GAPI_PREPROCESSING"] = True
toolchain.cache_variables["BUILD_SHARED_LIBS"] = self.options.shared
toolchain.cache_variables["CPACK_GENERATOR"] = "CONAN"
toolchain.cache_variables["ENABLE_PROFILING_ITT"] = False
Expand All @@ -236,13 +194,12 @@ def generate(self):
toolchain.cache_variables["ENABLE_NCC_STYLE"] = False
toolchain.cache_variables["ENABLE_SAMPLES"] = False
toolchain.cache_variables["ENABLE_TEMPLATE"] = False
if self.settings.os == "Macos" and Version(self.version) >= "2025.3.0":
if self.settings.os == "Macos":
toolchain.cache_variables["OV_FORCE_ADHOC_SIGN"] = True
toolchain.generate()

def validate_build(self):
min_cppstd = "17" if Version(self.version) >= "2025.0.0" else "11"
check_min_cppstd(self, min_cppstd)
check_min_cppstd(self, 17)

# OpenVINO has unresolved symbols, when clang is used with libc++
if self.settings.compiler == "clang" and self.settings.compiler.libcxx == "libc++":
Expand All @@ -258,15 +215,6 @@ def validate_build(self):
if os.getenv("CONAN_CENTER_BUILD_SERVICE") and self.settings.build_type == "Debug":
raise ConanInvalidConfiguration(f"{self.ref} does not support Debug build type on Conan Center CI")

def validate(self):
if (self.options.get_safe("enable_gpu") and self.options.enable_cpu
and Version(self.version) < "2024.4.0" and not self.options.shared):
# GPU and CPU plugins cannot be simultaneously built statically, because they use different oneDNN versions
self.output.warning(f"{self.name} recipe builds GPU plugin without oneDNN (dGPU) support during static build, "
"because CPU plugin compiled with different oneDNN version may cause ODR violation. "
"To enable oneDNN support for GPU plugin, please, either use shared build configuration "
"or disable CPU plugin by setting 'enable_cpu' option to False.")

def build(self):
cmake = CMake(self)
cmake.configure()
Expand All @@ -292,42 +240,33 @@ def package_info(self):
openvino_runtime = self.cpp_info.components["Runtime"]
openvino_runtime.set_property("cmake_target_name", "openvino::runtime")
openvino_runtime.requires = ["onetbb::libtbb", "pugixml::pugixml"]
if Version(self.version) >= "2025.1.0":
openvino_runtime.requires.append("nlohmann_json::nlohmann_json")
openvino_runtime.requires.append("nlohmann_json::nlohmann_json")
openvino_runtime.libs = [f"openvino{lib_suffix}"]
if self._preprocessing_available:
openvino_runtime.requires.append("ade::ade")
if self._target_x86_64:
openvino_runtime.requires.append("xbyak::xbyak")
if self.settings.os in ["Linux", "Android", "FreeBSD", "SunOS", "AIX"]:
openvino_runtime.system_libs = ["m", "dl", "pthread"]
if self.settings.os == "Windows":
openvino_runtime.system_libs.append("shlwapi")
if self._preprocessing_available:
openvino_runtime.system_libs.extend(["wsock32", "ws2_32"])
if Version(self.version) < "2024.0.0":
openvino_runtime.includedirs.append(os.path.join("include", "ie"))

# Have to expose all internal libraries for static libraries case
if not self.options.shared:
# HW plugins
if self.options.enable_cpu:
openvino_runtime.libs.append(f"openvino_arm_cpu_plugin{lib_suffix}" if self._target_arm else f"openvino_intel_cpu_plugin{lib_suffix}")
openvino_runtime.libs.extend([f"openvino_onednn_cpu{lib_suffix}", f"openvino_snippets{lib_suffix}", f"mlas{lib_suffix}"])
if Version(self.version) >= "2025.4.0":
openvino_runtime.libs.append(f"openvino_xml_util{lib_suffix}")
openvino_runtime.libs.append(f"openvino_xml_util{lib_suffix}")
if self._target_arm:
openvino_runtime.libs.append("arm_compute-static")
if Version(self.version) >= "2025.1.0":
openvino_runtime.libs.append(f"kleidiai{lib_suffix}")
openvino_runtime.libs.append(f"kleidiai{lib_suffix}")
if self.options.get_safe("enable_gpu"):
openvino_runtime.libs.extend([
f"openvino_intel_gpu_plugin{lib_suffix}",
f"openvino_intel_gpu_graph{lib_suffix}",
f"openvino_intel_gpu_runtime{lib_suffix}",
f"openvino_intel_gpu_kernels{lib_suffix}"
])
if not self.options.enable_cpu or Version(self.version) >= "2024.4.0":
if not self.options.enable_cpu:
openvino_runtime.libs.append(f"openvino_onednn_gpu{lib_suffix}")
# SW plugins
if self.options.enable_auto:
Expand All @@ -336,9 +275,6 @@ def package_info(self):
openvino_runtime.libs.append(f"openvino_hetero_plugin{lib_suffix}")
if self.options.enable_auto_batch:
openvino_runtime.libs.append(f"openvino_auto_batch_plugin{lib_suffix}")
# Preprocessing should come after plugins, because plugins depend on it
if self._preprocessing_available:
openvino_runtime.libs.extend([f"openvino_gapi_preproc{lib_suffix}", f"fluid{lib_suffix}"])
# Frontends
if self.options.enable_ir_frontend:
openvino_runtime.libs.append(f"openvino_ir_frontend{lib_suffix}")
Expand All @@ -359,17 +295,15 @@ def package_info(self):
if self.options.enable_pytorch_frontend:
openvino_runtime.libs.append(f"openvino_pytorch_frontend{lib_suffix}")
# Common private dependencies should go last, because they satisfy dependencies for all other libraries
if Version(self.version) < "2024.0.0":
openvino_runtime.libs.append(f"openvino_builders{lib_suffix}")
openvino_runtime.libs.extend([
f"openvino_reference{lib_suffix}",
f"openvino_shape_inference{lib_suffix}",
f"openvino_itt{lib_suffix}",
# utils goes last since all others depend on it
f"openvino_util{lib_suffix}"
f"openvino_util{lib_suffix}",
f"openvino_common_translators{lib_suffix}"
])
if Version(self.version) >= "2025.1.0":
openvino_runtime.libs.append(f"openvino_common_translators{lib_suffix}")

# set 'openvino' once again for transformations objects files (cyclic dependency)
# openvino_runtime.libs.append("openvino")
full_openvino_lib_path = os.path.join(self.package_folder, "lib", f"openvino{lib_suffix}.lib").replace("\\", "/") if self.settings.os == "Windows" else \
Expand Down
2 changes: 0 additions & 2 deletions recipes/openvino/all/dependencies/dependencies-2023.3.0.yml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions recipes/openvino/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
versions:
"2025.4.0":
folder: "all"
"2024.6.0":
folder: "all"
"2023.3.0":
folder: "all"
4 changes: 2 additions & 2 deletions recipes/whisper-cpp/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ def validate(self):
def requirements(self):
if not is_apple_os(self):
if self.options.get_safe("with_blas"):
self.requires("openblas/0.3.24")
self.requires("openblas/[^0.3.24]")
if self.options.get_safe("with_openvino"):
self.requires("openvino/2023.2.0")
self.requires("openvino/[>=2023.2.0 <=2025.4.0]")

def layout(self):
cmake_layout(self, src_folder="src")
Expand Down