Skip to content

Commit

Permalink
build: add missing dependency on InterpreterOps (#1894)
Browse files Browse the repository at this point in the history
Commit afd8f5b introduced a file (StablehloInstrumentWithProbe.cpp)
that references `interpreter::ProbeOp` (defined in the InterpreterOps
library target), but this dependency was not added to the CMake build
rules for building the StablehloPasses target, which includes code from
StablehloInstrumentWithProbe.cpp.  As a result, builds (sometime) fail
with the following error:

```
Linking CXX shared library lib/libStablehloPasses.so
CMakeFiles/obj.StablehloPasses.dir/StablehloInstrumentWithProbe.cpp.o:
...
undefined reference to `mlir::stablehlo::interpreter::ProbeOp::build
...
```

This patch fixes the CMake build error by adding InterpreterOps as a
library dependency of the StablehloPasses target.

Credit to @hamptonm1 for discovering the problem.
  • Loading branch information
ashay authored Dec 20, 2023
1 parent 3bdd859 commit cb42882
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions stablehlo/transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ add_mlir_dialect_library(StablehloPasses

LINK_LIBS PUBLIC
ChloOps
InterpreterOps
MLIRFuncDialect
MLIRIR
MLIRInferTypeOpInterface
Expand Down

0 comments on commit cb42882

Please sign in to comment.