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

Build failure: audio/torchaudio/csrc/decoder/src/decoder/Utils.h:23:40: error: ‘numeric_limits’ is not a member of ‘std’ #2445

Closed
kwand opened this issue Jun 5, 2022 · 2 comments
Milestone

Comments

@kwand
Copy link

kwand commented Jun 5, 2022

🐛 Describe the bug

I encountered the following build error after cloning the master branch and attempting to build/install it using CC=gcc-11 CXX=g++-11 python setup.py install --user

[3/44] /usr/bin/g++-11 -DBUILD_CTC_DECODER -DHAVE_BZLIB -DHAVE_XZLIB -DHAVE_ZLIB -DINCLUDE_KALDI -DINCLUDE_SOX -DKENLM_MAX_ORDER=6 -DUSE_C10D_GLOO -DUSE_C10D_MPI -DUSE_C10D_NCCL -DUSE_CUDA -DUSE_DISTRIBUTED -DUSE_RPC -DUSE_TENSORPIPE -Dlibtorchaudio_decoder_EXPORTS -I/home/dkwan/Github/Builds/audio -I/home/dkwan/Github/Builds/audio/third_party/kenlm/submodule -I/home/dkwan/Github/Builds/audio/third_party/zlib/../install/include -I/home/dkwan/Github/Builds/audio/third_party/bzip2/../install/include -I/home/dkwan/Github/Builds/audio/third_party/lzma/../install/include -isystem /home/dkwan/.local/lib/python3.10/site-packages/torch/include -isystem /home/dkwan/.local/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -isystem /opt/cuda/include -Wall -D_GLIBCXX_USE_CXX11_ABI=1 -O3 -DNDEBUG -fPIC -D_GLIBCXX_USE_CXX11_ABI=1 -std=gnu++14 -MD -MT torchaudio/csrc/CMakeFiles/libtorchaudio_decoder.dir/decoder/src/decoder/LexiconFreeDecoder.cpp.o -MF torchaudio/csrc/CMakeFiles/libtorchaudio_decoder.dir/decoder/src/decoder/LexiconFreeDecoder.cpp.o.d -o torchaudio/csrc/CMakeFiles/libtorchaudio_decoder.dir/decoder/src/decoder/LexiconFreeDecoder.cpp.o -c /home/dkwan/Github/Builds/audio/torchaudio/csrc/decoder/src/decoder/LexiconFreeDecoder.cpp
FAILED: torchaudio/csrc/CMakeFiles/libtorchaudio_decoder.dir/decoder/src/decoder/LexiconFreeDecoder.cpp.o 
/usr/bin/g++-11 -DBUILD_CTC_DECODER -DHAVE_BZLIB -DHAVE_XZLIB -DHAVE_ZLIB -DINCLUDE_KALDI -DINCLUDE_SOX -DKENLM_MAX_ORDER=6 -DUSE_C10D_GLOO -DUSE_C10D_MPI -DUSE_C10D_NCCL -DUSE_CUDA -DUSE_DISTRIBUTED -DUSE_RPC -DUSE_TENSORPIPE -Dlibtorchaudio_decoder_EXPORTS -I/home/dkwan/Github/Builds/audio -I/home/dkwan/Github/Builds/audio/third_party/kenlm/submodule -I/home/dkwan/Github/Builds/audio/third_party/zlib/../install/include -I/home/dkwan/Github/Builds/audio/third_party/bzip2/../install/include -I/home/dkwan/Github/Builds/audio/third_party/lzma/../install/include -isystem /home/dkwan/.local/lib/python3.10/site-packages/torch/include -isystem /home/dkwan/.local/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -isystem /opt/cuda/include -Wall -D_GLIBCXX_USE_CXX11_ABI=1 -O3 -DNDEBUG -fPIC -D_GLIBCXX_USE_CXX11_ABI=1 -std=gnu++14 -MD -MT torchaudio/csrc/CMakeFiles/libtorchaudio_decoder.dir/decoder/src/decoder/LexiconFreeDecoder.cpp.o -MF torchaudio/csrc/CMakeFiles/libtorchaudio_decoder.dir/decoder/src/decoder/LexiconFreeDecoder.cpp.o.d -o torchaudio/csrc/CMakeFiles/libtorchaudio_decoder.dir/decoder/src/decoder/LexiconFreeDecoder.cpp.o -c /home/dkwan/Github/Builds/audio/torchaudio/csrc/decoder/src/decoder/LexiconFreeDecoder.cpp
In file included from /home/dkwan/Github/Builds/audio/torchaudio/csrc/decoder/src/decoder/Decoder.h:10,
                 from /home/dkwan/Github/Builds/audio/torchaudio/csrc/decoder/src/decoder/LexiconFreeDecoder.h:12,
                 from /home/dkwan/Github/Builds/audio/torchaudio/csrc/decoder/src/decoder/LexiconFreeDecoder.cpp:14:
