执行
1 |
$ luarocks install cutorch |
发生如下错误:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
[ 88%] Building C object lib/THC/CMakeFiles/THC.dir/THCStorageCopy.c.o In file included from generic/THCTensor.c:1:0, from /tmp/luarocks_cutorch-scm-1-8069/cutorch/lib/THC/THCGenerateAllTypes.h:17, from /tmp/luarocks_cutorch-scm-1-8069/cutorch/lib/THC/THCTensor.c:7: /tmp/luarocks_cutorch-scm-1-8069/cutorch/lib/THC/generic/THCTensor.c: In function ‘THCudaByteTensor_newExpand’: /tmp/luarocks_cutorch-scm-1-8069/cutorch/lib/THC/generic/THCTensor.c:304:3: error: implicit declaration of function ‘THLongStorage_calculateExpandGeometry’ [-Werror=implicit-function-declaration] THLongStorage_calculateExpandGeometry(tensor->size, ^ [ 90%] Building C object lib/THC/CMakeFiles/THC.dir/THCThreadLocal.c.o cc1: some warnings being treated as errors lib/THC/CMakeFiles/THC.dir/build.make:686: recipe for target 'lib/THC/CMakeFiles/THC.dir/THCTensor.c.o' failed make[2]: *** [lib/THC/CMakeFiles/THC.dir/THCTensor.c.o] Error 1 CMakeFiles/Makefile2:172: recipe for target 'lib/THC/CMakeFiles/THC.dir/all' failed make[1]: *** [lib/THC/CMakeFiles/THC.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2 Error: Build error: Failed building. |
解决方法为:
1 2 |
$ luarocks install torch $ luarocks install cutorch |
参考链接
error: implicit declaration of function ‘THLongStorage_calculateExpandGeometry’