Skip to content

Commit

Permalink
[CUSTOM_OP][JAVA_API] Fixed custom_ops build without OV build, update…
Browse files Browse the repository at this point in the history
…d Torch version, fixed Java CI tests
  • Loading branch information
likholat committed Nov 7, 2023
1 parent fa66500 commit e29c898
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
6 changes: 3 additions & 3 deletions modules/custom_operations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ The C++ code implementing the custom operation is in the `user_ie_extensions` di
2. Build the library:

```bash
cd user_ie_extensions
cd openvino_contrib/modules/custom_operations
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release && cmake --build . --parallel 4
cmake ../user_ie_extensions -DCMAKE_BUILD_TYPE=Release && cmake --build . --parallel 4
```

If you need to build only some operations specify them with the `-DCUSTOM_OPERATIONS` option:
```bash
cmake .. -DCMAKE_BUILD_TYPE=Release -DCUSTOM_OPERATIONS="complex_mul;fft"
cmake ../user_ie_extensions -DCMAKE_BUILD_TYPE=Release -DCUSTOM_OPERATIONS="complex_mul;fft"
```

- Please note that [OpenCV](https://opencv.org/) installation is required to build an extension for the [fft](examples/fft) operation. Other extentions still can be built without OpenCV.
Expand Down
5 changes: 3 additions & 2 deletions modules/custom_operations/tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
torch==1.13.1
# open3d==0.16.0 - need to update with new release
torch
onnx
tensorboard
pytest
# open3d==0.16.0 - need to update with new release
8 changes: 8 additions & 0 deletions modules/custom_operations/user_ie_extensions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
# SPDX-License-Identifier: Apache-2.0
#

if(POLICY CMP0079)
cmake_policy(SET CMP0079 NEW)
endif()

if(POLICY CMP0057)
cmake_policy(SET CMP0057 NEW)
endif()

set(TARGET_NAME "user_ov_extensions")

set(CMAKE_CXX_STANDARD 11)
Expand Down
6 changes: 3 additions & 3 deletions modules/java_api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ if (arch == "x86_64" || arch == "amd64" || arch == "x64" || arch == "x86-64") {

if (OperatingSystem.current().isMacOsX()) {
nativesCPP = 'macosx-'
native_resources.add(System.getenv('INTEL_OPENVINO_DIR') + "/runtime/lib/" + ov_arch + "/Release");
native_resources.add(System.getenv('INTEL_OPENVINO_DIR') + "/lib");
} else if (OperatingSystem.current().isLinux()) {
nativesCPP = 'linux-'
native_resources.add(System.getenv('INTEL_OPENVINO_DIR') + "/runtime/lib/" + ov_arch);
native_resources.add(System.getenv('INTEL_OPENVINO_DIR') + "/lib");
} else if (OperatingSystem.current().isWindows()) {
nativesCPP = 'windows-'
native_resources.add(System.getenv('INTEL_OPENVINO_DIR') + "/runtime/bin/" + ov_arch + "/Release");
native_resources.add(System.getenv('INTEL_OPENVINO_DIR') + "/bin");
} else {
logger.warn('Unknown operating system!')
}
Expand Down

0 comments on commit e29c898

Please sign in to comment.