/home/dkwan/Github/Builds/audio/torchaudio/csrc/decoder/src/decoder/Utils.h:23:40: error: ‘numeric_limits’ is not a member of ‘std’
   23 | const double kNegativeInfinity = -std::numeric_limits<double>::infinity();
      |                                        ^~~~~~~~~~~~~~
/home/dkwan/Github/Builds/audio/torchaudio/csrc/decoder/src/decoder/Utils.h:23:55: error: expected primary-expression before ‘double’
   23 | const double kNegativeInfinity = -std::numeric_limits<double>::infinity();

It seems the problem is a missing #include <limits> import in the Utils.h file? I added this in and then I was able to build successfully.

Versions

(This was collected after a successful build after adding the seemingly missing #include line. Also note that my system default compiler is GCC 12, which I did not use as per the command I ran in the previous section)

Collecting environment information...
PyTorch version: 1.13.0a0+gitac8c6d0
Is debug build: False
CUDA used to build PyTorch: 11.6
ROCM used to build PyTorch: N/A

OS: EndeavourOS Linux (x86_64)
GCC version: (GCC) 12.1.0
Clang version: Could not collect
CMake version: version 3.23.2
Libc version: glibc-2.35

Python version: 3.10.4 (main, May 14 2022, 05:21:19) [GCC 12.1.0] (64-bit runtime)
Python platform: Linux-5.18.1-xanmod1-1-native_amd-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 11.6.124
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 3090
Nvidia driver version: 515.43.04
cuDNN version: Probably one of the following:
/usr/lib/libcudnn.so.8.4.0
/usr/lib/libcudnn_adv_infer.so.8.4.0
/usr/lib/libcudnn_adv_train.so.8.4.0
/usr/lib/libcudnn_cnn_infer.so.8.4.0
/usr/lib/libcudnn_cnn_train.so.8.4.0
/usr/lib/libcudnn_ops_infer.so.8.4.0
/usr/lib/libcudnn_ops_train.so.8.4.0
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] functorch==0.2.0a0+db12967
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.22.3
[pip3] torch==1.13.0a0+gitac8c6d0
[pip3] torchaudio==0.12.0a0+a63629b
[pip3] torchvision==0.14.0a0+c890a7e
[conda] Could not collect
@mthrok
Copy link
Collaborator

mthrok commented Jun 5, 2022

Hi @kwand

Thanks for the report. This might be the cause.

@carolineechen Can we add this line? It seems hurmless fix.

@mthrok mthrok added this to the v0.12 milestone Jun 6, 2022
mthrok added a commit to mthrok/audio that referenced this issue Jun 6, 2022
jacobkahn added a commit to jacobkahn/text that referenced this issue Jun 6, 2022
Summary: torchaudio builders report pytorch/audio#2445 with gcc 12. Fix it upstream and add a CI baseline for gcc 12

Differential Revision: D36952141

fbshipit-source-id: f998521fb4d5e7dffe6be08f1ff48862eca30a28
@jacobkahn
Copy link

Fixed upstream as well in flashlight/text#5 — thanks for reporting, @kwand.

facebook-github-bot pushed a commit to flashlight/text that referenced this issue Jun 6, 2022
Summary:
Pull Request resolved: #5

torchaudio builders report pytorch/audio#2445 with gcc 12. Fix it upstream and add a CI baseline for gcc 12

Reviewed By: richdutton

Differential Revision: D36952141

fbshipit-source-id: 7f46ac1744723b684510fd9068728b407f910322
facebook-github-bot pushed a commit that referenced this issue Jun 7, 2022
Summary:
Address #2445

Pull Request resolved: #2450

Reviewed By: carolineechen

Differential Revision: D36945877

Pulled By: mthrok

fbshipit-source-id: c7f9ba8093c8dc03b27582b9c608b023c7700332
@mthrok mthrok closed this as completed Jun 7, 2022
mthrok added a commit that referenced this issue Jun 7, 2022
Summary:
Address #2445

Pull Request resolved: #2450

Reviewed By: carolineechen

Differential Revision: D36945877

Pulled By: mthrok

fbshipit-source-id: c7f9ba8093c8dc03b27582b9c608b023c7700332
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

3 participants