summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPaul Jesse Hellemn <jesse.hellemn@gmail.com>2018-06-06 08:31:31 -0700
committerGitHub <noreply@github.com>2018-06-06 08:31:31 -0700
commit8e6f7a1382bd782603e6d6c785a2571a2394e4ff (patch)
tree803e198efebe28a120a11b1cda793a8aae43b912 /tools
parent857020b849491e6e3a0f3bc0295c7aeb80fc2174 (diff)
downloadpytorch-8e6f7a1382bd782603e6d6c785a2571a2394e4ff.tar.gz
pytorch-8e6f7a1382bd782603e6d6c785a2571a2394e4ff.tar.bz2
pytorch-8e6f7a1382bd782603e6d6c785a2571a2394e4ff.zip
[Caffe2] Merging setup.py with setup_caffe2.py (#8129)
* Mergine setup.pys, torch works, caffe2 works up to other KP * Fix to super call for python 2 * Works on python2 on mac * Consolidating Caffe2 flags
Diffstat (limited to 'tools')
-rwxr-xr-xtools/build_pytorch_libs.sh19
1 files changed, 17 insertions, 2 deletions
diff --git a/tools/build_pytorch_libs.sh b/tools/build_pytorch_libs.sh
index 872cefdff5..0323b96c83 100755
--- a/tools/build_pytorch_libs.sh
+++ b/tools/build_pytorch_libs.sh
@@ -17,6 +17,7 @@ WITH_NNPACK=0
WITH_MKLDNN=0
WITH_GLOO_IBVERBS=0
WITH_DISTRIBUTED_MW=0
+FULL_CAFFE2=0
while [[ $# -gt 0 ]]; do
case "$1" in
--with-cuda)
@@ -37,6 +38,9 @@ while [[ $# -gt 0 ]]; do
--with-distributed-mw)
WITH_DISTRIBUTED_MW=1
;;
+ --full-caffe2)
+ FULL_CAFFE2=1
+ ;;
*)
break
;;
@@ -222,9 +226,9 @@ function build_caffe2() {
${CMAKE_VERSION} .. \
${CMAKE_GENERATOR} \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
- -DBUILD_CAFFE2=OFF \
+ -DBUILD_CAFFE2=$FULL_CAFFE2 \
-DBUILD_ATEN=ON \
- -DBUILD_PYTHON=OFF \
+ -DBUILD_PYTHON=$FULL_CAFFE2 \
-DBUILD_BINARY=OFF \
-DBUILD_SHARED_LIBS=ON \
-DUSE_CUDA=$WITH_CUDA \
@@ -247,6 +251,17 @@ function build_caffe2() {
# to CMakeLists.txt and aten/CMakeLists.txt, not here.
# We need the vanilla cmake build to work.
${CMAKE_INSTALL} -j"$NUM_JOBS"
+
+ # Install Python proto files
+ if [[ $FULL_CAFFE2 -ne 0 ]]; then
+ find . -name proto
+ for proto_file in ./caffe/proto/*.py; do
+ cp $proto_file "$BASE_DIR/caffe/proto/"
+ done
+ for proto_file in ./caffe2/proto/*.py; do
+ cp $proto_file "$BASE_DIR/caffe2/proto/"
+ done
+ fi
popd
}