From patchwork Mon Aug 26 19:15:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denys Dmytriyenko X-Patchwork-Id: 48259 X-Patchwork-Delegate: reatmon@ti.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 071CCC5473B for ; Mon, 26 Aug 2024 19:16:25 +0000 (UTC) Received: from mailout4.zoneedit.com (mailout4.zoneedit.com [64.68.198.64]) by mx.groups.io with SMTP id smtpd.web10.61242.1724699780762179962 for ; Mon, 26 Aug 2024 12:16:20 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: denix.org, ip: 64.68.198.64, mailfrom: denis@denix.org) Received: from localhost (localhost [127.0.0.1]) by mailout4.zoneedit.com (Postfix) with ESMTP id 25C0440CC2; Mon, 26 Aug 2024 19:16:20 +0000 (UTC) Received: from mailout4.zoneedit.com ([127.0.0.1]) by localhost (zmo14-pco.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oJqzxsEdDCwL; Mon, 26 Aug 2024 19:16:20 +0000 (UTC) Received: from mail.denix.org (pool-100-15-87-159.washdc.fios.verizon.net [100.15.87.159]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout4.zoneedit.com (Postfix) with ESMTPSA id 17D5240CC4; Mon, 26 Aug 2024 19:16:18 +0000 (UTC) Received: from thorin.han-sole.ts.net (thorin.denix [192.168.30.9]) by mail.denix.org (Postfix) with ESMTP id B3B43164066; Mon, 26 Aug 2024 15:16:16 -0400 (EDT) From: Denys Dmytriyenko To: meta-arago@lists.yoctoproject.org Cc: Denys Dmytriyenko Subject: [master][PATCH 06/16] tensorflow-lite: remove Date: Mon, 26 Aug 2024 15:15:55 -0400 Message-Id: <20240826191605.8190-6-denis@denix.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240826191605.8190-1-denis@denix.org> References: <20240826191605.8190-1-denis@denix.org> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 26 Aug 2024 19:16:25 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/15520 From: Denys Dmytriyenko Remove local copy of an old and outdated tensorflow-lite component. There are much newer versions of this component available from other layers. Signed-off-by: Denys Dmytriyenko --- ...kagegroup-arago-tisdk-addons-sdk-target.bb | 8 -- ...akefile-add-label_image-example-1.15.patch | 82 ----------- ...odification-for-tflite-1.15-to-eigen.patch | 16 --- .../files/tensorflow-lite.pc.in | 6 - .../tensorflow-lite/files/tflite-benchmark.sh | 59 -------- .../tensorflow-lite-demo_git.bb | 64 --------- .../tensorflow-lite/tensorflow-lite_1.15.bb | 133 ------------------ 7 files changed, 368 deletions(-) delete mode 100644 meta-arago-extras/recipes-support/tensorflow-lite/files/0001-Makefile-add-label_image-example-1.15.patch delete mode 100644 meta-arago-extras/recipes-support/tensorflow-lite/files/apply-modification-for-tflite-1.15-to-eigen.patch delete mode 100644 meta-arago-extras/recipes-support/tensorflow-lite/files/tensorflow-lite.pc.in delete mode 100644 meta-arago-extras/recipes-support/tensorflow-lite/files/tflite-benchmark.sh delete mode 100644 meta-arago-extras/recipes-support/tensorflow-lite/tensorflow-lite-demo_git.bb delete mode 100644 meta-arago-extras/recipes-support/tensorflow-lite/tensorflow-lite_1.15.bb diff --git a/meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-tisdk-addons-sdk-target.bb b/meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-tisdk-addons-sdk-target.bb index e91f33c9..3e0a2720 100644 --- a/meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-tisdk-addons-sdk-target.bb +++ b/meta-arago-distro/recipes-core/packagegroups/packagegroup-arago-tisdk-addons-sdk-target.bb @@ -38,23 +38,15 @@ PDM_ANOMALY_PKG_DEV = "\ EXTRA_PACKAGES = "" #EXTRA_PACKAGES:append:ti33x = " \ -# tensorflow-lite-dev \ -# tensorflow-lite-staticdev \ # ${PDM_ANOMALY_PKG_DEV} \ #" #EXTRA_PACKAGES:append:ti43x = " \ -# tensorflow-lite-dev \ -# tensorflow-lite-staticdev \ # ${PDM_ANOMALY_PKG_DEV} \ #" #EXTRA_PACKAGES:append:omap-a15 = " \ -# tensorflow-lite-dev \ -# tensorflow-lite-staticdev \ # ${PDM_ANOMALY_PKG_DEV} \ #" #EXTRA_PACKAGES:append:am65xx = " \ -# tensorflow-lite-dev \ -# tensorflow-lite-staticdev \ # ${PDM_ANOMALY_PKG_DEV} \ #" diff --git a/meta-arago-extras/recipes-support/tensorflow-lite/files/0001-Makefile-add-label_image-example-1.15.patch b/meta-arago-extras/recipes-support/tensorflow-lite/files/0001-Makefile-add-label_image-example-1.15.patch deleted file mode 100644 index ef5e1cbf..00000000 --- a/meta-arago-extras/recipes-support/tensorflow-lite/files/0001-Makefile-add-label_image-example-1.15.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 481c021e98c443195b73484fd0d9d50a2e0ae69a Mon Sep 17 00:00:00 2001 -From: Hongmei Gou -Date: Wed, 25 Sep 2019 18:07:04 -0400 -Subject: [PATCH] Makefile: add label_image example - -Upstream-Status: Pending - -Signed-off-by: Hongmei Gou ---- - tensorflow/lite/tools/make/Makefile | 21 ++++++++++++++++++++- - 1 file changed, 20 insertions(+), 1 deletion(-) - -diff --git a/tensorflow/lite/tools/make/Makefile b/tensorflow/lite/tools/make/Makefile -index 73c50d3272..e2f664e1eb 100644 ---- a/tensorflow/lite/tools/make/Makefile -+++ b/tensorflow/lite/tools/make/Makefile -@@ -201,6 +201,12 @@ BENCHMARK_SRCS := $(filter-out \ - $(BENCHMARK_SRCS_DIR)/benchmark_plus_flex_main.cc, \ - $(BENCHMARK_ALL_SRCS)) - -+# label image example -+LABELIMAGE_SRCS := \ -+ tensorflow/lite/examples/label_image/bitmap_helpers.cc \ -+ tensorflow/lite/examples/label_image/label_image.cc \ -+ $(EVALUATION_UTILS_SRCS) -+ - # These target-specific makefiles should modify or replace options like - # CXXFLAGS or LIBS to work for a specific targetted architecture. All logic - # based on platforms or architectures should happen within these files, to -@@ -209,6 +215,7 @@ include $(wildcard $(MAKEFILE_DIR)/targets/*_makefile.inc) - - ALL_SRCS := \ - $(MINIMAL_SRCS) \ -+ $(LABELIMAGE_SRCS) \ - $(PROFILER_SRCS) \ - $(PROFILER_SUMMARIZER_SRCS) \ - $(TF_LITE_CC_SRCS) \ -@@ -225,6 +232,7 @@ LIB_PATH := $(LIBDIR)$(LIB_NAME) - BENCHMARK_LIB := $(LIBDIR)$(BENCHMARK_LIB_NAME) - BENCHMARK_BINARY := $(BINDIR)$(BENCHMARK_BINARY_NAME) - MINIMAL_BINARY := $(BINDIR)minimal -+LABELIMAGE_BINARY := $(BINDIR)label_image - - CXX := $(CC_PREFIX)${TARGET_TOOLCHAIN_PREFIX}g++ - CC := $(CC_PREFIX)${TARGET_TOOLCHAIN_PREFIX}gcc -@@ -233,6 +241,9 @@ AR := $(CC_PREFIX)${TARGET_TOOLCHAIN_PREFIX}ar - MINIMAL_OBJS := $(addprefix $(OBJDIR), \ - $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(MINIMAL_SRCS)))) - -+LABELIMAGE_OBJS := $(addprefix $(OBJDIR), \ -+$(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(LABELIMAGE_SRCS)))) -+ - LIB_OBJS := $(addprefix $(OBJDIR), \ - $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(TF_LITE_CC_SRCS))))) - -@@ -252,7 +263,7 @@ $(OBJDIR)%.o: %.cpp - $(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@ - - # The target that's compiled if there's no command-line arguments. --all: $(LIB_PATH) $(MINIMAL_BINARY) $(BENCHMARK_BINARY) -+all: $(LIB_PATH) $(MINIMAL_BINARY) $(LABELIMAGE_BINARY) $(BENCHMARK_BINARY) - - # The target that's compiled for micro-controllers - micro: $(LIB_PATH) -@@ -276,6 +287,14 @@ $(MINIMAL_BINARY): $(MINIMAL_OBJS) $(LIB_PATH) - - minimal: $(MINIMAL_BINARY) - -+$(LABELIMAGE_BINARY): $(LABELIMAGE_OBJS) $(LIB_PATH) -+ @mkdir -p $(dir $@) -+ $(CXX) $(CXXFLAGS) $(INCLUDES) \ -+ -o $(LABELIMAGE_BINARY) $(LABELIMAGE_OBJS) \ -+ $(LIBFLAGS) $(LIB_PATH) $(LDFLAGS) $(LIBS) -+ -+label_image: $(LABELIMAGE_BINARY) -+ - $(BENCHMARK_LIB) : $(LIB_PATH) $(BENCHMARK_OBJS) - @mkdir -p $(dir $@) - $(AR) $(ARFLAGS) $(BENCHMARK_LIB) $(LIB_OBJS) $(BENCHMARK_OBJS) --- -2.17.1 - diff --git a/meta-arago-extras/recipes-support/tensorflow-lite/files/apply-modification-for-tflite-1.15-to-eigen.patch b/meta-arago-extras/recipes-support/tensorflow-lite/files/apply-modification-for-tflite-1.15-to-eigen.patch deleted file mode 100644 index 491dcbfa..00000000 --- a/meta-arago-extras/recipes-support/tensorflow-lite/files/apply-modification-for-tflite-1.15-to-eigen.patch +++ /dev/null @@ -1,16 +0,0 @@ - -Upstream-Status: Inappropriate [arago specific] - -diff --git a/tensorflow/lite/tools/make/downloads/eigen/Eigen/src/Core/arch/NEON/Complex.h b/tensorflow/lite/tools/make/downloads/eigen/Eigen/src/Core/arch/NEON/Complex.h -index 306a309beb..4527a64c91 100644 ---- a/tensorflow/lite/tools/make/downloads/eigen/Eigen/src/Core/arch/NEON/Complex.h -+++ b/tensorflow/lite/tools/make/downloads/eigen/Eigen/src/Core/arch/NEON/Complex.h -@@ -307,7 +307,7 @@ - static uint64x2_t p2ul_CONJ_XOR = {0x0, 0x8000000000000000}; - #else - const uint64_t p2ul_conj_XOR_DATA[] = { 0x0, 0x8000000000000000 }; -- static uint64x2_t p2ul_CONJ_XOR = vld1q_u64( p2ul_conj_XOR_DATA ); -+ static uint64x2_t p2ul_CONJ_XOR;// = vld1q_u64( p2ul_conj_XOR_DATA ); - Removed by script - #endif - - struct Packet1cd diff --git a/meta-arago-extras/recipes-support/tensorflow-lite/files/tensorflow-lite.pc.in b/meta-arago-extras/recipes-support/tensorflow-lite/files/tensorflow-lite.pc.in deleted file mode 100644 index 44afd0ee..00000000 --- a/meta-arago-extras/recipes-support/tensorflow-lite/files/tensorflow-lite.pc.in +++ /dev/null @@ -1,6 +0,0 @@ - Name: tensorflow lite - Description: tensorflow lite static library - Version: @version@ - Requires: - Libs: -L@libdir@ -ltensorflow-lite - Cflags: -I@includedir@ diff --git a/meta-arago-extras/recipes-support/tensorflow-lite/files/tflite-benchmark.sh b/meta-arago-extras/recipes-support/tensorflow-lite/files/tflite-benchmark.sh deleted file mode 100644 index 868b6c08..00000000 --- a/meta-arago-extras/recipes-support/tensorflow-lite/files/tflite-benchmark.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh - -#list of model packages -declare -a model_list=( -"http://storage.googleapis.com/download.tensorflow.org/models/mobilenet_v1_2018_08_02/mobilenet_v1_1.0_224_quant.tgz" -"http://storage.googleapis.com/download.tensorflow.org/models/tflite_11_05_08/mobilenet_v2_1.0_224_quant.tgz" -"http://storage.googleapis.com/download.tensorflow.org/models/inception_v1_224_quant_20181026.tgz" -"http://storage.googleapis.com/download.tensorflow.org/models/inception_v2_224_quant_20181026.tgz" -"http://storage.googleapis.com/download.tensorflow.org/models/tflite_11_05_08/inception_v3_quant.tgz" -"http://storage.googleapis.com/download.tensorflow.org/models/inception_v4_299_quant_20181026.tgz" -"http://storage.googleapis.com/download.tensorflow.org/models/tflite/coco_ssd_mobilenet_v1_1.0_quant_2018_06_29.zip" -) - -# create a new directory to host and unpack the models -rm -rf ~/tflite-benchmark -mkdir ~/tflite-benchmark - -# Set maximal number of threads to the number of arm cores -max_num_threads=`nproc` - -# TFLite install dir on filesystem -tflite_install_dir=$(find /usr/share -maxdepth 1 -type d -name "tensorflow-lite*") - -for model_link in "${model_list[@]}" -do - # download the model package to modeldir - modelpkg="${model_link##*/}" - modeldir="${modelpkg%.*}" - - mkdir ~/tflite-benchmark/$modeldir - cd ~/tflite-benchmark/$modeldir - - echo "Downloading $modelpkg..." - wget "$model_link" - if [[ $? -ne 0 ]]; then - echo "wget failed. Set up http proxy as needed before running the scripts!" - exit 1 - fi - - # unpack the model package - if [[ $modelpkg =~ \.tgz$ ]]; then - tar -xzvf $modelpkg - fi - if [[ $modelpkg =~ \.zip$ ]]; then - unzip $modelpkg - fi - - # run benchmark for the model - for model in *.tflite; do - for num_threads in $( seq 1 $max_num_threads ) - do - echo "Running benchmark_model for $model with $num_threads thread(s)..." - $tflite_install_dir/examples/benchmark_model --graph=${model} --num_threads=$num_threads --enable_op_profiling=true > ${modeldir}_thread_${num_threads}.log - cat ${modeldir}_thread_${num_threads}.log | grep Timings - done - done -done - -echo "Benchmarking completed!" diff --git a/meta-arago-extras/recipes-support/tensorflow-lite/tensorflow-lite-demo_git.bb b/meta-arago-extras/recipes-support/tensorflow-lite/tensorflow-lite-demo_git.bb deleted file mode 100644 index fcbc84ab..00000000 --- a/meta-arago-extras/recipes-support/tensorflow-lite/tensorflow-lite-demo_git.bb +++ /dev/null @@ -1,64 +0,0 @@ -SUMMARY = "Tensorflow Lite Demo with input and display via OpenCV and TIDL acceleration for AM5" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=d8927f3331d2b3e321b7dd1925166d25" - -inherit features_check - -REQUIRED_DISTRO_FEATURES = "opencv" -REQUIRED_DISTRO_FEATURES:append:dra7xx = " opencl" - -DEPENDS = "tensorflow-lite flatbuffers opencv" -DEPENDS:append:dra7xx = " tidl-api" - -COMPATIBLE_MACHINE = "ti33x|ti43x|omap-a15|am65xx" -PACKAGE_ARCH = "${MACHINE_ARCH}" - -PV = "01.00.00" -PR = "r1" - -BRANCH = "master" -SRC_URI = "git://git.ti.com/git/apps/tensorflow-lite-examples.git;protocol=https;branch=${BRANCH} \ - http://storage.googleapis.com/download.tensorflow.org/models/tflite/gpu/deeplabv3_257_mv_gpu.tflite;name=deeplabv3;subdir=${WORKDIR}/model;destsuffix=model \ - http://storage.googleapis.com/download.tensorflow.org/models/mobilenet_v1_2018_02_22/mobilenet_v1_1.0_224.tgz;name=mobilenetv1;subdir=${WORKDIR}/model;destsuffix=model \ - http://raw.githubusercontent.com/google-coral/edgetpu/master/test_data/bird_segmentation.bmp;name=bird_segmentation;subdir=${WORKDIR}/test_data;destsuffix=test_data" - -SRC_URI[deeplabv3.md5sum] = "4a24db5a5fb05c47586a1197765e8548" -SRC_URI[deeplabv3.sha256sum] = "68a539782c2c6a72f8aac3724600124a85ed977162b44e84cbae5db717c933c6" -SRC_URI[mobilenetv1.md5sum] = "d5f69cef81ad8afb335d9727a17c462a" -SRC_URI[mobilenetv1.sha256sum] = "1ccb74dbd9c5f7aea879120614e91617db9534bdfaa53dfea54b7c14162e126b" -SRC_URI[bird_segmentation.md5sum] = "fc3202ac4e3033b36df3043de6dc32c9" -SRC_URI[bird_segmentation.sha256sum] = "e43cedd29ab385db787531c8a6cdcb31c5e4292af34f242877ed40611e502670" - -SRCREV = "bd6a429c21f96d5112e0b6dea44a13b748eefd74" - -S = "${WORKDIR}/git" - -EXTRA_OEMAKE = "\ - 'CXX=${CXX}' \ - 'CXXFLAGS=${CXXFLAGS}' \ - 'AR=${AR}' \ - 'LD=${LD}' \ - 'LDFLAGS=${LDFLAGS}' \ - 'TARGET=${TARGET_OS}' \ - 'TARGET_ARCH=${TARGET_ARCH}'" - -EXTRA_OEMAKE += "SYSROOT_INCDIR="${STAGING_INCDIR}" SYSROOT_LIBDIR="${STAGING_LIBDIR}" \ - TIDL_API_DIR="${STAGING_DATADIR}/ti/tidl"" - -TIDL = "no" -TIDL:dra7xx = "yes" -do_compile() { - oe_runmake -f Makefile TIDL_ACC=${TIDL} -} - -do_install() { - install -d ${D}${datadir}/tensorflow-lite/demos - install -m 0755 ${S}/tflite_classification ${D}${datadir}/tensorflow-lite/demos - install -m 0755 ${S}/tflite_segmentation ${D}${datadir}/tensorflow-lite/demos - install -m 0644 ${WORKDIR}/model/deeplabv3_257_mv_gpu.tflite ${D}${datadir}/tensorflow-lite/demos - install -m 0644 ${WORKDIR}/model/mobilenet_v1_1.0_224.tflite ${D}${datadir}/tensorflow-lite/demos - install -m 0644 ${WORKDIR}/test_data/bird_segmentation.bmp ${D}${datadir}/tensorflow-lite/demos - install -m 0755 ${S}/scripts/run*.sh ${D}${datadir}/tensorflow-lite/demos -} - -FILES:${PN} = "${datadir}/tensorflow-lite/demos" diff --git a/meta-arago-extras/recipes-support/tensorflow-lite/tensorflow-lite_1.15.bb b/meta-arago-extras/recipes-support/tensorflow-lite/tensorflow-lite_1.15.bb deleted file mode 100644 index e4a1ec85..00000000 --- a/meta-arago-extras/recipes-support/tensorflow-lite/tensorflow-lite_1.15.bb +++ /dev/null @@ -1,133 +0,0 @@ -DESCRIPTION = "TensorFlow's lightweight solution for mobile and embedded devices" -AUTHOR = "Google Inc. and Yuan Tang" -HOMEPAGE = "https://www.tensorflow.org/lite" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://LICENSE;md5=64a34301f8e355f57ec992c2af3e5157" - -MD5SUM_EIGEN = "a28a728acb3298471b11132ab5c0c3cb" -SHA256SUM_EIGEN = "7e7a57e33c59280a17a66e521396cd8b1a55d0676c9f807078522fda52114b5c" -MD5SUM_FFT = "4255dd8a74949d123216b1ab91520469" -SHA256SUM_FFT = "52bb637c70b971958ec79c9c8752b1df5ff0218a4db4510e60826e0cb79b5296" - -SRC_URI = "git://github.com/tensorflow/tensorflow.git;branch=r${PV};rev=590d6eef7e91a6a7392c8ffffb7b58f2e0c8bc6b;protocol=https \ - https://bitbucket.org/eigen/eigen/get/8071cda5714d.tar.gz;md5sum=${MD5SUM_EIGEN};sha256sum=${SHA256SUM_EIGEN} \ - git://github.com/google/gemmlowp;destsuffix=gemmlowp/;branch=master;rev=12fed0cd7cfcd9e169bf1925bc3a7a58725fdcc3;protocol=https \ - git://github.com/google/googletest;destsuffix=googletest/;branch=master;rev=release-1.8.0;protocol=https \ - git://github.com/abseil/abseil-cpp;destsuffix=abseil-cpp/;branch=master;rev=43ef2148c0936ebf7cb4be6b19927a9d9d145b8f;nobranch=1;protocol=https \ - git://github.com/intel/ARM_NEON_2_x86_SSE;destsuffix=neon_2_sse/;branch=master;rev=3057bb91b99bae9c7fbdf8710c032d462ca10051;protocol=https \ - git://github.com/google/farmhash;destsuffix=farmhash/;branch=master;rev=816a4ae622e964763ca0862d9dbd19324a1eaf45;protocol=https \ - git://github.com/google/flatbuffers;destsuffix=flatbuffers/;branch=master;rev=v1.11.0;protocol=https \ - https://mirror.bazel.build/www.kurims.kyoto-u.ac.jp/~ooura/fft.tgz;md5sum=${MD5SUM_FFT};sha256sum=${SHA256SUM_FFT} \ - http://download.tensorflow.org/models/mobilenet_v1_2018_08_02/mobilenet_v1_1.0_224_quant.tgz;name=mobilenet_v1_quant;subdir=${WORKDIR}/model;destsuffix=model \ - file://apply-modification-for-tflite-${PV}-to-eigen.patch \ - file://0001-Makefile-add-label_image-example-${PV}.patch \ - file://tflite-benchmark.sh \ - file://tensorflow-lite.pc.in" - -SRCREV_FORMAT="tensorflow_gemmlowp_googletest_abseil-cpp_ARM_NEON_2_x86_SSE_farmhash_flatbuffers" - -SRC_URI[mobilenet_v1_quant.md5sum] = "36af340c00e60291931cb30ce32d4e86" -SRC_URI[mobilenet_v1_quant.sha256sum] = "d32432d28673a936b2d6281ab0600c71cf7226dfe4cdcef3012555f691744166" - -PR = "r5" - -S = "${WORKDIR}/git" - -DEPENDS = "zlib" -TARGET_CFLAGS:remove = "-O2" -TARGET_CPPFLAGS:remove = "-O2" -TARGET_CXXFLAGS:remove = "-O2" -CFLAGS:append = " -O3 -DNDEBUG -fPIC -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK \ - -I${STAGING_INCDIR}" -CPPFLAGS:append = " -O3 -DNDEBUG -fPIC -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK \ - -I${STAGING_INCDIR}" -LDFLAGS:remove = "-Wl,-O1" -CXXFLAGS:append = " -O3 -DNDEBUG -fPIC -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK \ - -I${STAGING_INCDIR}" -LIBS = "-lstdc++ -lpthread -lm -lz -ldl -lrt" -BUILD_DEPS_DOWNLOAD_DIR_PREFIX = "${S}/tensorflow/lite/tools/make/downloads/" - -do_cp_downloaded_build_deps() { - mkdir -p ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}eigen - mkdir -p ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}gemmlowp - mkdir -p ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}googletest - mkdir -p ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}absl - mkdir -p ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}farmhash - mkdir -p ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}neon_2_sse - mkdir -p ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}flatbuffers - mkdir -p ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}fft2d - - cp -rf ${WORKDIR}/eigen-eigen-8071cda5714d/* "${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}eigen" - cp -rf ${WORKDIR}/gemmlowp/* "${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}gemmlowp/" - cp -rf ${WORKDIR}/googletest/* "${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}googletest/" - cp -rf ${WORKDIR}/abseil-cpp/* "${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}absl/" - cp -rf ${WORKDIR}/farmhash/* "${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}farmhash/" - cp -rf ${WORKDIR}/neon_2_sse/* "${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}neon_2_sse/" - cp -rf ${WORKDIR}/flatbuffers/* "${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}flatbuffers/" - cp -rf ${WORKDIR}/fft/* "${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}fft2d" -} -addtask do_cp_downloaded_build_deps after do_unpack before do_patch - -EXTRA_OEMAKE = "\ - 'CC=${CC}' \ - 'CXX=${CXX}' \ - 'CPP=${CPP}' \ - 'CFLAGS=${CFLAGS}' \ - 'CPPFLAGS=${CPPFLAGS}' \ - 'CXXFLAGS=${CXXFLAGS}' \ - 'AR=${AR}' \ - 'LD=${LD}' \ - 'LDFLAGS=${LDFLAGS}' \ - 'LIBS=${LIBS}' \ - 'TARGET=${TARGET_OS}' \ - 'TARGET_ARCH=${TUNE_ARCH}'" - -do_compile() { - oe_runmake -f tensorflow/lite/tools/make/Makefile -} - -do_install() { - install -d ${D}${libdir} - install -m 0644 ${S}/tensorflow/lite/tools/make/gen/${TARGET_OS}_${TUNE_ARCH}/lib/*.a ${D}${libdir}/ - install -d ${D}${includedir}/tensorflow/lite - install -m 0644 ${S}/tensorflow/lite/*.h ${D}${includedir}/tensorflow/lite/ - install -d ${D}${includedir}/tensorflow/lite/c - install -m 0644 ${S}/tensorflow/lite/c/*.h ${D}${includedir}/tensorflow/lite/c/ - install -d ${D}${includedir}/tensorflow/lite/core/ - install -m 0644 ${S}/tensorflow/lite/core/*.h ${D}${includedir}/tensorflow/lite/core/ - install -d ${D}${includedir}/tensorflow/lite/core/api/ - install -m 0644 ${S}/tensorflow/lite/core/api/*.h ${D}${includedir}/tensorflow/lite/core/api/ - install -d ${D}${includedir}/tensorflow/lite/kernels - install -m 0644 ${S}/tensorflow/lite/kernels/*.h ${D}${includedir}/tensorflow/lite/kernels/ - install -d ${D}${includedir}/tensorflow/lite/profiling/ - install -m 0644 ${S}/tensorflow/lite/profiling/*.h ${D}${includedir}/tensorflow/lite/profiling/ - install -d ${D}${includedir}/tensorflow/lite/schema/ - install -m 0644 ${S}/tensorflow/lite/schema/*.h ${D}${includedir}/tensorflow/lite/schema/ - install -m 0644 ${S}/tensorflow/lite/schema/schema.fbs ${D}${includedir}/tensorflow/lite/schema/ - install -d ${D}${includedir}/tensorflow/lite/tools/ - install -m 0644 ${S}/tensorflow/lite/tools/*.h ${D}${includedir}/tensorflow/lite/tools/ - install -d ${D}${includedir}/tensorflow/lite/delegates/nnapi/ - install -m 0644 ${S}/tensorflow/lite/delegates/nnapi/*.h ${D}${includedir}/tensorflow/lite/delegates/nnapi/ - install -d ${D}${includedir}/tensorflow/lite/experimental/resource_variable/ - install -m 0644 ${S}/tensorflow/lite/experimental/resource_variable/*.h ${D}${includedir}/tensorflow/lite/experimental/resource_variable/ - install -d ${D}${includedir}/tensorflow/lite/kernels/internal/ - install -m 0644 ${S}/tensorflow/lite/kernels/internal/*.h ${D}${includedir}/tensorflow/lite/kernels/internal/ - - install -d ${D}${libdir}/pkgconfig - install -m 0644 ${WORKDIR}/tensorflow-lite.pc.in ${D}${libdir}/pkgconfig/tensorflow-lite.pc - sed -i 's:@version@:${PV}:g - s:@libdir@:${libdir}:g - s:@includedir@:${includedir}:g' ${D}${libdir}/pkgconfig/tensorflow-lite.pc - # install examples - install -d ${D}${datadir}/${BPN}/examples - install -m 0755 ${S}/tensorflow/lite/tools/make/gen/${TARGET_OS}_${TUNE_ARCH}/bin/minimal ${D}${datadir}/${BPN}/examples - install -m 0755 ${S}/tensorflow/lite/tools/make/gen/${TARGET_OS}_${TUNE_ARCH}/bin/benchmark_model ${D}${datadir}/${BPN}/examples - install -m 0755 ${S}/tensorflow/lite/tools/make/gen/${TARGET_OS}_${TUNE_ARCH}/bin/label_image ${D}${datadir}/${BPN}/examples - install -m 0644 ${S}/tensorflow/lite/examples/label_image/testdata/grace_hopper.bmp ${D}${datadir}/${BPN}/examples - install -m 0644 ${S}/tensorflow/lite/java/ovic/src/testdata/labels.txt ${D}${datadir}/${BPN}/examples - install -m 0644 ${WORKDIR}/model/mobilenet_v1_1.0_224_quant.tflite ${D}${datadir}/${BPN}/examples - # install scripts for benchmarking - install -m 0755 ${WORKDIR}/tflite-benchmark.sh ${D}${datadir}/${BPN}/examples -} - -BBCLASSEXTEND = "native nativesdk"