Skip to content

Commit a7f969a

Browse files
authored
Fix TBB detection (#670)
* Consider new TBB layout * Do not extra native resources * Detect CPU architecture * Consider CPU arch dependent OpenVINO bin folder name * Fix ReadTheDocs
1 parent 5f504af commit a7f969a

File tree

2 files changed

+36
-11
lines changed

2 files changed

+36
-11
lines changed

.readthedocs.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
version: 2
22

33
build:
4-
image: latest
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.11"
57
apt_packages:
68
- default-jdk

modules/java_api/build.gradle

+33-10
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,51 @@ plugins {
44

55
import org.gradle.internal.os.OperatingSystem
66
println 'Operating system: ' + OperatingSystem.current()
7+
def arch = System.getProperty("os.arch")
8+
def ov_arch = arch;
9+
println 'CPU architecture: ' + arch
10+
711

812
def nativesCPP;
9-
def openvinoVersion = "2022.1"
13+
def openvinoVersion = "2023.0"
14+
15+
def native_resources = []
16+
def tbb_dir = System.getenv('TBB_DIR')
17+
if (tbb_dir) {
18+
if (new File(tbb_dir + "/../lib/").exists()) {
19+
native_resources.add(tbb_dir + "/../lib/");
20+
} else {
21+
native_resources.add(tbb_dir + "/../../");
22+
}
23+
}
24+
25+
if (arch == "x86_64" || arch == "amd64" || arch == "x64" || arch == "x86-64") {
26+
arch = "x86_64";
27+
ov_arch = "intel64";
28+
} else if (arch == "aarch64" || arch == "arm64" || arch == "arm-v8") {
29+
arch = "arm64";
30+
ov_arch = "aarch64";
31+
} else if (arch == "arm" || arch == "arm-v7" || arch == "armv7" || arch == "arm32") {
32+
arch = "arm32";
33+
ov_arch = "armhf";
34+
}
1035

1136
if (OperatingSystem.current().isMacOsX()) {
12-
nativesCPP = 'macosx-x86_64'
37+
nativesCPP = 'macosx-'
38+
native_resources.add(System.getenv('INTEL_OPENVINO_DIR') + "/runtime/lib/" + ov_arch + "/Release");
1339
} else if (OperatingSystem.current().isLinux()) {
14-
nativesCPP = 'linux-x86_64'
40+
nativesCPP = 'linux-'
41+
native_resources.add(System.getenv('INTEL_OPENVINO_DIR') + "/runtime/lib/" + ov_arch);
1542
} else if (OperatingSystem.current().isWindows()) {
16-
nativesCPP = 'windows-x86_64'
43+
nativesCPP = 'windows-'
44+
native_resources.add(System.getenv('INTEL_OPENVINO_DIR') + "/runtime/bin/" + ov_arch + "/Release");
1745
} else {
1846
logger.warn('Unknown operating system!')
1947
}
48+
nativesCPP += arch;
2049

2150
project.version = "${openvinoVersion}-${nativesCPP}"
2251

23-
def native_resources = [
24-
System.getenv('INTEL_OPENVINO_DIR') + "/runtime/lib/intel64", // UNIX
25-
System.getenv('INTEL_OPENVINO_DIR') + "/runtime/lib/intel64/Release", // Mac
26-
System.getenv('INTEL_OPENVINO_DIR') + "/runtime/bin/intel64/Release", // Windows
27-
System.getenv('TBB_DIR') + "/../lib/",
28-
]
2952
def resources_list = ""
3053
native_resources.each {
3154
def tree = fileTree(it) {

0 commit comments

Comments
 (0)