Skip to content

Commit

Permalink
Disable -Wno-error=parentheses on gcc to fix torch-mlir build. (ire…
Browse files Browse the repository at this point in the history
…e-org#19030)

Test runs:
* https://github.com/iree-org/iree/actions/runs/11689400528 (global
error disable)
* https://github.com/iree-org/iree/actions/runs/11714927110 (local error
disable)
* https://github.com/iree-org/iree/actions/runs/11716788601 (local error
disable, different check)

Working around the build break reported here:
* iree-org#18897 (comment)
* llvm/torch-mlir#3813 (comment)

Logs:
```
 FAILED: compiler/plugins/input/Torch/torch-mlir/CMakeFiles/iree_compiler_plugins_input_Torch_torch-mlir_TorchDialectIR.objects.dir/__/__/__/__/__/third_party/torch-mlir/lib/Dialect/Torch/IR/TorchOps.cpp.o
/usr/local/bin/ccache /usr/bin/g++-9  -I/__w/iree/iree -I/__w/iree/iree/build-gcc -I/__w/iree/iree/third_party/torch-mlir/include -I/__w/iree/iree/compiler/plugins/input/Torch -I/__w/iree/iree/build-gcc/compiler/plugins/input/Torch -I/__w/iree/iree/third_party/llvm-project/llvm/include -I/__w/iree/iree/build-gcc/llvm-project/include -I/__w/iree/iree/third_party/llvm-project/mlir/include -I/__w/iree/iree/build-gcc/llvm-project/tools/mlir/include -I/__w/iree/iree/third_party/llvm-project/lld/include -I/__w/iree/iree/build-gcc/llvm-project/tools/lld/include -O3  -fPIC -Wno-deprecated-declarations -fvisibility=hidden -fno-rtti -fno-exceptions -Wall -Werror -Wno-error=deprecated-declarations -Wno-address -Wno-address-of-packed-member -Wno-comment -Wno-format-zero-length -Wno-uninitialized -Wno-overloaded-virtual -Wno-invalid-offsetof -Wno-sign-compare -Wno-unused-function -Wno-unknown-pragmas -Wno-unused-but-set-variable -Wno-misleading-indentation -fmacro-prefix-map=/__w/iree/iree=iree -std=gnu++17 -MD -MT compiler/plugins/input/Torch/torch-mlir/CMakeFiles/iree_compiler_plugins_input_Torch_torch-mlir_TorchDialectIR.objects.dir/__/__/__/__/__/third_party/torch-mlir/lib/Dialect/Torch/IR/TorchOps.cpp.o -MF compiler/plugins/input/Torch/torch-mlir/CMakeFiles/iree_compiler_plugins_input_Torch_torch-mlir_TorchDialectIR.objects.dir/__/__/__/__/__/third_party/torch-mlir/lib/Dialect/Torch/IR/TorchOps.cpp.o.d -o compiler/plugins/input/Torch/torch-mlir/CMakeFiles/iree_compiler_plugins_input_Torch_torch-mlir_TorchDialectIR.objects.dir/__/__/__/__/__/third_party/torch-mlir/lib/Dialect/Torch/IR/TorchOps.cpp.o -c /__w/iree/iree/third_party/torch-mlir/lib/Dialect/Torch/IR/TorchOps.cpp
In file included from /usr/include/c++/9/cassert:44,
                 from /__w/iree/iree/third_party/llvm-project/llvm/include/llvm/Support/TypeSize.h:22,
                 from /__w/iree/iree/third_party/llvm-project/mlir/include/mlir/Interfaces/DataLayoutInterfaces.h:21,
                 from /__w/iree/iree/third_party/llvm-project/mlir/include/mlir/IR/BuiltinOps.h:21,
                 from /__w/iree/iree/third_party/llvm-project/mlir/include/mlir/IR/PatternMatch.h:13,
                 from /__w/iree/iree/third_party/torch-mlir/include/torch-mlir/Dialect/Torch/Utils/Utils.h:12,
                 from /__w/iree/iree/third_party/torch-mlir/lib/Dialect/Torch/IR/TorchOps.cpp:11:
/__w/iree/iree/third_party/torch-mlir/lib/Dialect/Torch/IR/TorchOps.cpp: In member function 'mlir::OpFoldResult mlir::torch::Torch::AtenSliceTensorOp::fold(mlir::torch::Torch::AtenSliceTensorOp::FoldAdaptor)':
/__w/iree/iree/third_party/torch-mlir/lib/Dialect/Torch/IR/TorchOps.cpp:4005:42: error: suggest parentheses around '&&' within '||' [-Werror=parentheses]
 4005 |            (stride < 0 && begin > limit) &&
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
 4006 |                "aten.slice.Tensor iteration args are statically invalid.");
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
```

Signed-off-by: Giacomo Serafini <179146510+giacs-epic@users.noreply.github.com>
  • Loading branch information
ScottTodd authored and giacs-epic committed Dec 4, 2024
1 parent edf8eef commit eaf3145
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions compiler/plugins/input/Torch/torch-mlir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
if(MSVC)
add_compile_options(/wd4996)
else()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options(-Wno-error=parentheses)
endif()
add_compile_options(-Wno-deprecated-declarations)
endif()

Expand Down

0 comments on commit eaf3145

Please sign in to comment.