Skip to content

Strict warning raised on pybind11 header in MLIR build step #1727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dime10 opened this issue May 7, 2025 · 0 comments
Open

Strict warning raised on pybind11 header in MLIR build step #1727

dime10 opened this issue May 7, 2025 · 0 comments

Comments

@dime10
Copy link
Contributor

dime10 commented May 7, 2025

In another issue, a user reported failing the make dialects step due to a warning raised in a pybind11 header together with out warnings as error policy. The issue could be circumvented with STRICT_WARNINGS=OFF.

Normally, upstream warnings are suppressed by marking include directories of dependencies as "system" headers. We can see this is in fact the case for some cmake header:

-isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/.venv/lib/python3.12/site-packages/pybind11/include

but this is a different directory than the one actually raising the error:

In file included from /usr/local/include/pybind11/pybind11.h:12:
In file included from /usr/local/include/pybind11/detail/class.h:12:
In file included from /usr/local/include/pybind11/attr.h:14:
In file included from /usr/local/include/pybind11/cast.h:15:
/usr/local/include/pybind11/detail/type_caster_base.h:568:13: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]

Full error log below:

cmake --build /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir//build --target check-dialects quantum-lsp-server catalyst-cli check-unit-tests
[3/135] Building CXX object python/CMakeFiles/QuantumPythonModules.extension._mlirLinalgPasses.dso.dir/__/llvm-project/mlir/lib/Bindings/Python/LinalgPasses.cpp.o
FAILED: python/CMakeFiles/QuantumPythonModules.extension._mlirLinalgPasses.dso.dir/__/llvm-project/mlir/lib/Bindings/Python/LinalgPasses.cpp.o 
/opt/homebrew/bin/ccache /usr/bin/clang++ -DMLIR_PYTHON_PACKAGE_PREFIX=mlir_quantum. -DQuantumPythonModules_extension__mlirLinalgPasses_dso_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/include -I/Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/build/include -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/llvm/include -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/build/include -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/mlir/include -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/build/tools/mlir/include -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/mlir-hlo -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/mlir-hlo/bazel-build -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/mlir-hlo/stablehlo -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/mlir-hlo/bazel-build/stablehlo -isystem /Library/Frameworks/Python.framework/Versions/3.12/include/python3.12 -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/.venv/lib/python3.12/site-packages/pybind11/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -O3 -DNDEBUG -std=gnu++20 -arch arm64 -fPIC -fvisibility=hidden   -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Wall -UNDEBUG -frtti -fexceptions -flto -Werror -MD -MT python/CMakeFiles/QuantumPythonModules.extension._mlirLinalgPasses.dso.dir/__/llvm-project/mlir/lib/Bindings/Python/LinalgPasses.cpp.o -MF python/CMakeFiles/QuantumPythonModules.extension._mlirLinalgPasses.dso.dir/__/llvm-project/mlir/lib/Bindings/Python/LinalgPasses.cpp.o.d -o python/CMakeFiles/QuantumPythonModules.extension._mlirLinalgPasses.dso.dir/__/llvm-project/mlir/lib/Bindings/Python/LinalgPasses.cpp.o -c /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/mlir/lib/Bindings/Python/LinalgPasses.cpp
In file included from /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/mlir/lib/Bindings/Python/LinalgPasses.cpp:11:
In file included from /usr/local/include/pybind11/pybind11.h:12:
In file included from /usr/local/include/pybind11/detail/class.h:12:
In file included from /usr/local/include/pybind11/attr.h:14:
In file included from /usr/local/include/pybind11/cast.h:15:
/usr/local/include/pybind11/detail/type_caster_base.h:568:13: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]
  568 |             default:
      |             ^
