Reputation: 1585
I am trying to building a package written in torch7(C,cuda,lua) from github spectral-lib(Ubuntu 14.04, cuda 7.0, torch7 installed). I use this command to build it:
luarocks make --local
.
However, strange errors occurred as below:
...
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
I can find that "libcufft.so
" is in /usr/local/cuda/lib64
.
Maybe this error is related to the CMakeLists.txt, but I'm not familiar with it. Can anyone give me a hand?
Upvotes: 2
Views: 631
Reputation: 1585
Solved by modifying the CMakeLists.txt. I copy libcufft.so
to ./cuda and add:
SET(PROJECT_LINK_LIBS libcufft.so )
LINK_DIRECTORIES(/net/wanggu/spectral-lib/cuda)
The author's CMakeLists.txt may have some problem with the directions of cuda dynamic libraries. There may exist some better solutions, but this is a temporary solution for now.
Upvotes: 1