summaryrefslogtreecommitdiff
path: root/python/openvino/runtime/patches
diff options
context:
space:
mode:
Diffstat (limited to 'python/openvino/runtime/patches')
-rw-r--r--python/openvino/runtime/patches/computelibrary.patch47
-rw-r--r--python/openvino/runtime/patches/flags.patch76
-rw-r--r--python/openvino/runtime/patches/openvino_5cee8bbf29797f4544b343e803de957e9f041f92_gcc11.3.0.patch37
3 files changed, 160 insertions, 0 deletions
diff --git a/python/openvino/runtime/patches/computelibrary.patch b/python/openvino/runtime/patches/computelibrary.patch
new file mode 100644
index 0000000..1fc0dd3
--- /dev/null
+++ b/python/openvino/runtime/patches/computelibrary.patch
@@ -0,0 +1,47 @@
+diff --git a/SConstruct b/SConstruct
+index 68c518a4a0..6ecfb05672 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -109,7 +109,7 @@ vars.AddVariables(
+ BoolVariable("cppthreads", "Enable C++11 threads backend", True),
+ PathVariable("build_dir", "Specify sub-folder for the build", ".", PathVariable.PathAccept),
+ PathVariable("install_dir", "Specify sub-folder for the install", "", PathVariable.PathAccept),
+- BoolVariable("exceptions", "Enable/disable C++ exception support", True),
++ BoolVariable("exceptions", "Enable/disable C++ exception support", False),
+ BoolVariable("high_priority", "Generate a library containing only the high priority operators", False),
+ PathVariable("linker_script", "Use an external linker script", "", PathVariable.PathAccept),
+ PathVariable("external_tests_dir", """Add examples, benchmarks and tests to the tests suite from an external path. In order to use this option, the external tests directory must have the following structure:
+@@ -324,11 +324,14 @@ if env['multi_isa']:
+ else: # NONE "multi_isa" builds
+
+ if 'v7a' in env['arch']:
+- env.Append(CXXFLAGS = ['-march=armv7-a', '-mthumb', '-mfpu=neon'])
+- if (env['os'] == 'android' or env['os'] == 'tizen') and not 'hf' in env['arch']:
+- env.Append(CXXFLAGS = ['-mfloat-abi=softfp'])
++ if ('-march' in env['extra_cxx_flags']) or ('-mcpu' in env['extra_cxx_flags']):
++ print("INFO: Re-use march/mcpu settings")
+ else:
+- env.Append(CXXFLAGS = ['-mfloat-abi=hard'])
++ env.Append(CXXFLAGS = ['-march=armv7-a', '-mthumb', '-mfpu=neon'])
++ if env['os'] == 'android' or env['os'] == 'tizen':
++ env.Append(CXXFLAGS = ['-mfloat-abi=softfp'])
++ else:
++ env.Append(CXXFLAGS = ['-mfloat-abi=hard'])
+ elif 'v8.6-a' in env['arch']:
+ if 'armv8.6-a-sve2' in env['arch']:
+ env.Append(CXXFLAGS = ['-march=armv8.6-a+sve2'])
+@@ -649,7 +652,7 @@ if env['exceptions']:
+ if env['os'] == 'bare_metal' and env['arch'] == 'armv7a':
+ print("WARNING: Building tests for bare metal and armv7a is not supported")
+ Return()
+- SConscript('./tests/SConscript', variant_dir='%s/tests' % build_path, duplicate=0)
++ # SConscript('./tests/SConscript', variant_dir='%s/tests' % build_path, duplicate=0)
+
+ # Unknown variables are not allowed
+ # Note: we must delay the call of UnknownVariables until after
+@@ -657,4 +660,4 @@ if env['exceptions']:
+ unknown = vars.UnknownVariables()
+ if unknown:
+ print("Unknown variables: %s" % " ".join(unknown.keys()))
+- Exit(1)
++ # Exit(1)
diff --git a/python/openvino/runtime/patches/flags.patch b/python/openvino/runtime/patches/flags.patch
new file mode 100644
index 0000000..5c663aa
--- /dev/null
+++ b/python/openvino/runtime/patches/flags.patch
@@ -0,0 +1,76 @@
+diff --git a/cmake/developer_package/target_flags.cmake b/cmake/developer_package/target_flags.cmake
+index 29f23e713e..84d32e6633 100644
+--- a/cmake/developer_package/target_flags.cmake
++++ b/cmake/developer_package/target_flags.cmake
+@@ -113,36 +113,38 @@ endif()
+
+ get_property(OV_GENERATOR_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+
+-function(ov_glibc_version)
+- # cmake needs to look at glibc version only when we build for Linux on Linux
+- if(LINUX)
+- function(ov_get_definition definition var)
+- execute_process(COMMAND echo "#include <errno.h>"
+- COMMAND "${CMAKE_CXX_COMPILER}" -xc - -E -dM
+- COMMAND grep -E "^#define ${definition} "
+- OUTPUT_VARIABLE glibc_version_component
+- ERROR_VARIABLE error_message
+- RESULT_VARIABLE exit_code
+- OUTPUT_STRIP_TRAILING_WHITESPACE)
+-
+- if(NOT exit_code EQUAL 0)
+- message(FATAL_ERROR "Failed to detect glibc version: ${error_message}\n${glibc_version_component}")
+- endif()
+-
+- if(glibc_version_component MATCHES "^#define ${definition} ([0-9]+)")
+- set("${var}" "${CMAKE_MATCH_1}" PARENT_SCOPE)
+- else()
+- message(FATAL_ERROR "Internal error: failed to parse ${definition} from '${glibc_version_component}'")
+- endif()
+- endfunction()
+-
+- ov_get_definition("__GLIBC__" _ov_glibc_major)
+- ov_get_definition("__GLIBC_MINOR__" _ov_glibc_minor)
+-
+- set(OV_GLIBC_VERSION "${_ov_glibc_major}.${_ov_glibc_minor}" PARENT_SCOPE)
+- else()
+- set(OV_GLIBC_VERSION "0.0" PARENT_SCOPE)
+- endif()
+-endfunction()
+-
+-ov_glibc_version()
++if(FALSE)
++ function(ov_glibc_version)
++ # cmake needs to look at glibc version only when we build for Linux on Linux
++ if(LINUX)
++ function(ov_get_definition definition var)
++ execute_process(COMMAND echo "#include <errno.h>"
++ COMMAND "${CMAKE_CXX_COMPILER}" -xc - -E -dM
++ COMMAND grep -E "^#define ${definition} "
++ OUTPUT_VARIABLE glibc_version_component
++ ERROR_VARIABLE error_message
++ RESULT_VARIABLE exit_code
++ OUTPUT_STRIP_TRAILING_WHITESPACE)
++
++ if(NOT exit_code EQUAL 0)
++ message(FATAL_ERROR "Failed to detect glibc version: ${error_message}\n${glibc_version_component}")
++ endif()
++
++ if(glibc_version_component MATCHES "^#define ${definition} ([0-9]+)")
++ set("${var}" "${CMAKE_MATCH_1}" PARENT_SCOPE)
++ else()
++ message(FATAL_ERROR "Internal error: failed to parse ${definition} from '${glibc_version_component}'")
++ endif()
++ endfunction()
++
++ ov_get_definition("__GLIBC__" _ov_glibc_major)
++ ov_get_definition("__GLIBC_MINOR__" _ov_glibc_minor)
++
++ set(OV_GLIBC_VERSION "${_ov_glibc_major}.${_ov_glibc_minor}" PARENT_SCOPE)
++ else()
++ set(OV_GLIBC_VERSION "0.0" PARENT_SCOPE)
++ endif()
++ endfunction()
++
++ ov_glibc_version()
++endif()
diff --git a/python/openvino/runtime/patches/openvino_5cee8bbf29797f4544b343e803de957e9f041f92_gcc11.3.0.patch b/python/openvino/runtime/patches/openvino_5cee8bbf29797f4544b343e803de957e9f041f92_gcc11.3.0.patch
new file mode 100644
index 0000000..97fbc4d
--- /dev/null
+++ b/python/openvino/runtime/patches/openvino_5cee8bbf29797f4544b343e803de957e9f041f92_gcc11.3.0.patch
@@ -0,0 +1,37 @@
+diff --git a/src/core/src/type/bfloat16.cpp b/src/core/src/type/bfloat16.cpp
+index 6e612b0cfe..dee498d795 100644
+--- a/src/core/src/type/bfloat16.cpp
++++ b/src/core/src/type/bfloat16.cpp
+@@ -61,6 +61,23 @@ size_t bfloat16::size() const {
+ # pragma GCC diagnostic ignored "-Wuninitialized"
+ #endif
+
++#if 1
++// GCC 11 fails due to the reinterpret_cast violating alaising rules
++union bfloat16_uint32
++{
++ float f;
++ uint32_t v;
++};
++
++bfloat16::operator float() const
++{
++ uint32_t tmp = (static_cast<uint32_t>(m_value) << 16);
++ union bfloat16_uint32 fv;
++ fv.v = tmp;
++
++ return fv.f;
++}
++#else
+ bfloat16::operator float() const {
+ uint32_t tmp = 0;
+ uint32_t* ptmp = &tmp;
+@@ -68,7 +85,7 @@ bfloat16::operator float() const {
+ const float* f = reinterpret_cast<const float*>(ptmp);
+ return *f;
+ }
+-
++#endif
+ #if defined __GNUC__ && __GNUC__ == 11
+ # pragma GCC diagnostic pop
+ #endif