-
Notifications
You must be signed in to change notification settings - Fork 625
Description
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
).