From 3b18f8e8835270217630d751009497ed7fdb53aa Mon Sep 17 00:00:00 2001 From: Guy Sheffer Date: Thu, 16 Jan 2020 07:25:07 +0000 Subject: [PATCH] Add aarch64 docker container to build tensorflow --- docker/tensorflow/Dockerfile.aarch64 | 8 ++++---- docker/tensorflow/Makefile.aarch64 | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 docker/tensorflow/Makefile.aarch64 diff --git a/docker/tensorflow/Dockerfile.aarch64 b/docker/tensorflow/Dockerfile.aarch64 index 97e43c039..fc376fa44 100644 --- a/docker/tensorflow/Dockerfile.aarch64 +++ b/docker/tensorflow/Dockerfile.aarch64 @@ -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 diff --git a/docker/tensorflow/Makefile.aarch64 b/docker/tensorflow/Makefile.aarch64 new file mode 100644 index 000000000..de6a43684 --- /dev/null +++ b/docker/tensorflow/Makefile.aarch64 @@ -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$ +