Skip to content

Conversation

@IvanKobzarev
Copy link
Contributor

@IvanKobzarev IvanKobzarev commented Sep 25, 2019

  1. scripts/build_android_libtorch_and_pytorch_android.sh
  • Builds libtorch for android_abis (by default for all 4: x86, x86_64, armeabi-v7a, arm-v8a) but cab be specified only custom list as a first parameter e.g. "x86"

  • Creates symbolic links inside android/pytorch_android to results of the previous builds:
    pytorch_android/src/main/jniLibs/${abi} -> build_android/install/lib
    pytorch_android/src/main/cpp/libtorch_include/${abi} -> build_android/install/include

  • Runs gradle assembleRelease to build aar files
    proxy can be specified inside (for devservers)

  1. android/run_tests.sh
    Running pytorch_android tests, contains instruction how to setup and run android emulator in headless and noaudio mode to run it on devserver
    proxy can be specified inside (for devservers)

#Test plan
Scenario to build x86 libtorch and android aars with it and run tests:

cd pytorch
sh scripts/build_android_libtorch_and_pytorch_android.sh x86
sh android/run_tests.sh

Tested on my devserver - build works, tests passed

@pytorchbot pytorchbot added module: android Related to Android support module: build Build system issues labels Sep 25, 2019
@IvanKobzarev IvanKobzarev force-pushed the ik_android_scripts_build_test branch 2 times, most recently from 60810d0 to 32e459f Compare September 25, 2019 20:12
@IvanKobzarev IvanKobzarev force-pushed the ik_android_scripts_build_test branch from 32e459f to d4bfe80 Compare September 25, 2019 20:15
@IvanKobzarev IvanKobzarev force-pushed the ik_android_scripts_build_test branch from d4bfe80 to e7c8a0c Compare September 25, 2019 22:34
@@ -0,0 +1,96 @@
#!/bin/bash
set -eux
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the name of the script is a bit verbose - can we simple call it "build_pytorch_android.sh"?
you can put a comment here to describe what it does.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@IvanKobzarev IvanKobzarev force-pushed the ik_android_scripts_build_test branch 2 times, most recently from 4590e78 to ab68715 Compare September 30, 2019 20:53
@IvanKobzarev IvanKobzarev force-pushed the ik_android_scripts_build_test branch from ab68715 to b8154df Compare September 30, 2019 21:02
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IvanKobzarev has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@IvanKobzarev merged this pull request in 47cd15c.

pdlive215 pushed a commit to pdlive215/pytorch that referenced this pull request Nov 27, 2019
…ytorch#26833)

Summary:
1. scripts/build_android_libtorch_and_pytorch_android.sh
- Builds libtorch for android_abis (by default for all 4: x86, x86_64, armeabi-v7a, arm-v8a) but cab be specified only custom list as a first parameter e.g. "x86"
- Creates symbolic links inside android/pytorch_android to results of the previous builds:
`pytorch_android/src/main/jniLibs/${abi}` -> `build_android/install/lib`
`pytorch_android/src/main/cpp/libtorch_include/${abi}` -> `build_android/install/include`

- Runs gradle assembleRelease to build aar files
proxy can be specified inside (for devservers)

2. android/run_tests.sh
Running pytorch_android tests, contains instruction how to setup and run android emulator in headless and noaudio mode to run it on devserver
proxy can be specified inside (for devservers)

#Test plan
Scenario to build x86 libtorch and android aars with it and run tests:
```
cd pytorch
sh scripts/build_android_libtorch_and_pytorch_android.sh x86
sh android/run_tests.sh
```
Tested on my devserver - build works, tests passed
Pull Request resolved: pytorch#26833

Differential Revision: D17673972

Pulled By: IvanKobzarev

fbshipit-source-id: 8cb7c3d131781854589de6428a7557c1ba7471e9
thiagocrepaldi pushed a commit to thiagocrepaldi/pytorch that referenced this pull request Feb 4, 2020
…ytorch#26833)

Summary:
1. scripts/build_android_libtorch_and_pytorch_android.sh
- Builds libtorch for android_abis (by default for all 4: x86, x86_64, armeabi-v7a, arm-v8a) but cab be specified only custom list as a first parameter e.g. "x86"
- Creates symbolic links inside android/pytorch_android to results of the previous builds:
`pytorch_android/src/main/jniLibs/${abi}` -> `build_android/install/lib`
`pytorch_android/src/main/cpp/libtorch_include/${abi}` -> `build_android/install/include`

- Runs gradle assembleRelease to build aar files
proxy can be specified inside (for devservers)

2. android/run_tests.sh
Running pytorch_android tests, contains instruction how to setup and run android emulator in headless and noaudio mode to run it on devserver
proxy can be specified inside (for devservers)

#Test plan
Scenario to build x86 libtorch and android aars with it and run tests:
```
cd pytorch
sh scripts/build_android_libtorch_and_pytorch_android.sh x86
sh android/run_tests.sh
```
Tested on my devserver - build works, tests passed
Pull Request resolved: pytorch#26833

Differential Revision: D17673972

Pulled By: IvanKobzarev

fbshipit-source-id: 8cb7c3d131781854589de6428a7557c1ba7471e9
@facebook-github-bot facebook-github-bot deleted the ik_android_scripts_build_test branch July 13, 2020 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: android Related to Android support module: build Build system issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants