在编译本地torch7软件包时,如何解决这个“luarocks make”错误?

时间:2016-03-13 11:46:51

标签: cmake torch luarocks

我正在尝试用github spectral-lib(Ubuntu 14.04,cuda 7.0,安装了torch7)构建一个用torch7(C,cuda,lua)编写的软件包。我用这个命令来构建它: luarocks make --local

然而,发生了如下奇怪的错误:

...
Scanning dependencies of target spectralnet
[100%] Building CXX object CMakeFiles/spectralnet.dir/cuda/cufft.cpp.o
Linking CXX shared module libspectralnet.so
/usr/bin/ld: cannot find -lcufft
collect2: error: ld returned 1 exit status
make[2]: *** [libspectralnet.so] Error 1
make[1]: *** [CMakeFiles/spectralnet.dir/all] Error 2
make: *** [all] Error 2

我可以在libcufft.so中找到“/usr/local/cuda/lib64”。 也许这个错误与CMakeLists.txt有关,但我不熟悉它。任何人都可以帮我一把吗?

1 个答案:

答案 0 :(得分:1)

通过修改CMakeLists.txt解决。我将libcufft.so复制到./cuda并添加:

SET(PROJECT_LINK_LIBS libcufft.so )
LINK_DIRECTORIES(/net/wanggu/spectral-lib/cuda)

作者的CMakeLists.txt可能对cuda动态库的方向有一些问题。可能存在一些更好的解决方案,但这是暂时的解决方案。