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

src/binding.cpp:1:10: fatal error: 'iostream' file not found #129

Open
mumuyanyan opened this issue May 16, 2019 · 2 comments
Open

src/binding.cpp:1:10: fatal error: 'iostream' file not found #129

mumuyanyan opened this issue May 16, 2019 · 2 comments

Comments

@mumuyanyan
Copy link

Torch was not built with CUDA support, not building warp-ctc GPU extensions.
running install
running bdist_egg
running egg_info
creating warpctc_pytorch.egg-info
writing warpctc_pytorch.egg-info/PKG-INFO
writing dependency_links to warpctc_pytorch.egg-info/dependency_links.txt
writing top-level names to warpctc_pytorch.egg-info/top_level.txt
writing manifest file 'warpctc_pytorch.egg-info/SOURCES.txt'
reading manifest file 'warpctc_pytorch.egg-info/SOURCES.txt'
writing manifest file 'warpctc_pytorch.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.7-x86_64/egg
running install_lib
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
creating build/lib.macosx-10.7-x86_64-3.6/warpctc_pytorch
copying warpctc_pytorch/init.py -> build/lib.macosx-10.7-x86_64-3.6/warpctc_pytorch
running build_ext
/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/utils/cpp_extension.py:166: UserWarning:

                           !! WARNING !!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (g++) is not compatible with the compiler Pytorch was
built with for this platform, which is clang++ on darwin. Please
use clang++ to to compile your extension. Alternatively, you may
compile PyTorch from source using g++, and then you can also use
g++ to compile your extension.

See https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md for help
with compiling PyTorch from source.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                          !! WARNING !!

platform=sys.platform))
building 'warpctc_pytorch._warp_ctc' extension
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/liushihan/anaconda/envs/chineseocr/include -arch x86_64 -I/Users/liushihan/anaconda/envs/chineseocr/include -arch x86_64 -I/Users/liushihan/PycharmProjects/deep2/warp-ctc/include -I/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/include -I/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/include/TH -I/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/include/THC -I/Users/liushihan/anaconda/envs/chineseocr/include/python3.6m -c src/binding.cpp -o build/temp.macosx-10.7-x86_64-3.6/src/binding.o -std=c++11 -fPIC -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_warp_ctc -D_GLIBCXX_USE_CXX11_ABI=0
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
src/binding.cpp:1:10: fatal error: 'iostream' file not found
#include
^~~~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
(chineseocr) liushihandeMacBook-Pro:pytorch_binding liushihan$ python setup.py install
Torch was not built with CUDA support, not building warp-ctc GPU extensions.
running install
running bdist_egg
running egg_info
writing warpctc_pytorch.egg-info/PKG-INFO
writing dependency_links to warpctc_pytorch.egg-info/dependency_links.txt
writing top-level names to warpctc_pytorch.egg-info/top_level.txt
reading manifest file 'warpctc_pytorch.egg-info/SOURCES.txt'
writing manifest file 'warpctc_pytorch.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.7-x86_64/egg
running install_lib
running build_py
running build_ext
/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/utils/cpp_extension.py:166: UserWarning:

                           !! WARNING !!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (g++) is not compatible with the compiler Pytorch was
built with for this platform, which is clang++ on darwin. Please
use clang++ to to compile your extension. Alternatively, you may
compile PyTorch from source using g++, and then you can also use
g++ to compile your extension.

See https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md for help
with compiling PyTorch from source.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                          !! WARNING !!

platform=sys.platform))
building 'warpctc_pytorch._warp_ctc' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/liushihan/anaconda/envs/chineseocr/include -arch x86_64 -I/Users/liushihan/anaconda/envs/chineseocr/include -arch x86_64 -I/Users/liushihan/PycharmProjects/deep2/warp-ctc/include -I/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/include -I/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/include/TH -I/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/include/THC -I/Users/liushihan/anaconda/envs/chineseocr/include/python3.6m -c src/binding.cpp -o build/temp.macosx-10.7-x86_64-3.6/src/binding.o -std=c++11 -fPIC -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_warp_ctc -D_GLIBCXX_USE_CXX11_ABI=0
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
src/binding.cpp:1:10: fatal error: 'iostream' file not found
#include
^~~~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
(chineseocr) liushihandeMacBook-Pro:pytorch_binding liushihan$ python setup.py install
Torch was not built with CUDA support, not building warp-ctc GPU extensions.
running install
running bdist_egg
running egg_info
writing warpctc_pytorch.egg-info/PKG-INFO
writing dependency_links to warpctc_pytorch.egg-info/dependency_links.txt
writing top-level names to warpctc_pytorch.egg-info/top_level.txt
reading manifest file 'warpctc_pytorch.egg-info/SOURCES.txt'
writing manifest file 'warpctc_pytorch.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.7-x86_64/egg
running install_lib
running build_py
running build_ext
/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/utils/cpp_extension.py:166: UserWarning:

                           !! WARNING !!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (g++) is not compatible with the compiler Pytorch was
