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

[cmake] Torch-MLIR doesn't build with CMake setting 'BUILD_SHARED_LIBS=ON' #3961

Open
christopherbate opened this issue Jan 15, 2025 · 0 comments

Comments

@christopherbate
Copy link

MLIR/LLVM supports building with CMake setting -DBUILD_SHARED_LIBS=ON. This can be helpful during development for various reasons. However, building with this setting is much less forgiving of missing link dependencies in the library declarations or of circular dependencies.

In the library TorchMLIRTorchUtils, for example, there are no link dependencies listed. The organization of the libraries TorchMLIRTorchUtils and TorchMLIRTorchDialect is also circular. Each depends on the other, which makes the build a bit brittle for downstream users. This is clear from looking at the Bazel build as well: all the headers in include/torch-mlir/Dialect/Torch/IR are referenced as includes by both libraries. I propose to move the functions that TorchMLIRTorchDialect actually depends on into the TorchMLIRTorchDialect directly, removing the circular dependency (and also fixing any other issues which block use of -DBUILD_SHARED_LIBS=ON).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant