pytorch/scripts
Gemfield c3a23379ea add install step and docs for Android build (#17298)
Summary:
This commit did below enhancements:
1, add doc for build_android.sh;
2, add install step for build_android.sh, thus the headers and libraries can be collected together for further usage conveniently;
3, change the default INSTALL_PREFIX from $PYTORCH_ROOT/install to $PYTORCH_ROOT/build_android/install to make the project directory clean.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/17298

Differential Revision: D14149709

Pulled By: soumith

fbshipit-source-id: a3a38cb41f26377e21aa89e49e57e8f21c9c1a39
2019-02-20 07:05:24 -08:00
..
appveyor move flags to c10 (#12144) 2018-10-04 02:09:56 -07:00
fbcode-dev-setup s/fwdproxy.any/fwdproxy/g in fbsource (#16024) 2019-01-15 17:26:31 -08:00
model_zoo Bump up opset version to 7 in Caffe2 ONNX exporter (#8854) 2018-06-28 07:39:02 -07:00
onnx Remove redundant "build" setup.py commond from onnx scripts 2019-01-28 22:59:33 -08: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
apache_python.txt Add script for removing Apache header. 2018-03-27 13:10:18 -07:00
build_android.sh add install step and docs for Android build (#17298) 2019-02-20 07:05:24 -08:00
build_host_protoc.sh Port all PyTorch and Caffe2 jobs to CircleCI (#11264) 2018-09-05 16:28:11 -07:00
build_ios.sh Disable QNNPACK for multi-architecture iOS builds (#14125) 2018-11-16 21:18:01 -08:00
build_local.sh Port all PyTorch and Caffe2 jobs to CircleCI (#11264) 2018-09-05 16:28:11 -07:00
build_raspbian.sh Allow specifying cmake build directory in the build scripts 2017-11-20 20:32:30 -08:00
build_tegra_x1.sh Allow specifying cmake build directory in the build scripts 2017-11-20 20:32:30 -08:00
build_tizen.sh Allow specifying cmake build directory in the build scripts 2017-11-20 20:32:30 -08:00
build_windows.bat Eliminate PYCMD in favor of PYTHON_EXECUTABLE in CMake. 2019-01-30 17:13:43 -08:00
diagnose_protobuf.py Fix several DeprecationWarning: invalid escape sequence (#15733) 2019-01-05 08:53:35 -08:00
get_python_cmake_flags.py [caffe2][build] Update python cmake flag print script (#7306) 2018-05-08 00:34:42 -07:00
read_conda_versions.sh Adding gcc4 conda builds (#2283) 2018-03-17 17:26:37 -07:00
README.md add install step and docs for Android build (#17298) 2019-02-20 07:05:24 -08:00
remove_apache_header.sh Add script for removing Apache header. 2018-03-27 13:10:18 -07:00
temp.sh Add script for removing Apache header. 2018-03-27 13:10:18 -07:00

This directory contains the usful tools.

build_android.sh

This script is to build PyTorch/Caffe2 library for Android. Take following steps to start the build:

  • set ANDROID_NDK to the location of ndk
export ANDROID_NDK=YOUR_NDK_PATH
  • run build_android.sh
#in your PyTorch root directory
bash scripts/build_android.sh

If succeeded, the libraries and headers would be generated to build_android/install directory. You can then copy these files from build_android/install to your Android project for further usage.

You can also override the cmake flags via command line, e.g., following command will also compile the executable binary files:

bash scripts/build_android.sh -DBUILD_BINARY=ON