执行"luarocks install cutorch"发生错误"error: implicit declaration of function 'THLongStorage_calculateExpandGeometry'"

执行

$ luarocks install cutorch

发生如下错误:

[ 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.

解决方法为:

$ luarocks install torch
$ luarocks install cutorch

参考链接


error: implicit declaration of function ‘THLongStorage_calculateExpandGeometry’

发布者

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注