Encountered a compilation error with the function reshapeLikeShapesAreCompatible while building and running all MLIR tests
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.
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(
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?
yes, just move the code upward one function block