Filip Kujawa | 8c76e5d | 2023-04-08 16:20:27 -0700 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | #This script creates a compressed tarball file named libedgetpu-${GIT_VERSION}.tar.gz, |
| 3 | # which contains the header files, libraries, and binaries needed to use Edge TPU on both arm and x86 architectures. |
| 4 | # This script assumes you have Docker installed. |
| 5 | # |
Filip Kujawa | a5e3970 | 2023-03-04 17:58:27 -0800 | [diff] [blame] | 6 | # Clone the correct version of libedgetpu |
| 7 | git clone https://github.com/google-coral/libedgetpu.git |
| 8 | cd libedgetpu |
Filip Kujawa | 8c76e5d | 2023-04-08 16:20:27 -0700 | [diff] [blame^] | 9 | GIT_VERSION=ddfa7bde33c23afd8c2892182faa3e5b4e6ad94e |
| 10 | git checkout ${GIT_VERSION} |
Filip Kujawa | a5e3970 | 2023-03-04 17:58:27 -0800 | [diff] [blame] | 11 | # Build libedgetpu.so.1.0 for both arm and x86 |
| 12 | DOCKER_CPUS="k8" DOCKER_IMAGE="ubuntu:18.04" DOCKER_TARGETS=libedgetpu make docker-build |
| 13 | DOCKER_CPUS="aarch64" DOCKER_IMAGE="debian:stretch" DOCKER_TARGETS=libedgetpu make docker-build |
Filip Kujawa | 8c76e5d | 2023-04-08 16:20:27 -0700 | [diff] [blame^] | 14 | # Create the directory for the tarball and move the resulting files into it |
| 15 | rm -rf libedgetpu-bazel |
Filip Kujawa | a5e3970 | 2023-03-04 17:58:27 -0800 | [diff] [blame] | 16 | mkdir libedgetpu-bazel |
| 17 | mkdir libedgetpu-bazel/arm |
| 18 | mkdir libedgetpu-bazel/k8 |
| 19 | cp out/direct/aarch64/libedgetpu.so.1.0 libedgetpu-bazel/arm |
| 20 | cp out/direct/k8/libedgetpu.so.1.0 libedgetpu-bazel/k8 |
| 21 | |
| 22 | # Copy header files to the include directory |
Filip Kujawa | 8c76e5d | 2023-04-08 16:20:27 -0700 | [diff] [blame^] | 23 | mkdir -p libedgetpu-bazel/include/tflite/ |
| 24 | rsync -zarv --include="*/" --include='*.h' --exclude='*' tflite/ libedgetpu-bazel/include/tflite/ |
| 25 | tar zcvf libedgetpu-${GIT_VERSION}.tar.gz libedgetpu-bazel |
| 26 | |