built with for this platform, which is clang++ on darwin. Please
use clang++ to to compile your extension. Alternatively, you may
compile PyTorch from source using g++, and then you can also use
g++ to compile your extension.

See https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md for help
with compiling PyTorch from source.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                          !! WARNING !!

platform=sys.platform))
building 'warpctc_pytorch._warp_ctc' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/liushihan/anaconda/envs/chineseocr/include -arch x86_64 -I/Users/liushihan/anaconda/envs/chineseocr/include -arch x86_64 -I/Users/liushihan/PycharmProjects/deep2/warp-ctc/include -I/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/include -I/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/include/TH -I/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/include/THC -I/Users/liushihan/anaconda/envs/chineseocr/include/python3.6m -c src/binding.cpp -o build/temp.macosx-10.7-x86_64-3.6/src/binding.o -std=c++11 -fPIC -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_warp_ctc -D_GLIBCXX_USE_CXX11_ABI=0
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
src/binding.cpp:1:10: fatal error: 'iostream' file not found
#include
^~~~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1
(chineseocr) liushihandeMacBook-Pro:pytorch_binding liushihan$ python setup.py install
Torch was not built with CUDA support, not building warp-ctc GPU extensions.
running install
running bdist_egg
running egg_info
writing warpctc_pytorch.egg-info/PKG-INFO
writing dependency_links to warpctc_pytorch.egg-info/dependency_links.txt
writing top-level names to warpctc_pytorch.egg-info/top_level.txt
reading manifest file 'warpctc_pytorch.egg-info/SOURCES.txt'
writing manifest file 'warpctc_pytorch.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.7-x86_64/egg
running install_lib
running build_py
running build_ext
/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/utils/cpp_extension.py:166: UserWarning:

                           !! WARNING !!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Your compiler (g++) is not compatible with the compiler Pytorch was
built with for this platform, which is clang++ on darwin. Please
use clang++ to to compile your extension. Alternatively, you may
compile PyTorch from source using g++, and then you can also use
g++ to compile your extension.

See https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md for help
with compiling PyTorch from source.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

                          !! WARNING !!

platform=sys.platform))
building 'warpctc_pytorch._warp_ctc' extension
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/liushihan/anaconda/envs/chineseocr/include -arch x86_64 -I/Users/liushihan/anaconda/envs/chineseocr/include -arch x86_64 -I/Users/liushihan/PycharmProjects/deep2/warp-ctc/include -I/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/include -I/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/include/torch/csrc/api/include -I/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/include/TH -I/Users/liushihan/anaconda/envs/chineseocr/lib/python3.6/site-packages/torch/include/THC -I/Users/liushihan/anaconda/envs/chineseocr/include/python3.6m -c src/binding.cpp -o build/temp.macosx-10.7-x86_64-3.6/src/binding.o -std=c++11 -fPIC -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_warp_ctc -D_GLIBCXX_USE_CXX11_ABI=0
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
src/binding.cpp:1:10: fatal error: 'iostream' file not found
#include
^~~~~~~~~~
1 warning and 1 error generated.
error: command 'gcc' failed with exit status 1

@r9y9
Copy link
Contributor

r9y9 commented Jun 15, 2019

I think I've hit the same issue. Workaround for me:

MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install

The problem is that recent Xcode CLI tools don't ship libstdc++, while the cpp extension is going to be built with libstdc++ by default on OSX (to be compatible with older versions of OSX). The easiest way to tell the cpp extension to use libc++ instead is that to set MACOSX_DEPLOYMENT_TARGET to 10.9.

Ref: pytorch/pytorch#16805 (comment), https://stackoverflow.com/questions/50694822/xcode-10-ios-12-does-not-contain-libstdc6-0-9

@USTC-Keyanjie
Copy link

@r9y9 Thanks very much, that solves the problem for me!
I run export MACOSX_DEPLOYMENT_TARGET=10.9 before python setup.py install and installed warp-ctc successfully.

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