我正在尝试构建https://github.com/SeanNaren/warp-ctc.git在谷歌Colab上,关注这个笔记本。我在Colab:上使用这些命令
!git clone https://github.com/SeanNaren/warp-ctc.git;
cd warp-ctc;
mkdir build;
cd build;
cmake ..;
make;
但我收到了一个构建错误:
[-11%] Building NVCC (Device) object CMakeFiles/warpctc.dir/src/warpctc_generated_ctc_entrypoint.cu.o
/content/drive/My Drive/simple_hwr/warp-ctc/src/ctc_entrypoint.cu(1): error: this declaration has no storage class or type specifier
/content/drive/My Drive/simple_hwr/warp-ctc/src/ctc_entrypoint.cu(1): error: expected a ";"
2 errors detected in the compilation of "/tmp/tmpxft_00000191_00000000-13_ctc_entrypoint.compute_70.cpp1.ii".
CMake Error at warpctc_generated_ctc_entrypoint.cu.o.cmake:279 (message):
Error generating file /content/drive/My
Drive/simple_hwr/warp-ctc/build/CMakeFiles/warpctc.dir/src/./warpctc_generated_ctc_entrypoint.cu.o
CMakeFiles/warpctc.dir/build.make:220: recipe for target 'CMakeFiles/warpctc.dir/src/warpctc_generated_ctc_entrypoint.cu.o' failed
make[2]: *** [CMakeFiles/warpctc.dir/src/warpctc_generated_ctc_entrypoint.cu.o] Error 1
CMakeFiles/Makefile2:146: recipe for target 'CMakeFiles/warpctc.dir/all' failed
make[1]: *** [CMakeFiles/warpctc.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
如何解决这一问题?
这篇文章记录了这个问题的明显修复,它也影响了原始的warp-ctc存储库:
[…]ctc_entrypoint.cu文件需要是符号链接。因此,转到src-dir并运行:
rm ctc_entrypoint.cu ln -s ctc_entrypoint.cpp ctc_entrypoint.cu
然后,重新运行make
,这将解决问题。