Skip to content

Commit

Permalink
Added LC_RPATH to additionally point to openvino's libs
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov committed Dec 12, 2023
1 parent d679ea4 commit e54e45e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
13 changes: 11 additions & 2 deletions modules/custom_operations/user_ie_extensions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,18 @@ include(GNUInstallDirs)

# setting RPATH / LC_RPATH depending on platform
if(LINUX)
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "$ORIGIN")
# to find libcore_tokenizer.so in the same folder
set(rpaths "$ORIGIN")
elseif(APPLE)
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "@loader_path")
# to find libcore_tokenizer.dylib in the same folder
set(rpaths "@loader_path")
if(DEFINED SKBUILD)
# in case we build pip package, we need to refer to libopenvino.dylib from 'openvino' package
list(APPEND rpaths "@loader_path/../../openvino/libs")
endif()
endif()
if(rpaths)
set_target_properties(${TARGET_NAME} PROPERTIES INSTALL_RPATH "${rpaths}")
endif()

# Installing the extension module to the root of the package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@
else:
sys.exit(f"Error: extension does not support the platform {sys.platform}")

# conda-forge case
conda_forge_lib_path = Path(os.path.join(os.path.dirname(__file__), "..", "..", ".."))
if os.path.exists(conda_forge_lib_path / _ext_name):
_ext_path = conda_forge_lib_path / _ext_name
else:
conda_forge_lib_path = Path(__file__).parent() / ".." / ".." / ".."
if not (_ext_path := conda_forge_lib_path / _ext_name).exists():
_ext_path = _ext_libs_path / _ext_name

del _ext_name
del _ext_libs_path
del _extension_path
del conda_forge_lib_path

# patching openvino
Expand Down

0 comments on commit e54e45e

Please sign in to comment.