Skip to content

Commit bd2f99e

Browse files
authored
[BUILD] Fix linker error in Membar.cpp (#3421)
We found an issue when linking `TritonAnalysis` without first fully building triton. ``` In file included from ~/triton/lib/Analysis/Membar.cpp:6: In file included from ~/triton/include/triton/Conversion/TritonGPUToLLVM/Utility.h:8: ~/triton/include/triton/Dialect/NVGPU/IR/Dialect.h:32:10: fatal error: 'triton/Dialect/NVGPU/IR/Dialect.h.inc' file not found #include "triton/Dialect/NVGPU/IR/Dialect.h.inc" ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning and 1 error generated. ninja: build stopped: subcommand failed. ``` So `Membar.cpp` includes `Utility.h` from `TritonGPUToLLVM` which in turns needs `NVGPU` and its tablegen files. `TritonAnalysis`'s cmake doesn't list neither `TritonGPUToLLVM` nor `NVGPU` as dependencies, hence the linker error. Technically we should have `TritonAnalysis` depend on `TritonGPUToLLVM`, but `TritonGPUToLLVM` already depends on `TritonAnalysis`. Fortunately, `Membar.cpp` doesn't use this `Utility.h` file, so we could simply delete this include to break both the linker error and the potential circular dependency. Also note that the error doesn't show up in the full build because the tablegen files from `NVGPU` are already generated by the time we link the all libs.
1 parent 9f51d30 commit bd2f99e

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

lib/Analysis/Membar.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
#include "triton/Dialect/TritonGPU/IR/Dialect.h"
44

55
#include "mlir/Dialect/Func/IR/FuncOps.h"
6-
#include "triton/Conversion/TritonGPUToLLVM/Utility.h"
7-
#include "triton/Dialect/TritonGPU/Transforms/Utility.h"
8-
96
#include "mlir/Dialect/GPU/IR/GPUDialect.h"
107
#include "mlir/Dialect/Tensor/IR/Tensor.h"
118
#include <deque>

0 commit comments

Comments
 (0)