Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[onert/python] Include core library in package #14321

Merged
merged 1 commit into from
Nov 20, 2024
Merged
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
23 changes: 18 additions & 5 deletions infra/nnfw/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,31 @@ def get_directories():
"lib/" if product_dir != DEFAULT_PRODUCT_DIR else target_arch +
'-linux.release/out/lib')

product_dir, so_core_dir = get_directories()
product_dir, so_base_dir = get_directories()

for so in os.listdir(so_core_dir):
for so in os.listdir(so_base_dir):
if so.endswith(".so"):
so_list.append('native/' + so)
src_path = os.path.join(so_core_dir, so)
src_path = os.path.join(so_base_dir, so)
tgt_path = os.path.join(arch_path, so)
shutil.copy(src_path, tgt_path)
print(f"Copied {src_path} to {tgt_path}")

# onert core library
so_core_dir = os.path.join(so_base_dir, 'nnfw')
if os.path.exists(so_core_dir):
so_core_tgt_dir = os.path.join(arch_path, 'nnfw')
os.makedirs(so_core_tgt_dir)
for so in os.listdir(so_core_dir):
if so.endswith(".so"):
so_list.append('native/nnfw/' + so)
src_path = os.path.join(so_core_dir, so)
tgt_path = os.path.join(so_core_tgt_dir, so)
shutil.copy(src_path, tgt_path)
print(f"Copied {src_path} to {tgt_path}")

# onert backend library
so_backend_dir = os.path.join(so_core_dir, 'nnfw/backend')
so_backend_dir = os.path.join(so_base_dir, 'nnfw/backend')
if os.path.exists(so_backend_dir):
so_backend_tgt_dir = os.path.join(arch_path, 'nnfw/backend')
os.makedirs(so_backend_tgt_dir)
Expand All @@ -103,7 +116,7 @@ def get_directories():
print(f"Copied {src_path} to {tgt_path}")

# onert odc library
so_odc_dir = os.path.join(so_core_dir, 'nnfw/odc')
so_odc_dir = os.path.join(so_base_dir, 'nnfw/odc')
if os.path.exists(so_odc_dir):
so_odc_tgt_dir = os.path.join(arch_path, 'nnfw/odc')
os.makedirs(so_odc_tgt_dir)
Expand Down