Skip to content

Commit

Permalink
[PyCDE] Update build flow (#8008)
Browse files Browse the repository at this point in the history
Fix the PyCDE build flow. Added nanobind and fixed dll install on Windows.
  • Loading branch information
teqdruid authored Dec 18, 2024
1 parent 00a5625 commit 9468862
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
3 changes: 2 additions & 1 deletion frontends/PyCDE/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ requires = [

# MLIR build depends.
"numpy",
"pybind11>=2.9",
"pybind11>=2.11,<=2.12",
"nanobind==2.4.0",
"PyYAML",

# PyCDE depends
Expand Down
2 changes: 2 additions & 0 deletions frontends/PyCDE/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def run(self):
if "BUILD_TYPE" in os.environ:
cfg = os.environ["BUILD_TYPE"]
cmake_args = [
"-Wno-dev",
"-GNinja",
"-DCMAKE_INSTALL_PREFIX={}".format(os.path.abspath(cmake_install_dir)),
"-DPython3_EXECUTABLE={}".format(sys.executable.replace("\\", "/")),
"-DCMAKE_BUILD_TYPE={}".format(cfg), # not used on MSVC, but no harm
Expand Down
19 changes: 7 additions & 12 deletions frontends/PyCDE/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ add_mlir_python_modules(PyCDE
PyCDE_CIRCTPythonCAPI
)

install(TARGETS PyCDE_CIRCTPythonCAPI
DESTINATION python_packages/pycde/circt/_mlir_libs
RUNTIME_DEPENDENCIES
PRE_EXCLUDE_REGEXES ".*"
PRE_INCLUDE_REGEXES ".*zlib.*"
COMPONENT PyCDE
)
add_dependencies(PyCDE PyCDE_CIRCTPythonModules)
add_dependencies(install-PyCDE install-PyCDE_CIRCTPythonModules)

Expand All @@ -103,15 +110,3 @@ install(FILES ${esiprims}
DESTINATION python_packages/pycde
COMPONENT PyCDE
)

install(IMPORTED_RUNTIME_ARTIFACTS PyCDE_CIRCTPythonCAPI
RUNTIME_DEPENDENCY_SET PyCDE_RUNTIME_DEPS
DESTINATION python_packages/pycde/circt/_mlir_libs
COMPONENT PyCDE
)
install(RUNTIME_DEPENDENCY_SET PyCDE_RUNTIME_DEPS
DESTINATION python_packages/pycde/circt/_mlir_libs
PRE_EXCLUDE_REGEXES .*
PRE_INCLUDE_REGEXES zlib1
COMPONENT PyCDE
)

0 comments on commit 9468862

Please sign in to comment.