Update CAFFE2_LINK_LOCAL_PROTOBUF functionality.

* Continuation of https://github.com/caffe2/caffe2/pull/2306 and based on Yangqing's PR at https://github.com/caffe2/caffe2/pull/2326
* Put caffe2_protos as static library and link it whole to libcaffe2.so
* For protobuf::libprotobuf, only link it to libcaffe2_protos (and hence libcaffe2.so), but not any downstream library. This avoids manipulating protobuf objects across dll boundaries.
* After the above, during linking one will receive complaint that fixed_address_empty_string is not found. This is because we compiled protobuf with hidden visibility, and the fact that the generated caffe2.pb.h has an inline function that invokes the inline function in protobuf GetEmptyStringAlreadyInited()
* Added sed-like commands to replace the generated header to use caffe2::GetEmptyStringAlreadyInited() instead. And, in proto_utils.cc, implement a function that essentially routes the function call to protobuf's internal one. The reason this works is that, caffe2::G... is visible globally, and libcaffe2.so is able to see the real protobuf one. This ensures that we are always calling protobuf functions that are inside libcaffe2.so.
6 files changed
tree: 116078e0b6c4e91d3d38886a5903e53e885a490f
  1. .github/
  2. .jenkins/
  3. .travis/
  4. binaries/
  5. caffe/
  6. caffe2/
  7. cmake/
  8. conda/
  9. docker/
  10. docs/
  11. modules/
  12. scripts/
  13. third_party/
  14. .gitattributes
  15. .gitignore
  16. .gitmodules
  17. CMakeLists.txt
  18. LICENSE
  19. Makefile
  20. NOTICE
  21. README.md
  22. release-notes.md
  23. setup.py
  24. VERSION_NUMBER
README.md

Caffe2

License Jenkins Build Status Appveyor Build Status

Caffe2 is a lightweight, modular, and scalable deep learning framework. Building on the original Caffe, Caffe2 is designed with expression, speed, and modularity in mind.

Questions and Feedback

Please use Github issues (https://github.com/caffe2/caffe2/issues) to ask questions, report bugs, and request new features.

Please participate in our survey (https://www.surveymonkey.com/r/caffe2). We will send you information about new releases and special developer events/webinars.

License

Caffe2 is released under the Apache 2.0 license. See the NOTICE file for details.

Further Resources on Caffe2.ai