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

Can't build as a library #2799

Closed
alejandro-isaza opened this issue Jul 21, 2015 · 8 comments
Closed

Can't build as a library #2799

alejandro-isaza opened this issue Jul 21, 2015 · 8 comments

Comments

@alejandro-isaza
Copy link

If you build Caffe as a library (either static or dynamic) it fails to register the layers: Unknown layer type: Convolution (known types: ). Related: #2159

@SlimeQ
Copy link

SlimeQ commented Jul 21, 2015

I've been trying to get caffe installed as a c++ library for a few days now with no luck. I'll admit that I barely know what I'm doing when it comes to c++/make/cmake but the documentation is pretty weak. from what I can tell it has to do with incorrect installation of the dependencies, but I haven't found any clear instructions on how to do this correctly, and there are SO MANY DEPENDENCIES. Attempts at manual installation of all of them has left my AWS instance a mess and totally filled my 8gb of storage. I can only assume I'm doing something terribly wrong but I'm at a loss as to what. It's worth noting that the python wrapper works fine... this does not add up in my head.

any thoughts?

edit: I've basically just been trying to compile the cpp_classification example using

$ g++ cpp_classification.cpp

@flx42
Copy link
Contributor

flx42 commented Jul 22, 2015

With a shared library it should just work.
For a static library, use -Wl,--whole-archive libcaffe.a -Wl,--no-whole-archive

@shelhamer
Copy link
Member

Right. The Makefile is designed to handle the layer registry in this way by https://github.com/BVLC/caffe/blob/master/Makefile#L269-L273.

@flx42
Copy link
Contributor

flx42 commented Jul 22, 2015

@Aleph7 please double check if it works with a shared library, if it doesn't then it's a bug.
Otherwise, we can close this issue I think.

@alejandro-isaza
Copy link
Author

I'll give it a try, thanks

@alejandro-isaza
Copy link
Author

The static lib flags worked, thanks again.

@carlosost
Copy link

Hello @flx42 Could you help me with this problem here ?

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

5 participants