Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Commit

Permalink
don't bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed May 28, 2024
1 parent 4c07a29 commit 733d200
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ set_target_properties(_bootgen _xclbinutil bootgen-lib cdo_driver xaie
xclbinutil-lib PROPERTIES POSITION_INDEPENDENT_CODE ON)

set_target_properties(
_bootgen _xclbinutil pyxrt xaie xclbinutil-lib xclbinutil
_bootgen _xclbinutil pyxrt xaie xclbinutil-lib
PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_DIR}
ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_DIR}
RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
12 changes: 1 addition & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,6 @@ def build_extension(self, ext: CMakeExtension) -> None:
check=True,
env=env,
)
subprocess.run(
[CMAKE_EXE_PATH, "--build", ".", "--target", "xclbinutil", *build_args],
cwd=build_temp,
check=True,
env=env,
)

sys.path.append(str(HERE))
from util import gen_xaie_ctypes
Expand All @@ -146,14 +140,11 @@ def build_extension(self, ext: CMakeExtension) -> None:
)


PACKAGE_NAME = "xaiepy"

build_temp = Path.cwd() / "build" / "temp"
if not build_temp.exists():
build_temp.mkdir(parents=True)


EXE_EXT = ".exe" if platform.system() == "Windows" else ""
PACKAGE_NAME = "xaiepy"

setup(
name=PACKAGE_NAME,
Expand All @@ -164,7 +155,6 @@ def build_extension(self, ext: CMakeExtension) -> None:
cmdclass={"editable_wheel": editable_wheel, "build_ext": CMakeBuild},
zip_safe=False,
packages=[PACKAGE_NAME],
package_data={PACKAGE_NAME: ["xclbinutil" + EXE_EXT]},
include_package_data=True,
install_requires=[
str(ir.requirement)
Expand Down
8 changes: 6 additions & 2 deletions tests/test_merge_two_xclbins_through_xclbinutil.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#! /usr/bin/env python
from pathlib import Path

from xaiepy.xclbinutil import merge_two_xclbins
import pytest

try:
from xaiepy.xclbinutil import merge_two_xclbins
except:
pytest.skip(allow_module_level=True)


def test_merge():
Expand Down
14 changes: 10 additions & 4 deletions xaiepy/xclbinutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import os
import platform
import random
import shutil
import subprocess
import sys
from pathlib import Path
Expand Down Expand Up @@ -137,10 +138,15 @@ def do_run(command):
subprocess.check_call(command)


_EXE_EXT = ".exe" if platform.system() == "Windows" else ""
_XCLBIN_PATH = Path(__file__).parent / ("xclbinutil" + _EXE_EXT)
XCLBIN_PATH = Path(os.getenv("XCLBIN_PATH", _XCLBIN_PATH))
assert XCLBIN_PATH.exists(), "couldn't find xclbinutil"
__XCLBIN_PATH = Path("/opt/xilinx/xrt/bin/xclbinutil")
_XCLBIN_PATH = shutil.which("xclbinutil")
if os.getenv("XCLBIN_PATH"):
XCLBIN_PATH = Path(os.getenv("XCLBIN_PATH"))
elif _XCLBIN_PATH is not None:
XCLBIN_PATH = Path(_XCLBIN_PATH)
elif __XCLBIN_PATH.exists():
XCLBIN_PATH = __XCLBIN_PATH
assert XCLBIN_PATH is not None and XCLBIN_PATH.exists(), "couldn't find xclbinutil"


def get_dpu_kernel_id_from_pdi(pdi):
Expand Down

0 comments on commit 733d200

Please sign in to comment.