Skip to content

Commit

Permalink
[compiler] reduce wheel package size (#447)
Browse files Browse the repository at this point in the history
as title
  • Loading branch information
qingyunqu authored Sep 11, 2024
1 parent fa87452 commit b2907c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions compiler/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ target_link_options(ByteIRCAPIAggregation
PRIVATE $<$<PLATFORM_ID:Linux>:LINKER:--exclude-libs,ALL>
)

# only link soversion ByteIRCAPIAggregation
get_target_property(LLVM_VERSION ByteIRCAPIAggregation VERSION)
set_target_properties(ByteIRCAPIAggregation PROPERTIES SOVERSION ${LLVM_VERSION})

################################################################################
# Python module
################################################################################
Expand Down
3 changes: 2 additions & 1 deletion compiler/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def build_byteir(self):
target_dir = os.path.join(self.build_lib, "byteir")
if os.path.exists(target_dir):
shutil.rmtree(target_dir, ignore_errors=False, onerror=None)
shutil.copytree(python_package_dir, target_dir, symlinks=False)
ignore_pattern = shutil.ignore_patterns("*ByteIRCAPIAggregation.so")
shutil.copytree(python_package_dir, target_dir, symlinks=False, ignore=ignore_pattern)
shutil.copyfile(version_file, os.path.join(target_dir, "version.py"))

setup(
Expand Down

0 comments on commit b2907c5

Please sign in to comment.