caffe icon indicating copy to clipboard operation
caffe copied to clipboard

Caffe library: is it built as shared or static? (answer: both)

Open thuanvh opened this issue 12 years ago • 5 comments

Hi, Because I could not find shared library declaration in caffe code. Now, does caffe support building a shared library?

thuanvh avatar Jul 03 '14 03:07 thuanvh

Yes but actually compiles static as default

bhack avatar Jul 03 '14 06:07 bhack

Caffe builds a shared (libcaffe.so) and static (libcaffe.a) library by default.

make
...
ls build/lib/
libcaffe.a  libcaffe.so

Refer to the Makefile https://github.com/BVLC/caffe/blob/master/Makefile#L7-L10 for details.

@bhack no. See the Makefile.

shelhamer avatar Jul 03 '14 07:07 shelhamer

@shelhamer Right this is the cmake PR/BRANCH behavior. It think that was the same derived by Makefile but probably behaviors are still not in sync between Cmake and Makefile

bhack avatar Jul 03 '14 07:07 bhack

@bhack the library has been built both shared and static in master/dev as long as I can remember. If your answer does not relate to master/dev, please make that clear in your comment.

Otherwise it invites confusion. Thanks for helping answer questions, but please do be clear.

shelhamer avatar Jul 03 '14 07:07 shelhamer

Hi, Sorry for not clear my question. In fact, the caffe now could be built in shared library in ubuntu, etc., but not in windows. To support shared library in windows demands a lot of modification in class declaration and a little modification in protoc compiler commands.

thuanvh avatar Jul 04 '14 04:07 thuanvh