Skip to content

Commit

Permalink
[onert/python] Include core library in package (#14321)
Browse files Browse the repository at this point in the history
This commit updatese python packaging to include core library "libonert_core.so"

ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <[email protected]>
  • Loading branch information
hseok-oh authored Nov 20, 2024
1 parent a4e489e commit 960f45d
Showing 1 changed file with 18 additions and 5 deletions.
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

0 comments on commit 960f45d

Please sign in to comment.