blob: 76e20db099612e01c69c031fc34011bc6739006c [file] [log] [blame]
Filip Kujawa8c76e5d2023-04-08 16:20:27 -07001#!/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 Kujawaa5e39702023-03-04 17:58:27 -08006# Clone the correct version of libedgetpu
7git clone https://github.com/google-coral/libedgetpu.git
8cd libedgetpu
Filip Kujawa8c76e5d2023-04-08 16:20:27 -07009GIT_VERSION=ddfa7bde33c23afd8c2892182faa3e5b4e6ad94e
10git checkout ${GIT_VERSION}
Filip Kujawaa5e39702023-03-04 17:58:27 -080011# Build libedgetpu.so.1.0 for both arm and x86
12DOCKER_CPUS="k8" DOCKER_IMAGE="ubuntu:18.04" DOCKER_TARGETS=libedgetpu make docker-build
13DOCKER_CPUS="aarch64" DOCKER_IMAGE="debian:stretch" DOCKER_TARGETS=libedgetpu make docker-build
Filip Kujawa8c76e5d2023-04-08 16:20:27 -070014# Create the directory for the tarball and move the resulting files into it
15rm -rf libedgetpu-bazel
Filip Kujawaa5e39702023-03-04 17:58:27 -080016mkdir libedgetpu-bazel
17mkdir libedgetpu-bazel/arm
18mkdir libedgetpu-bazel/k8
19cp out/direct/aarch64/libedgetpu.so.1.0 libedgetpu-bazel/arm
20cp out/direct/k8/libedgetpu.so.1.0 libedgetpu-bazel/k8
21
22# Copy header files to the include directory
Filip Kujawa8c76e5d2023-04-08 16:20:27 -070023mkdir -p libedgetpu-bazel/include/tflite/
24rsync -zarv --include="*/" --include='*.h' --exclude='*' tflite/ libedgetpu-bazel/include/tflite/
25tar zcvf libedgetpu-${GIT_VERSION}.tar.gz libedgetpu-bazel
26