llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Encountered a compilation error with the function reshapeLikeShapesAreCompatible while building and running all MLIR tests

Open Rayfxl opened this issue 2 years ago • 3 comments

Encountered an error when running the command “cmake --build . --target check-mlir”:

[4/2491] Building CXX object tools/mli....MLIRTensorDialect.dir/TensorOps.cpp.o FAILED: tools/mlir/lib/Dialect/Tensor/IR/CMakeFiles/obj.MLIRTensorDialect.dir/TensorOps.cpp.o ......(missing the unimportant parts) llvm-project/mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h:137:10: error: call to function 'reshapeLikeShapesAreCompatible' that is neither visible in the template definition nor found by argument-dependent lookup return reshapeLikeShapesAreCompatible( ......

My CMake version is 3.29.0 and my Clang version is 8. I'm running them on Ubuntu 18.04 in VMware Workstation. I checked the header file 'ReshapeOpsUtils.h' and found that the function 'reshapeLikeShapesAreCompatible' was declared after the return statement, which might be the cause of the issue. So, I moved the declaration of this function before the function that call it (verifyReshapeLikeTypes), and then there were no errors during compilation. I checked the source code of the project and it seemed there were no modifications at this place. Hence, I've reported this issue.

Rayfxl avatar May 26 '24 18:05 Rayfxl

I got a similar error when running the same command, running on Mac with: cmake version 3.23.1

Apple clang version 11.0.0 (clang-1100.0.33.12) Target: x86_64-apple-darwin21.6.0 Thread model: posix

/llvm-project/mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h:165:10: error: call to function 'reshapeLikeShapesAreCompatible' that is neither visible in the template definition nor found by argument-dependent lookup return reshapeLikeShapesAreCompatible(

sonar3d avatar Oct 13 '24 08:10 sonar3d

I got a similar error when running the same command, running on Mac with: cmake version 3.23.1

Apple clang version 11.0.0 (clang-1100.0.33.12) Target: x86_64-apple-darwin21.6.0 Thread model: posix

/llvm-project/mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h:165:10: error: call to function 'reshapeLikeShapesAreCompatible' that is neither visible in the template definition nor found by argument-dependent lookup return reshapeLikeShapesAreCompatible(

So problem solving?

Rayfxl avatar Jan 16 '25 08:01 Rayfxl

yes, just move the code upward one function block

wangyuehy avatar Mar 27 '25 03:03 wangyuehy