1 error generated.
[4/135] Building CXX object python/CMakeFiles/QuantumPythonModules.extension._mlirAsyncPasses.dso.dir/__/llvm-project/mlir/lib/Bindings/Python/AsyncPasses.cpp.o
FAILED: python/CMakeFiles/QuantumPythonModules.extension._mlirAsyncPasses.dso.dir/__/llvm-project/mlir/lib/Bindings/Python/AsyncPasses.cpp.o 
/opt/homebrew/bin/ccache /usr/bin/clang++ -DMLIR_PYTHON_PACKAGE_PREFIX=mlir_quantum. -DQuantumPythonModules_extension__mlirAsyncPasses_dso_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/include -I/Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/build/include -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/llvm/include -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/build/include -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/mlir/include -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/build/tools/mlir/include -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/mlir-hlo -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/mlir-hlo/bazel-build -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/mlir-hlo/stablehlo -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/mlir-hlo/bazel-build/stablehlo -isystem /Library/Frameworks/Python.framework/Versions/3.12/include/python3.12 -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/.venv/lib/python3.12/site-packages/pybind11/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -O3 -DNDEBUG -std=gnu++20 -arch arm64 -fPIC -fvisibility=hidden   -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Wall -UNDEBUG -frtti -fexceptions -flto -Werror -MD -MT python/CMakeFiles/QuantumPythonModules.extension._mlirAsyncPasses.dso.dir/__/llvm-project/mlir/lib/Bindings/Python/AsyncPasses.cpp.o -MF python/CMakeFiles/QuantumPythonModules.extension._mlirAsyncPasses.dso.dir/__/llvm-project/mlir/lib/Bindings/Python/AsyncPasses.cpp.o.d -o python/CMakeFiles/QuantumPythonModules.extension._mlirAsyncPasses.dso.dir/__/llvm-project/mlir/lib/Bindings/Python/AsyncPasses.cpp.o -c /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/mlir/lib/Bindings/Python/AsyncPasses.cpp
In file included from /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/mlir/lib/Bindings/Python/AsyncPasses.cpp:12:
In file included from /usr/local/include/pybind11/pybind11.h:12:
In file included from /usr/local/include/pybind11/detail/class.h:12:
In file included from /usr/local/include/pybind11/attr.h:14:
In file included from /usr/local/include/pybind11/cast.h:15:
/usr/local/include/pybind11/detail/type_caster_base.h:568:13: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]
  568 |             default:
      |             ^
1 error generated.
[5/135] Building CXX object python/CMakeFiles/QuantumPythonModules.extension._mlirGPUPasses.dso.dir/__/llvm-project/mlir/lib/Bindings/Python/GPUPasses.cpp.o
FAILED: python/CMakeFiles/QuantumPythonModules.extension._mlirGPUPasses.dso.dir/__/llvm-project/mlir/lib/Bindings/Python/GPUPasses.cpp.o 
/opt/homebrew/bin/ccache /usr/bin/clang++ -DMLIR_PYTHON_PACKAGE_PREFIX=mlir_quantum. -DQuantumPythonModules_extension__mlirGPUPasses_dso_EXPORTS -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/include -I/Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/build/include -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/llvm/include -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/build/include -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/mlir/include -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/build/tools/mlir/include -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/mlir-hlo -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/mlir-hlo/bazel-build -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/mlir-hlo/stablehlo -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/mlir-hlo/bazel-build/stablehlo -isystem /Library/Frameworks/Python.framework/Versions/3.12/include/python3.12 -isystem /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/.venv/lib/python3.12/site-packages/pybind11/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -O3 -DNDEBUG -std=gnu++20 -arch arm64 -fPIC -fvisibility=hidden   -D_DEBUG -D_GLIBCXX_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Wall -UNDEBUG -frtti -fexceptions -flto -Werror -MD -MT python/CMakeFiles/QuantumPythonModules.extension._mlirGPUPasses.dso.dir/__/llvm-project/mlir/lib/Bindings/Python/GPUPasses.cpp.o -MF python/CMakeFiles/QuantumPythonModules.extension._mlirGPUPasses.dso.dir/__/llvm-project/mlir/lib/Bindings/Python/GPUPasses.cpp.o.d -o python/CMakeFiles/QuantumPythonModules.extension._mlirGPUPasses.dso.dir/__/llvm-project/mlir/lib/Bindings/Python/GPUPasses.cpp.o -c /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/mlir/lib/Bindings/Python/GPUPasses.cpp
In file included from /Users/yannick/Documents/TUM/CDA/Research/playgrounds/Catalyst/catalyst/mlir/llvm-project/mlir/lib/Bindings/Python/GPUPasses.cpp:12:
In file included from /usr/local/include/pybind11/pybind11.h:12:
In file included from /usr/local/include/pybind11/detail/class.h:12:
In file included from /usr/local/include/pybind11/attr.h:14:
In file included from /usr/local/include/pybind11/cast.h:15:
/usr/local/include/pybind11/detail/type_caster_base.h:568:13: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]
  568 |             default:
      |             ^
1 error generated.
[12/135] Building CXX object python/CMakeFiles/QuantumPythonModules.extension._mlirDialectsSparseTensor.dso.dir/__/llvm-project/mlir/lib/Bindings/Python/DialectSparseTensor.cpp.o
ninja: build stopped: subcommand failed.
make[1]: *** [dialects] Error 1
make: *** [mlir] Error 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant