Skip to contentSkip to conversation

flatbuffers: add version 1.10.0

PATCH New Hongmei Gou 1 participant 3 messages Sep 18, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 flatbuffers: add version 1.10.0

* This is back ported from meta-openembedded master/warrior branch
* This version is required for building armnn with TensorFlow Lite parser

---
 .../flatbuffers/flatbuffers_1.10.0.bb         | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 recipes-devtools/flatbuffers/flatbuffers_1.10.0.bb
recipes-devtools/flatbuffers/flatbuffers_1.10.0.bb new file +34 -0
new file mode 100644
index 0000000..452e1e6
@@ -0,0 +1,34 @@
+SUMMARY = "Memory Efficient Serialization Library"
+HOMEPAGE = "https://github.com/google/flatbuffers"
+SECTION = "console/tools"
+LICENSE = "Apache-2.0"
+
+PACKAGE_BEFORE_PN = "${PN}-compiler"
+
+RDEPENDS_${PN}-compiler = "${PN}"
+RDEPENDS_${PN}-dev += "${PN}-compiler"
+
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a873c5645c184d51e0f9b34e1d7cf559"
+
+SRCREV = "c0698cc33f1e534bb59c455909b88cc2726089af"
+
+SRC_URI = "git://github.com/google/flatbuffers.git"
+
+# Make sure C++11 is used, required for example for GCC 4.9
+CXXFLAGS += "-std=c++11"
+BUILD_CXXFLAGS += "-std=c++11"
+
+# BUILD_TYPE=Release is required, otherwise flatc is not installed
+EXTRA_OECMAKE += "\
+    -DCMAKE_BUILD_TYPE=Release \
+    -DFLATBUFFERS_BUILD_TESTS=OFF \    
+    -DFLATBUFFERS_BUILD_SHAREDLIB=ON \
+"
+
+inherit cmake
+
+S = "${WORKDIR}/git"
+
+FILES_${PN}-compiler = "${bindir}"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/3 tensorflow-lite: install schema.fbs which is required to build armnn with TensorFlow Lite parser

---
 recipes-support/tensorflow-lite/tensorflow-lite_1.12.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
recipes-support/tensorflow-lite/tensorflow-lite_1.12.bb +2 -1
index 205977c..24b5bf9 100644
@@ -40,7 +40,7 @@ SRC_URI[mobilenet_v1_quant.sha256sum] = "d32432d28673a936b2d6281ab0600c71cf7226d
 
 SRCREV = "5b900cfe4b3b848f577315a0dde09a729f770e95"
 
-PR = "r3"
+PR = "r4"
 
 S = "${WORKDIR}/git"
 
@@ -112,6 +112,7 @@ do_install() {
     install -m 0644 ${S}/tensorflow/contrib/lite/profiling/*.h ${D}${includedir}/tensorflow/contrib/lite/profiling/
     install -d ${D}${includedir}/tensorflow/contrib/lite/schema/
     install -m 0644 ${S}/tensorflow/contrib/lite/schema/*.h ${D}${includedir}/tensorflow/contrib/lite/schema/
+    install -m 0644 ${S}/tensorflow/contrib/lite/schema/schema.fbs ${D}${includedir}/tensorflow/contrib/lite/schema/
     install -d ${D}${includedir}/tensorflow/contrib/lite/tools/
     install -m 0644 ${S}/tensorflow/contrib/lite/tools/*.h ${D}${includedir}/tensorflow/contrib/lite/tools/
     install -d ${D}${libdir}/pkgconfig
Signature · 1 line
2.17.1
#2 lore raw

PATCH 3/3 armnn: build armnn with TensorFlow Lite support

In reply to Hongmei Gou

* mobilenet_v2_1.0_224.tflite is also installed for using TFLite with ArmnnExamples

---
 ...sioned-library-for-armnnTfLiteParser.patch | 25 +++++++++++++++++
 recipes-support/armnn/armnn_git.bbappend      | 27 +++++++++++++++++++
 2 files changed, 52 insertions(+)
 create mode 100644 recipes-support/armnn/armnn/0011-Generate-versioned-library-for-armnnTfLiteParser.patch
 create mode 100644 recipes-support/armnn/armnn_git.bbappend
recipes-support/armnn/armnn/0011-Generate-versioned-library-for-armnnTfLiteParser.patch new file +25 -0
new file mode 100644
index 0000000..a504aa7
@@ -0,0 +1,25 @@
+From 1f5670c6ef8669d7d25621d9c97d66178800dcf9 Mon Sep 17 00:00:00 2001
+From: Hongmei Gou <[email protected]>
+Date: Tue, 17 Sep 2019 17:58:39 -0400
+Subject: [PATCH] Generate versioned library for armnnTfLiteParser
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Hongmei Gou <[email protected]>
+---
+ src/armnnTfLiteParser/CMakeLists.txt | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/armnnTfLiteParser/CMakeLists.txt b/src/armnnTfLiteParser/CMakeLists.txt
+index 17d4cf68..c83f7059 100755
+--- a/src/armnnTfLiteParser/CMakeLists.txt
++++ b/src/armnnTfLiteParser/CMakeLists.txt
+@@ -24,4 +24,5 @@ if(BUILD_TF_LITE_PARSER)
+     install(TARGETS armnnTfLiteParser
+             LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+             RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
++    set_target_properties(armnnTfLiteParser PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} )
+ endif()
+-- 
+2.17.1
+
recipes-support/armnn/armnn_git.bbappend new file +27 -0
new file mode 100644
index 0000000..26dfdad
@@ -0,0 +1,27 @@
+PR_append = ".tisdk0"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI += " \
+    file://0011-Generate-versioned-library-for-armnnTfLiteParser.patch \
+    https://storage.googleapis.com/mobilenet_v2/checkpoints/mobilenet_v2_1.0_224.tgz;name=mobilenetv2;subdir=${WORKDIR}/tfmodel;destsuffix=tfmodel \
+"
+
+SRC_URI[mobilenetv2.md5sum] = "519bba7052fd279c66d2a28dc3f51f46"
+SRC_URI[mobilenetv2.sha256sum] = "318084bc1b63d6d7b854553e09cdf77078b1c0168be27c59a0d44253b5ed49dc"
+
+DEPENDS += " \
+    tensorflow-lite \
+    flatbuffers \
+"
+
+EXTRA_OECMAKE += " \
+    -DBUILD_TF_LITE_PARSER=1 \
+    -DTF_LITE_GENERATED_PATH=${STAGING_DIR_HOST}${includedir}/tensorflow/contrib/lite/schema \
+    -DFLATBUFFERS_ROOT=${STAGING_DIR_HOST}${includedir}/flatbuffers \
+    -DFLATBUFFERS_LIBRARY=${STAGING_DIR_HOST}${libdir}/libflatbuffers.a \
+"
+
+do_install_append() {
+    cp ${WORKDIR}/tfmodel/mobilenet_v2_1.0_224.tflite ${D}${TESTVECS_INSTALL_DIR}/models
+}
Signature · 1 line
2.17.1