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

[torch-frontend] only link aggregateCAPI with version #445

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions frontends/torch-frontend/torch-frontend/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ add_mlir_python_common_capi_library(TorchFrontendMLIRAggregateCAPI

target_link_options(TorchFrontendMLIRAggregateCAPI PRIVATE $<$<PLATFORM_ID:Linux>:LINKER:--exclude-libs,ALL>)

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

add_mlir_python_modules(TorchFrontendPythonModules
ROOT_PREFIX "${TORCH_FRONTEND_BINARY_DIR}/python_packages/torch_frontend"
INSTALL_PREFIX "python_packages/torch_frontend"
Expand Down
3 changes: 2 additions & 1 deletion frontends/torch-frontend/torch-frontend/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ def build_torch_frontend(self):
"python_packages",
"torch_frontend",
)
ignore_pattern = shutil.ignore_patterns("*TorchFrontendMLIRAggregateCAPI.so")
target_dir = os.path.join(self.build_lib, "torch_frontend")
if os.path.exists(target_dir):
shutil.rmtree(target_dir, ignore_errors=False, onerror=None)
shutil.copytree(python_package_dir, target_dir, symlinks=False)
shutil.copytree(python_package_dir, target_dir, symlinks=False, ignore=ignore_pattern)
shutil.copyfile(version_file, os.path.join(target_dir, "version.py"))

def build_torch_mlir(self):
Expand Down
Loading