mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
add Android NDK param to CI docker build script (#18782)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/18782 ghimport-source-id: 6c4bde7dc835b59209c1d5f7b243f00c9fe99de2 Stack from [ghstack](https://github.com/ezyang/ghstack): * **#18782 [pytorch] add Android NDK param to CI docker build script** Inspired by discussion: https://github.com/pytorch/pytorch/pull/16242 Reviewed By: dreiss Differential Revision: D14739471 fbshipit-source-id: 0a081045186cbf359eb3cdadee722741cd8cd62f
This commit is contained in:
committed by
Facebook Github Bot
parent
a7b82a44c4
commit
4afc067fed
@ -58,6 +58,10 @@ if [[ "$image" == *-android-* ]]; then
|
||||
# The Android NDK requires CMake 3.6 or higher.
|
||||
# See https://github.com/caffe2/caffe2/pull/1740 for more info.
|
||||
CMAKE_VERSION=3.6.3
|
||||
|
||||
if [[ "$image" == *-ndk-* ]]; then
|
||||
ANDROID_NDK_VERSION="$(echo "${image}" | perl -n -e'/-ndk-([^-]+)/ && print $1')"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$image" == *-gcc* ]]; then
|
||||
@ -98,6 +102,7 @@ docker build \
|
||||
--build-arg "CUDNN_VERSION=${CUDNN_VERSION}" \
|
||||
--build-arg "MKL=${MKL}" \
|
||||
--build-arg "ANDROID=${ANDROID}" \
|
||||
--build-arg "ANDROID_NDK=${ANDROID_NDK_VERSION}" \
|
||||
--build-arg "GCC_VERSION=${GCC_VERSION}" \
|
||||
--build-arg "CLANG_VERSION=${CLANG_VERSION}" \
|
||||
--build-arg "CMAKE_VERSION=${CMAKE_VERSION:-}" \
|
||||
|
@ -2,13 +2,15 @@
|
||||
|
||||
set -ex
|
||||
|
||||
[ -n "${ANDROID_NDK}" ] || ANDROID_NDK=r13b
|
||||
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends autotools-dev autoconf unzip
|
||||
apt-get autoclean && apt-get clean
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
pushd /tmp
|
||||
curl -Os https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
|
||||
curl -Os https://dl.google.com/android/repository/android-ndk-${ANDROID_NDK}-linux-x86_64.zip
|
||||
popd
|
||||
_ndk_dir=/opt/ndk
|
||||
mkdir -p "$_ndk_dir"
|
||||
|
@ -31,6 +31,7 @@ RUN rm install_mkl.sh
|
||||
|
||||
# (optional) Install Android NDK
|
||||
ARG ANDROID
|
||||
ARG ANDROID_NDK
|
||||
ADD ./install_android.sh install_android.sh
|
||||
RUN if [ -n "${ANDROID}" ]; then bash ./install_android.sh; fi
|
||||
RUN rm install_android.sh
|
||||
|
Reference in New Issue
Block a user