commit | 3a84574c81f67d4467c8979f363e76f38aa7693c | [log] [tgz] |
---|---|---|
author | Orion Reblitz-Richardson <orionr@gmail.com> | Tue Mar 27 21:47:14 2018 -0700 |
committer | Orion Reblitz-Richardson <orionr@gmail.com> | Wed Mar 28 10:05:20 2018 -0700 |
tree | 116078e0b6c4e91d3d38886a5903e53e885a490f | |
parent | dbac04475903dac263940c269feb4b9ac697471e [diff] |
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.
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.
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.
Caffe2 is released under the Apache 2.0 license. See the NOTICE file for details.