New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[caffe2] Improve build_android experience #13116

t-vi opened this Issue Oct 25, 2018 · 1 comment


None yet
3 participants

t-vi commented Oct 25, 2018

馃殌 Feature

It would be nice to make it easier to build android libraries for caffe2.


I recently built the AICamera example with recent android studio. The result and steps are here:


Based on the feedback I got on the first day after mentioning this on the PyTorch slack, there are more people who have been trying this and had less success, even though I'd think they're pretty good with PyTorch in general.

  • To facilitate android x86 building, add a switch to disable AVX independent of detection.
    (Or make it work on android, but I guess android x86 is debugging mostly anyway.)
  • Make the build output path include the architecture.
  • Default to clang to adapt to what android seems to be doing toolchain-wise.
  • Add some instructions to build and copy the libs + includes.


  • Keep it a secret black art and find a business model helping people on a case by case basis.
  • Build libtorch for android and use that.

Additional context

The other changes in my fork might be the basis for a PR for the AICamera repo and an update to the tutorial once this is merged.

Needless to say, I would submit the PR.


This comment has been minimized.

infil00p commented Oct 26, 2018

I can't +1 this enough. I've sunk way too much time trying to figure this out, and I would love it if there was a reliable build for Caffe2 for Android that was well maintained.

@t-vi t-vi changed the title from Caffe2: Improve build_android experience to [caffe2] Improve build_android experience Oct 26, 2018

t-vi added a commit to t-vi/pytorch that referenced this issue Oct 26, 2018

Update android builds
- change toolchain defautl to clang
- discuss x86 building
- provide facility to turn off AVX
- add some commentary about libs and headers

Fixes: pytorch#13116

@zou3519 zou3519 added the caffe2 label Oct 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment