SeanNaren / warp-ctc

Pytorch Bindings for warp-ctc
Apache License 2.0
756 stars 271 forks source link

pytorch_binding setup.py error #127

Closed jiaqi71 closed 5 years ago

jiaqi71 commented 5 years ago

when I run : python setup.py install I come across the following problems:

generating build/warpctc_pytorch/_warp_ctc/warp_ctc.c (already up-to-date) not modified: 'build/warpctc_pytorch/_warp_ctc/warp_ctc.c' 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.linux-x86_64/egg running install_lib running build_py copying warpctc_pytorch/_warp_ctc/init.py -> build/lib.linux-x86_64-3.7/warpctc_pytorch/_warp_ctc running build_ext building 'warpctc_pytorch._warp_ctc.warp_ctc' extension gcc -pthread -B /home/xjtu238/anaconda3/envs/pytorch0.4.1/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/xjtu238/anaconda3/envs/pytorch0.4.1/lib/python3.7/site-packages/torch/utils/ffi/../../lib/include -I/home/xjtu238/anaconda3/envs/pytorch0.4.1/lib/python3.7/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/xjtu238/anaconda3/envs/pytorch0.4.1/lib/python3.7/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/xjtu238/jiaqi/warp-ctc/include -I/home/xjtu238/anaconda3/envs/pytorch0.4.1/include/python3.7m -c build/warpctc_pytorch/_warp_ctc/__warp_ctc.c -o build/temp.linux-x86_64-3.7/build/warpctc_pytorch/_warp_ctc/warp_ctc.o -std=c99 -std=c++11 -fPIC -std=c99 -DWARPCTC_ENABLE_GPU cc1: warning: command line option ‘-std=c++11’ is valid for C++/ObjC++ but not for C [enabled by default] gcc -pthread -B /home/xjtu238/anaconda3/envs/pytorch0.4.1/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/xjtu238/anaconda3/envs/pytorch0.4.1/lib/python3.7/site-packages/torch/utils/ffi/../../lib/include -I/home/xjtu238/anaconda3/envs/pytorch0.4.1/lib/python3.7/site-packages/torch/utils/ffi/../../lib/include/TH -I/home/xjtu238/anaconda3/envs/pytorch0.4.1/lib/python3.7/site-packages/torch/utils/ffi/../../lib/include/THC -I/usr/local/cuda/include -I/home/xjtu238/jiaqi/warp-ctc/include -I/home/xjtu238/anaconda3/envs/pytorch0.4.1/include/python3.7m -c /home/xjtu238/jiaqi/warp-ctc/pytorch_binding/src/binding.cpp -o build/temp.linux-x86_64-3.7/home/xjtu238/jiaqi/warp-ctc/pytorch_binding/src/binding.o -std=c99 -std=c++11 -fPIC -std=c99 -DWARPCTC_ENABLE_GPU cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option ‘-std=c99’ is valid for C/ObjC but not for C++ [enabled by default] cc1plus: warning: command line option ‘-std=c99’ is valid for C/ObjC but not for C++ [enabled by default] g++ -pthread -shared -B /home/xjtu238/anaconda3/envs/pytorch0.4.1/compiler_compat -L/home/xjtu238/anaconda3/envs/pytorch0.4.1/lib -Wl,-rpath=/home/xjtu238/anaconda3/envs/pytorch0.4.1/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/build/warpctc_pytorch/_warp_ctc/__warp_ctc.o build/temp.linux-x86_64-3.7/home/xjtu238/jiaqi/warp-ctc/pytorch_binding/src/binding.o -L/home/xjtu238/jiaqi/warp-ctc/build -lwarpctc -o build/lib.linux-x86_64-3.7/warpctc_pytorch/_warp_ctc/__warp_ctc.cpython-37m-x86_64-linux-gnu.so -Wl,-rpath,/home/xjtu238/jiaqi/warp-ctc/build /home/xjtu238/anaconda3/envs/pytorch0.4.1/compiler_compat/ld: cannot find -lm collect2: error: ld returned 1 exit status error: command 'g++' failed with exit status 1

could anyone can help? thanks

SeanNaren commented 5 years ago

Update to PyTorch 1.0 (conda install pytorch -c pytorch) and see if this helps!