pytorch/scripts
peter 19c13eee39 Correct cmake flags passing (#18217)
Summary:
Fixes #18214.

According to the CMake manual, we should pass the arguments first, and put the directory as the last element. Otherwise, these flags may not be passed correctly.

Reference:
1. https://cmake.org/cmake/help/latest/manual/cmake.1.html#synopsis
2. https://stackoverflow.com/a/27169347
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18217

Differential Revision: D14540588

Pulled By: ezyang

fbshipit-source-id: a027f585dde66c5da7bbbe584fa42c3e56027d59
2019-03-20 09:21:31 -07: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
onnx Remove redundant "build" setup.py commond from onnx scripts 2019-01-28 22:59:33 -08:00
add_apache_header.sh
apache_header.txt
apache_python.txt
build_android.sh add install step and docs for Android build (#17298) 2019-02-20 07:05:24 -08:00
build_host_protoc.sh
build_ios.sh Disable QNNPACK for multi-architecture iOS builds (#14125) 2018-11-16 21:18:01 -08:00
build_local.sh
build_raspbian.sh Fix target name. 2019-02-22 17:27:16 -08:00
build_tegra_x1.sh
build_tizen.sh
build_windows.bat Correct cmake flags passing (#18217) 2019-03-20 09:21:31 -07:00
diagnose_protobuf.py Fix several DeprecationWarning: invalid escape sequence (#15733) 2019-01-05 08:53:35 -08:00
get_python_cmake_flags.py
read_conda_versions.sh
README.md Fix install libcaffe2_protos.a issue mentioned in #14317 (#17393) 2019-02-22 17:05:48 -08:00
remove_apache_header.sh
temp.sh

This directory contains the useful tools.

build_android.sh

This script is to build PyTorch/Caffe2 library for Android. Take the 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