Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

caffe cmake build erros #5031

Closed
ghost opened this issue Nov 25, 2016 · 13 comments
Closed

caffe cmake build erros #5031

ghost opened this issue Nov 25, 2016 · 13 comments

Comments

@ghost
Copy link

ghost commented Nov 25, 2016

Hi ,when is try to use cmake to build ,i encounter this problem ( have cmake .. errors happened in make all -j4) ,are there anyone have encountered these errors:

[ 82%] Linking CXX shared library ../../lib/libcaffe.so
/usr/bin/ld: cannot find -lopencv_dep_cudart
collect2: error: ld returned 1 exit status
src/caffe/CMakeFiles/caffe.dir/build.make:3284: recipe for target 'lib/libcaffe.so.1.0.0-rc3' failed
make[2]: *** [lib/libcaffe.so.1.0.0-rc3] Error 1
CMakeFiles/Makefile2:272: recipe for target 'src/caffe/CMakeFiles/caffe.dir/all' failed
make[1]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

i try to fix this but feel hopeless~ please give some help ~ thx

@ferchonavarro
Copy link

I have the same problem apparently it related to disable "Static Linking of Cuda" for OpenCV in CMake but I dont really know how to do that. Let me know if you manage to fix it

@ghost
Copy link
Author

ghost commented Nov 27, 2016

i still not fix it,let us keep waiting someone else who have experience on this problem to give us some tips~

@ferchonavarro
Copy link

I have solved this problem with the next steps I hope it helps you too.

1 Once you are in the build directory
ccmake ..
This will open like a gui in the terminal
2 if you press "t" you get all the possible options
3 then I have disable CUDA_USE_STATIC_CUDA_RUNTIME (if you are on teh flag just press enter to enable On or disbale OFF)
4. press c to configure
5 press g to generate
6 make all

@ghost
Copy link
Author

ghost commented Nov 29, 2016 via email

@ferchonavarro
Copy link

great I am glad it works for you too! Cheers

@williford
Copy link
Contributor

Closing since it looks like the problem has been solved?

@albertyou2
Copy link

hi @ferchonavarro
thanks ,your solution works for me .
But I 'm wandering if disable CUDA_USE_STATIC_CUDA_RUNTIME means Caffe will not use CUDA?
Thank you very much !

@ferchonavarro
Copy link

@albertyou2 yes it should work and use CUDA I have tested it.

@zperfet
Copy link

zperfet commented Dec 28, 2017

1)It is an excellent solution, thanks a lot.
2)Install ccmake by executing the following in a terminal:
sudo apt-get install cmake-curses-gui
(from https://askubuntu.com/questions/121797/how-do-i-install-ccmake)
3)Just open CMakeCache.txt and change CUDA_USE_STATIC_CUDA_RUNTIME from on to OFF also works.

@jeya-maria-jose
Copy link

I dont get the CUDA_USE_STATIC_CUDA_RUNTIME option in my GUI ?

@polo5
Copy link

polo5 commented Jun 8, 2018

+1

1 similar comment
@suki7
Copy link

suki7 commented May 16, 2019

+1

@thomaswengerter
Copy link

thomaswengerter commented Aug 6, 2020

I faced the same error, could not resolve it with the suggested solution.
I recommend following
https://yangcha.github.io/Caffe-Conda/
to install caffe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants