Add aarch64 docker container to build tensorflow

This commit is contained in:
Guy Sheffer 2020-01-16 07:25:07 +00:00
parent faa3035456
commit 3b18f8e883
2 changed files with 25 additions and 4 deletions

View file

@ -58,8 +58,8 @@ RUN mv bazel-0.24.1-aarch64 /usr/local/bin/bazel && chmod 755 /usr/local/bin/baz
# Configure TensorFlow
WORKDIR "/home/tensorflow/tensorflow-1.14.0"
COPY /docker/tensorflow/*.sh ./
COPY /docker/tensorflow/*.diff ./
COPY /docker/tensorflow/.tf_configure.bazelrc .tf_configure.bazelrc
COPY /docker/tensorflow/Makefile Makefile
COPY ./*.sh ./
COPY ./*.diff ./
COPY ./.tf_configure.bazelrc .tf_configure.bazelrc
COPY ./Makefile.aarch64 Makefile
RUN make patch

View file

@ -0,0 +1,21 @@
TF_VERSION=1.14.0
all: libtensorflow static archive
patch:
git apply tensorflow-$(TF_VERSION).diff
libtensorflow:
bazel build --jobs 2 --config=opt //tensorflow:libtensorflow.so
static:
env JOB_COUNT=2 ARCH=armv8-a ./build_static.sh
archive:
rm -rf tmp
mkdir -p tmp/lib/
mkdir -p tmp/include/tensorflow/c/eager/
cp bazel-bin/tensorflow/libtensorflow.so.$(TF_VERSION) tmp/lib/libtensorflow.so
cp bazel-bin/tensorflow/libtensorflow_framework.so.$(TF_VERSION) tmp/lib/libtensorflow_framework.so
cp tensorflow/c/eager/c_api.h tmp/include/tensorflow/c/eager/
cp tensorflow/c/c_api.h tensorflow/c/c_api_experimental.h LICENSE tmp/include/tensorflow/c/
#(cd tmp && tar -czf ../libtensorflow-nvidia-jetson-nano-$(TF_VERSION).tar.gz .)
#du -h libtensorflow-nvidia-jetson-nano-$(TF_VERSION).tar.gz
guy@golem4:/tmp/photoprism/docker/tensorflow$