pytorch/scripts
Pieter Noordhuis 9575364d30 Update protobuf detection
Summary:
The scripts/build_local.sh script would always build protoc from the
third_party protobuf tree and override the PROTOBUF_PROTOC_EXECUTABLE
CMake variable. This variable is used by the protobuf CMake files, so
it doesn't let us detect whether the protoc was specified by the user
or by the protobuf CMake files (e.g. an existing installation). This
in turn led to a problem where system installed headers would be
picked up while using protoc built from third_party. This only works
if the system installed version matches the version included in the
Caffe2 tree. Therefore, this commit changes the variable to specify a
custom protoc executable to CAFFE2_CUSTOM_PROTOC_EXECUTABLE, and
forces the use of the bundled libprotobuf when it is specified.

The result is that we now EITHER specify a custom protoc (as required
for cross-compilation where protoc must be compiled for the host and
libprotobuf for the target architecture) and use libprotobuf from the
Caffe2 tree, OR use system protobuf.

If system protobuf cannot be found, we fall back to building protoc
and libprotobuf in tree and packaging it as part of the Caffe2 build
artifacts.
Closes https://github.com/caffe2/caffe2/pull/1328

Differential Revision: D6032836

Pulled By: pietern

fbshipit-source-id: b75f8dd88412f02c947dc81ca43f7b2788da51e5
2017-10-12 11:48:50 -07:00
..
appveyor bugfix for Windows, esp. VS 2017 2017-03-21 05:17:59 -07:00
add_apache_header.sh Re-license to Apache 2017-09-28 16:22:00 -07:00
apache_header.txt Re-license to Apache 2017-09-28 16:22:00 -07:00
build_android.sh Update protobuf detection 2017-10-12 11:48:50 -07:00
build_host_protoc.bat Fix Windows build 2017-09-21 20:13:15 -07:00
build_host_protoc.sh Enable bitcode for iOS builds 2017-05-01 10:32:11 -07:00
build_ios.sh Update protobuf detection 2017-10-12 11:48:50 -07:00
build_local.sh Update protobuf detection 2017-10-12 11:48:50 -07:00
build_raspbian.sh Added python-pip and python-numpy into build_raspbian.sh 2017-05-24 10:09:16 -07:00
build_tegra_x1.sh Add six to Tegra X1 install script 2017-04-19 11:02:23 -07:00
build_tizen.sh Support a build script for Tizen target 2017-08-06 14:51:09 -07:00
build_windows.bat Update protobuf detection 2017-10-12 11:48:50 -07:00
diagnose_protobuf.py Re-apply #266 2017-04-25 21:17:04 -07:00
get_python_cmake_flags.py Officially support Python 3 in Conda build. 2017-09-23 16:16:49 -07:00
start_ipython_notebook.sh Added local build and apple fix for generating .so files 2017-02-16 06:11:28 -08:00
temp.sh Re-license to Apache 2017-09-28 16:22:00 -07:00