Open mumuyanyan opened 5 years ago
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: https://github.com/pytorch/pytorch/issues/16805#issuecomment-478525773, https://stackoverflow.com/questions/50694822/xcode-10-ios-12-does-not-contain-libstdc6-0-9
@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.
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:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 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. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 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. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 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. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 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. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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