Skip to content
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

#error C++17 or later compatible compiler is required to use PyTorch #221

Open
DewiBrynJones opened this issue Nov 6, 2023 · 0 comments

Comments

@DewiBrynJones
Copy link

DewiBrynJones commented Nov 6, 2023

ctcdecode setup fails with the latest pytorch (as of November 2023 - 2.1.0).

The complete error message is...

In file included from /usr/local/lib/python3.10/dist-packages/torch/include/torch/csrc/api/include/torch/torch.h:3,
88.33                        from ctcdecode/src/binding.cpp:5:
88.33       /usr/local/lib/python3.10/dist-packages/torch/include/torch/csrc/api/include/torch/all.h:4:2: error: #error C++17 or later compatible compiler is required to use PyTorch.
88.33           4 | #error C++17 or later compatible compiler is required to use PyTorch.
88.33             |  ^~~~~
88.33       In file included from /usr/local/lib/python3.10/dist-packages/torch/include/c10/util/string_view.h:4,
88.33                        from /usr/local/lib/python3.10/dist-packages/torch/include/c10/util/StringUtil.h:6,
88.33                        from /usr/local/lib/python3.10/dist-packages/torch/include/c10/util/Exception.h:5,
88.33                        from /usr/local/lib/python3.10/dist-packages/torch/include/c10/core/Device.h:5,
88.33                        from /usr/local/lib/python3.10/dist-packages/torch/include/ATen/core/TensorBody.h:11,
88.33                        from /usr/local/lib/python3.10/dist-packages/torch/include/ATen/core/Tensor.h:3,
88.33                        from /usr/local/lib/python3.10/dist-packages/torch/include/ATen/Tensor.h:3,
88.33                        from /usr/local/lib/python3.10/dist-packages/torch/include/torch/csrc/autograd/function_hook.h:3,
88.33                        from /usr/local/lib/python3.10/dist-packages/torch/include/torch/csrc/autograd/cpp_hook.h:2,
88.33                        from /usr/local/lib/python3.10/dist-packages/torch/include/torch/csrc/autograd/variable.h:6,
88.33                        from /usr/local/lib/python3.10/dist-packages/torch/include/torch/csrc/autograd/autograd.h:3,
88.33                        from /usr/local/lib/python3.10/dist-packages/torch/include/torch/csrc/api/include/torch/autograd.h:3,
88.33                        from /usr/local/lib/python3.10/dist-packages/torch/include/torch/csrc/api/include/torch/all.h:7,
88.33                        from /usr/local/lib/python3.10/dist-packages/torch/include/torch/csrc/api/include/torch/torch.h:3,
88.33                        from ctcdecode/src/binding.cpp:5:
88.33       /usr/local/lib/python3.10/dist-packages/torch/include/c10/util/C++17.h:27:2: error: #error You need C++17 to compile PyTorch 

Bumping up the C++ standard from 14 to 17 in the setup.py's compile flags doesn't seem to fix it.

https://github.com/DewiBrynJones/ctcdecode/blob/master/setup.py#L57

I have gcc 11.4 on Ubuntu 22.04, (which does support c++17)

Only pre-installing torch==2.01 fixes the setup error for the time being.

Thanks!

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