Reputation: 27
I am getting the error while running make-and-install.sh caffe . I have linked the /usr/local/cuda/libcudart.so to /usr/lib/libcudart.so and other files also
g++ .build_release/tools/caffe.o .build_release/lib/libcaffe.a -o .build_release/tools/caffe.bin -fPIC -DNDEBUG -O2 -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I.build_release/src -I./src -I./include -I/usr/local/include/opencv2/core/include -Wall -Wno-sign-compare -L/usr/lib -L/usr/local/lib -L/usr/lib -L/usr/local/include/opencv2/core/lib -lcudart -lcublas -lcurand -lglog -lgflags -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_imgproc -lpthread -lboost_thread -lopenblas
g++ .build_release/tools/dump_network.o .build_release/lib/libcaffe.a -o .build_release/tools/dump_network.bin -fPIC -DNDEBUG -O2 -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I.build_release/src -I./src -I./include -I/usr/local/include/opencv2/core/include -Wall -Wno-sign-compare -L/usr/lib -L/usr/local/lib -L/usr/lib -L/usr/local/include/opencv2/core/lib -lcudart -lcublas -lcurand -lglog -lgflags -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_imgproc -lpthread -lboost_thread -lopenblas
g++ .build_release/tools/extract_features.o .build_release/lib/libcaffe.a -o .build_release/tools/extract_features.bin -fPIC -DNDEBUG -O2 -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I.build_release/src -I./src -I./include -I/usr/local/include/opencv2/core/include -Wall -Wno-sign-compare -L/usr/lib -L/usr/local/lib -L/usr/lib -L/usr/local/include/opencv2/core/lib -lcudart -lcublas -lcurand -lglog -lgflags -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_imgproc -lpthread -lboost_thread -lopenblas
/usr/bin/ld: cannot find -lcudart
/usr/bin/ld: cannot find -lcublas
/usr/bin/ld: cannot find -lcurand
collect2: ld returned 1 exit status
make: *** [.build_release/tools/extract_features.bin] Error 1
make: *** Waiting for unfinished jobs....
/usr/bin/ld: cannot find -lcudart
/usr/bin/ld: cannot find -lcublas
/usr/bin/ld: cannot find -lcurand
collect2: ld returned 1 exit status
make: *** [.build_release/tools/dump_network.bin] Error 1
/usr/bin/ld: cannot find -lcudart
/usr/bin/ld: cannot find -lcublas
/usr/bin/ld: cannot find -lcurand
collect2: ld returned 1 exit status
make: *** [.build_release/tools/caffe.bin] Error 1
g++ .build_release/tools/caffe.o .build_release/lib/libcaffe.a -o .build_release/tools/caffe.bin -fPIC -DNDEBUG -O2 -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I.build_release/src -I./src -I./include -I/usr/local/include/opencv2/core/include -Wall -Wno-sign-compare -L/usr/lib -L/usr/local/lib -L/usr/lib -L/usr/local/include/opencv2/core/lib -lcudart -lcublas -lcurand -lglog -lgflags -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_imgproc -lpthread -lboost_thread -lopenblas
/usr/bin/ld: cannot find -lcudart
/usr/bin/ld: cannot find -lcublas
/usr/bin/ld: cannot find -lcurand
collect2: ld returned 1 exit status
make: *** [.build_release/tools/caffe.bin] Error 1
tarun@tarun-Inspiron-3542:~/Desktop/SA_project/sirius-caffe$ ln -s /usr/local/cuda/lib/libcuda.so.7.5 /usr/lib/libcuda.so.7.5
ln: failed to create symbolic link ‘/usr/lib/libcuda.so.7.5’: File exists
tarun@tarun-Inspiron-3542:~/Desktop/SA_project/sirius-caffe$ sudo ./make-and-install.s
sudo: ./make-and-install.s: command not found
tarun@tarun-Inspiron-3542:~/Desktop/SA_project/sirius-caffe$ sudo ./make-and-install.sh
g++ .build_release/tools/caffe.o .build_release/lib/libcaffe.a -o .build_release/tools/caffe.bin -fPIC -DNDEBUG -O2 -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I.build_release/src -I./src -I./include -I/usr/local/include/opencv2/core/include -Wall -Wno-sign-compare -L/usr/lib -L/usr/local/lib -L/usr/lib -L/usr/local/include/opencv2/core/lib -lcudart -lcublas -lcurand -lglog -lgflags -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_imgproc -lpthread -lboost_thread -lopenblas
g++ .build_release/tools/dump_network.o .build_release/lib/libcaffe.a -o .build_release/tools/dump_network.bin -fPIC -DNDEBUG -O2 -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I.build_release/src -I./src -I./include -I/usr/local/include/opencv2/core/include -Wall -Wno-sign-compare -L/usr/lib -L/usr/local/lib -L/usr/lib -L/usr/local/include/opencv2/core/lib -lcudart -lcublas -lcurand -lglog -lgflags -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_imgproc -lpthread -lboost_thread -lopenblas
g++ .build_release/tools/extract_features.o .build_release/lib/libcaffe.a -o .build_release/tools/extract_features.bin -fPIC -DNDEBUG -O2 -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I.build_release/src -I./src -I./include -I/usr/local/include/opencv2/core/include -Wall -Wno-sign-compare -L/usr/lib -L/usr/local/lib -L/usr/lib -L/usr/local/include/opencv2/core/lib -lcudart -lcublas -lcurand -lglog -lgflags -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_imgproc -lpthread -lboost_thread -lopenblas
/usr/bin/ld: cannot find -lcudart
/usr/bin/ld: cannot find -lcublas
/usr/bin/ld: cannot find -lcurand
collect2: ld returned 1 exit status
make: *** [.build_release/tools/extract_features.bin] Error 1
make: *** Waiting for unfinished jobs....
/usr/bin/ld: cannot find -lcudart
/usr/bin/ld: cannot find -lcublas
/usr/bin/ld: cannot find -lcurand
/usr/bin/ld: cannot find -lcudart
/usr/bin/ld: cannot find -lcublas
/usr/bin/ld: cannot find -lcurand
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
make: *** [.build_release/tools/dump_network.bin] Error 1
make: *** [.build_release/tools/caffe.bin] Error 1
g++ .build_release/tools/caffe.o .build_release/lib/libcaffe.a -o .build_release/tools/caffe.bin -fPIC -DNDEBUG -O2 -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I.build_release/src -I./src -I./include -I/usr/local/include/opencv2/core/include -Wall -Wno-sign-compare -L/usr/lib -L/usr/local/lib -L/usr/lib -L/usr/local/include/opencv2/core/lib -lcudart -lcublas -lcurand -lglog -lgflags -lprotobuf -lleveldb -lsnappy -llmdb -lboost_system -lhdf5_hl -lhdf5 -lopencv_core -lopencv_imgproc -lpthread -lboost_thread -lopenblas
/usr/bin/ld: cannot find -lcudart
/usr/bin/ld: cannot find -lcublas
/usr/bin/ld: cannot find -lcurand
collect2: ld returned 1 exit status
make: *** [.build_release/tools/caffe.bin] Error 1
any kind of help will be appreciated.
Is there some problem with the libraries or the path .
Edit to add
ls -l /usr/lib/cu*
total 32
drwxr-xr-x 2 root root 4096 Aug 29 22:11 backend
drwxr-xr-x 2 root root 4096 Aug 11 11:07 backend-available
drwxr-xr-x 2 root root 4096 Aug 11 11:07 cgi-bin
drwxr-xr-x 2 root root 4096 Aug 11 11:07 daemon
drwxr-xr-x 2 root root 4096 Aug 11 11:07 driver
drwxr-xr-x 2 root root 4096 Aug 11 11:07 filter
drwxr-xr-x 2 root root 4096 Aug 11 11:07 monitor
drwxr-xr-x 2 root root 4096 Aug 11 11:07 notifier
Upvotes: 2
Views: 5170
Reputation: 14376
edit your post with the output of ls -l /usr/lib/cu*
. Additionally, do file /usr/lib/libcudart.so
(I'm guessing that your link (ln) is invalid.
^^^^^ Already done ^^^^^
As the broken link is confirmed, go to the /usr/lib/
directory and link (ln
) again.
ln -s /usr/local/cuda/libcudart.so /usr/lib/libcudart.so
do this step for all desired libraries.
As mentioned by @RobertCrovella, it appears there is some library knowledge required too, so add -L/usr/local/cuda/lib64
.
Now, after typing all of that out, I would recommend not moving/linking any files, just add -L /usr/local/cuda -L/usr/local/cuda/lib64
which will find all of your cuda libraries.
Upvotes: 1