Skip to contentSkip to conversation

glow: Fix problem with RPATH and change LLVM to stable version 7.1

PATCH In review Djordje Senicic 2 participants 3 messages Aug 8, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 glow: Fix problem with RPATH and change LLVM to stable version 7.1

---
 ...p-compilation-of-native-helper-tools.patch | 95 +++++++++++++++++++
 recipes-devtools/glow/glow_git.bb             | 48 +++++++---
 recipes-devtools/glow/llvm-glow_git.bb        | 10 +-
 3 files changed, 137 insertions(+), 16 deletions(-)
 create mode 100644 recipes-devtools/glow/files/0002-Skip-compilation-of-native-helper-tools.patch
recipes-devtools/glow/files/0002-Skip-compilation-of-native-helper-tools.patch new file +95 -0
new file mode 100644
index 0000000..e60c399
@@ -0,0 +1,95 @@
+From 923f66a209c329b2d5ab245e1c02f91fa6705d4c Mon Sep 17 00:00:00 2001
+From: Djordje Senicic <[email protected]>
+Date: Thu, 1 Aug 2019 04:58:24 -0400
+Subject: [PATCH] Skip compilation of native helper tools
+
+Signed-off-by: Djordje Senicic <[email protected]>
+---
+ lib/Backends/CPU/CMakeLists.txt    |  2 +-
+ lib/Backends/OpenCL/CMakeLists.txt | 12 ++++++------
+ lib/Graph/CMakeLists.txt           |  3 +--
+ lib/IR/CMakeLists.txt              |  3 +--
+ 4 files changed, 9 insertions(+), 11 deletions(-)
+
+diff --git a/lib/Backends/CPU/CMakeLists.txt b/lib/Backends/CPU/CMakeLists.txt
+index 1e734539..0d5c5e60 100644
+--- a/lib/Backends/CPU/CMakeLists.txt
++++ b/lib/Backends/CPU/CMakeLists.txt
+@@ -53,7 +53,7 @@ add_custom_command(
+ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/glow/CPU)
+ add_custom_command(
+     OUTPUT ${CMAKE_BINARY_DIR}/glow/CPU/libjit_bc.inc
+-    COMMAND include-bin "${CMAKE_BINARY_DIR}/CPU/libjit.bc" "${CMAKE_BINARY_DIR}/glow/CPU/libjit_bc.inc"
++    COMMAND ${GLOW_BINARY_DIR}/bin/include-bin "${CMAKE_BINARY_DIR}/CPU/libjit.bc" "${CMAKE_BINARY_DIR}/glow/CPU/libjit_bc.inc"
+     DEPENDS ${GLOW_BINARY_DIR}/CPU/libjit.bc
+     WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
+ 
+diff --git a/lib/Backends/OpenCL/CMakeLists.txt b/lib/Backends/OpenCL/CMakeLists.txt
+index fd9f965c..e37b4b35 100644
+--- a/lib/Backends/OpenCL/CMakeLists.txt
++++ b/lib/Backends/OpenCL/CMakeLists.txt
+@@ -8,25 +8,25 @@ add_custom_target(make_opencl_dir
+ 
+ add_custom_command(
+   OUTPUT "${OpenCL_DIR}/kernels.cl.inc"
+-  COMMAND include-bin
++  COMMAND ${GLOW_BINARY_DIR}/bin/include-bin
+           "${CMAKE_CURRENT_SOURCE_DIR}/kernels.cl"
+           "${OpenCL_DIR}/kernels.cl.inc"
+-  DEPENDS make_opencl_dir include-bin "${CMAKE_CURRENT_SOURCE_DIR}/kernels.cl")
++  DEPENDS make_opencl_dir ${GLOW_BINARY_DIR}/bin/include-bin "${CMAKE_CURRENT_SOURCE_DIR}/kernels.cl")
+ 
+ add_custom_command(
+   OUTPUT "${OpenCL_DIR}/kernels_fwd_conv.cl.inc"
+-  COMMAND include-bin
++  COMMAND ${GLOW_BINARY_DIR}/bin/include-bin
+           "${CMAKE_CURRENT_SOURCE_DIR}/kernels_fwd_conv.cl"
+           "${OpenCL_DIR}/kernels_fwd_conv.cl.inc"
+-  DEPENDS make_opencl_dir include-bin
++  DEPENDS make_opencl_dir ${GLOW_BINARY_DIR}/bin/include-bin
+           "${CMAKE_CURRENT_SOURCE_DIR}/kernels_fwd_conv.cl")
+ 
+ add_custom_command(
+   OUTPUT "${OpenCL_DIR}/kernels_fwd_quantized_conv.cl.inc"
+-  COMMAND include-bin
++  COMMAND ${GLOW_BINARY_DIR}/bin/include-bin
+           "${CMAKE_CURRENT_SOURCE_DIR}/kernels_fwd_quantized_conv.cl"
+           "${OpenCL_DIR}/kernels_fwd_quantized_conv.cl.inc"
+-  DEPENDS make_opencl_dir include-bin
++  DEPENDS make_opencl_dir ${GLOW_BINARY_DIR}/bin/include-bin
+           "${CMAKE_CURRENT_SOURCE_DIR}/kernels_fwd_quantized_conv.cl")
+ 
+ add_library(OpenCLBackend
+diff --git a/lib/Graph/CMakeLists.txt b/lib/Graph/CMakeLists.txt
+index 84589761..f0976259 100644
+--- a/lib/Graph/CMakeLists.txt
++++ b/lib/Graph/CMakeLists.txt
+@@ -7,8 +7,7 @@ add_custom_command(OUTPUT
+                    "${NODES_HDR}"
+                    "${NODES_SRC}"
+                    "${NODES_DEF}"
+-                   COMMAND NodeGen ${NODES_HDR} ${NODES_SRC} ${NODES_DEF}
+-                   DEPENDS NodeGen
++                   COMMAND ${GLOW_BINARY_DIR}/bin/NodeGen ${NODES_HDR} ${NODES_SRC} ${NODES_DEF}
+                    COMMENT "NodeGen: Generating nodes." VERBATIM)
+ add_custom_target(AutoGenNode
+                    DEPENDS
+diff --git a/lib/IR/CMakeLists.txt b/lib/IR/CMakeLists.txt
+index 7660308d..d5861bbb 100644
+--- a/lib/IR/CMakeLists.txt
++++ b/lib/IR/CMakeLists.txt
+@@ -13,10 +13,9 @@ add_custom_command(OUTPUT
+                     "${INSTR_BLD_HDR}"
+                     "${INSTR_BLD_SRC}"
+                     "${INSTR_IR_GEN}"
+-                    COMMAND InstrGen
++                    COMMAND ${GLOW_BINARY_DIR}/bin/InstrGen
+                       "${INSTR_HDR}" "${INSTR_SRC}" "${INSTR_DEF}"
+                       "${INSTR_BLD_HDR}" "${INSTR_BLD_SRC}" "${INSTR_IR_GEN}"
+-                    DEPENDS InstrGen
+                     COMMENT "InstrGen: Generating instructions." VERBATIM)
+ add_custom_target(AutoGenInstr
+                    DEPENDS
+-- 
+2.17.1
+
recipes-devtools/glow/glow_git.bb +37 -11

77 lines not on this page · raw message

recipes-devtools/glow/llvm-glow_git.bb +5 -5
index 58d392b..4c0d29e 100644
@@ -2,16 +2,16 @@ DESCRIPTION = "LLVM release suggested for pytorch glow neural network compiler"
 HOMEPAGE = "https://github.com/llvm-mirror/llvm"
 SECTION = "devel"
 LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=c6b766a4e85dd28301eeed54a6684648"
-PV = "8.0"
-PR = "r0"
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=c520ed40e11887bb1d24d86f7f5b1f05"
+PV = "7.0"
+PR = "r1"
 
 DEPENDS = "ninja-native protobuf-native libpng-native protobuf-native protobuf-c-native gflags-native glog-native"
 
 SOLIBVER = "1"
 
-SRC_URI = "git://github.com/llvm-mirror/llvm.git;protocol=https;branch=release_80;rev=5563a6a769b48912b9c8052124520610966eda28;destsuffix=git/llvm \
-           git://github.com/llvm-mirror/clang.git;protocol=https;branch=release_80;rev=ccfe04576c13497b9c422ceef0b6efe99077a392;destsuffix=git/clang \
+SRC_URI = "git://github.com/llvm-mirror/llvm.git;protocol=https;branch=release_70;rev=dd3329aeb25d87d4ac6429c0af220f92e1ba5f26;destsuffix=git/llvm \
+           git://github.com/llvm-mirror/clang.git;protocol=https;branch=release_70;rev=4519e2637fcc4bf6e3049a0a80e6a5e7b97667cb;destsuffix=git/clang \
            "
 
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 demo-glow: Cleanup of demo-glow after fixing RPATH issue in nativesdk, and restore glow and demo-glow in packagegroups

---
 recipes-apps/demo-glow/demo-glow.bb                   |  4 ++--
 recipes-apps/demo-glow/files/Makefile.build           |  3 ++-
 .../nativesdk-packagegroup-arago-tisdk-host.bbappend  |  4 ++++
 .../packagegroup-arago-tisdk-addons-sdk-host.bbappend | 11 +++++++++++
 ...ackagegroup-arago-tisdk-addons-sdk-target.bbappend |  6 ++++++
 .../packagegroup-arago-tisdk-addons.bbappend          |  7 +++++++
 .../ti-tisdk-makefile/ti-tisdk-makefile_1.0.bbappend  |  4 ++++
 7 files changed, 36 insertions(+), 3 deletions(-)
 create mode 100644 recipes-core/packagegroups/nativesdk-packagegroup-arago-tisdk-host.bbappend
recipes-apps/demo-glow/demo-glow.bb +2 -2
index 21d6bdf..9436349 100644
@@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
 PV = "1.0"
 PR = "r1" 
 
-DEPENDS    = "glow-native libpng"
+DEPENDS    = "glow-native libpng protobuf-native "
 
 SRC_URI = "https://raw.githubusercontent.com/pytorch/glow/1af031c9c040dd4ff843d9b50f83e71f6e605631/examples/bundles/lenet_mnist/main.cpp;name=lenet_mnist_main;subdir=src \
            file://0001-fix-missing-string.patch \
@@ -25,7 +25,7 @@ S = "${WORKDIR}/src"
 
 do_compile() {
    install -d ${WORKDIR}/build
-   LD_LIBRARY_PATH=${STAGING_DIR_NATIVE}/usr/lib ${STAGING_DIR_NATIVE}/usr/share/glow/bin/image-classifier ${STAGING_DIR_NATIVE}/usr/share/glow/tests/images/mnist/1_1008.png -m=mnist.onnx -image-mode=0to1 -model-input-name=data_0 -emit-bundle ${WORKDIR}/build/ -cpu -target armv7l-unknown-linux-gnueabihf   -network-name="lenet_mnist"
+   ${STAGING_DIR_NATIVE}/usr/share/glow/bin/image-classifier ${STAGING_DIR_NATIVE}/usr/share/glow/tests/images/mnist/1_1008.png -m=mnist.onnx -image-mode=0to1 -model-input-name=data_0 -emit-bundle ${WORKDIR}/build/ -cpu -target armv7l-unknown-linux-gnueabihf   -network-name="lenet_mnist"
    ${CXX} ${S}/main.cpp ${WORKDIR}/build/lenet_mnist.o -lm -lpng -fpack-struct=8 -fpermissive -o ${WORKDIR}/build/infer_mnist
 }
 
recipes-apps/demo-glow/files/Makefile.build +2 -1
index 044bbf9..baf1fc0 100644
@@ -6,7 +6,8 @@ DESTDIR ?=
 all: release
 
 lenet_mnist:
-	LD_LIBRARY_PATH=${SDK_PATH_NATIVE}/usr/lib ${SDK_PATH_NATIVE}/usr/share/glow/bin/image-classifier ${SDK_PATH_NATIVE}/usr/share/glow/tests/images/mnist/1_1008.png -m=mnist.onnx -image-mode=0to1 -model-input-name=data_0 -emit-bundle ./ -cpu -target armv7l-unknown-linux-gnueabihf   -network-name="lenet_mnist"
+	@. ${ENV_SETUP}; \
+	${SDK_PATH_NATIVE}/usr/share/glow/bin/image-classifier ${SDK_PATH_NATIVE}/usr/share/glow/tests/images/mnist/1_1008.png -m=mnist.onnx -image-mode=0to1 -model-input-name=data_0 -emit-bundle ./ -cpu -target armv7l-unknown-linux-gnueabihf   -network-name="lenet_mnist"
 
 release: lenet_mnist
 	@. ${ENV_SETUP}; \
recipes-core/packagegroups/nativesdk-packagegroup-arago-tisdk-host.bbappend new file +4 -0
new file mode 100644
index 0000000..b35282e
@@ -0,0 +1,4 @@
+PR_append = ".tisdk0"
+
+EXTRA_TI_TOOLS_append = " nativesdk-glow "
+
recipes-core/packagegroups/packagegroup-arago-tisdk-addons-sdk-host.bbappend +11 -0
index a8a0b2e..6349bcd 100644
@@ -18,3 +18,14 @@ EXTRA_LIBS_append_dra7xx = " \
 
 UTILS_append_am335x-evm = " pru-adc-src"
 
+EXTRA_PACKAGES_append_omap-a15 = " \
+    demo-glow-src \
+"
+
+EXTRA_PACKAGES_append_ti43x = " \
+    demo-glow-src \
+"
+    
+EXTRA_PACKAGES_append_ti33x = " \
+    demo-glow-src \
+"
recipes-core/packagegroups/packagegroup-arago-tisdk-addons-sdk-target.bbappend +6 -0
index 08f20e4..6d8a49e 100644
@@ -77,3 +77,9 @@ EXTRA_LIBS_append_dra7xx = " \
     tiovx-sys-iface \
 "
 
+EXTRA_PACKAGES_append_ti33x = " demo-glow-dev "
+
+EXTRA_PACKAGES_append_ti43x = " demo-glow-dev "
+
+EXTRA_PACKAGES_append_omap-a15 = " demo-glow-dev "
+
recipes-core/packagegroups/packagegroup-arago-tisdk-addons.bbappend +7 -0
index 0cf0322..f365dc6 100644
@@ -26,3 +26,10 @@ EXTRA_PACKAGES_append_armv7a = " zbar"
 UTILS_append = " net-snmp net-snmp-server-snmpd"
 
 EXTRA_PACKAGES_append_dra7xx = " tiovx-app-host tiovx-app-host-examples"
+
+EXTRA_PACKAGES_append_ti33x = " demo-glow "
+
+EXTRA_PACKAGES_append_ti43x = " demo-glow "
+
+EXTRA_PACKAGES_append_omap-a15 = " demo-glow "
+
recipes-tisdk/ti-tisdk-makefile/ti-tisdk-makefile_1.0.bbappend +4 -0
index acd396b..ead9d53 100644
@@ -10,6 +10,7 @@ SRC_URI_append = "\
     file://Makefile_tiovx-app-host \
     file://Makefile_tidl-examples \
     file://Makefile_pru-adc \
+    file://Makefile_demo-glow \
 "
 
 SRC_URI_append_omap-a15 = " file://Makefile_big-data-ipc-demo"
@@ -29,13 +30,16 @@ MAKEFILES_append_omap-a15 = " dual-camera-demo \
 "
 
 MAKEFILES_append_omap-a15 = " video-graphics-test \
+                              demo-glow \
 "
 
 MAKEFILES_append_ti43x = " evse-hmi \
+                           demo-glow \
 "
 
 MAKEFILES_append_ti33x = " evse-hmi \
 			   protection-relays-hmi \
+                           demo-glow \
 "
 
 MAKEFILES_append_k3 = " evse-hmi"
Signature · 1 line
2.17.1
#2 lore raw
In reply to Djordje Senicic

Can you separate the LLVM and GLOW changes into separate patches?

Quoted 14 lines · Djordje Senicic
---
  ...p-compilation-of-native-helper-tools.patch | 95 +++++++++++++++++++
  recipes-devtools/glow/glow_git.bb             | 48 +++++++---
  recipes-devtools/glow/llvm-glow_git.bb        | 10 +-
  3 files changed, 137 insertions(+), 16 deletions(-)

create mode 100644 recipes-devtools/glow/files/0002-Skip-compilation-of-native-helper-tools.patch

recipes-devtools/glow/files/0002-Skip-compilation-of-native-helper-tools.patch new file +0 -0
new file mode 100644
index 0000000..e60c399

recipes-devtools/glow/files/0002-Skip-compilation-of-native-helper-tools.patch line 5

Quoted 5 lines
recipes-devtools/glow/files/0002-Skip-compilation-of-native-helper-tools.patch new file +5 -0
@@ -0,0 +1,95 @@
+From 923f66a209c329b2d5ab245e1c02f91fa6705d4c Mon Sep 17 00:00:00 2001
+From: Djordje Senicic <[email protected]>
+Date: Thu, 1 Aug 2019 04:58:24 -0400
+Subject: [PATCH] Skip compilation of native helper tools
+

Patches should have an "Upstream-Status" to facilitate tracking. See https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations:_Upstream-Status

Quoted 112 lines
recipes-devtools/glow/files/0002-Skip-compilation-of-native-helper-tools.patch new file +90 -0
+Signed-off-by: Djordje Senicic <[email protected]>
+---
+ lib/Backends/CPU/CMakeLists.txt    |  2 +-
+ lib/Backends/OpenCL/CMakeLists.txt | 12 ++++++------
+ lib/Graph/CMakeLists.txt           |  3 +--
+ lib/IR/CMakeLists.txt              |  3 +--
+ 4 files changed, 9 insertions(+), 11 deletions(-)
+
+diff --git a/lib/Backends/CPU/CMakeLists.txt b/lib/Backends/CPU/CMakeLists.txt
+index 1e734539..0d5c5e60 100644
+--- a/lib/Backends/CPU/CMakeLists.txt
++++ b/lib/Backends/CPU/CMakeLists.txt
+@@ -53,7 +53,7 @@ add_custom_command(
+ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/glow/CPU)
+ add_custom_command(
+     OUTPUT ${CMAKE_BINARY_DIR}/glow/CPU/libjit_bc.inc
+-    COMMAND include-bin "${CMAKE_BINARY_DIR}/CPU/libjit.bc" "${CMAKE_BINARY_DIR}/glow/CPU/libjit_bc.inc"
++    COMMAND ${GLOW_BINARY_DIR}/bin/include-bin "${CMAKE_BINARY_DIR}/CPU/libjit.bc" "${CMAKE_BINARY_DIR}/glow/CPU/libjit_bc.inc"
+     DEPENDS ${GLOW_BINARY_DIR}/CPU/libjit.bc
+     WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}")
+
+diff --git a/lib/Backends/OpenCL/CMakeLists.txt b/lib/Backends/OpenCL/CMakeLists.txt
+index fd9f965c..e37b4b35 100644
+--- a/lib/Backends/OpenCL/CMakeLists.txt
++++ b/lib/Backends/OpenCL/CMakeLists.txt
+@@ -8,25 +8,25 @@ add_custom_target(make_opencl_dir
+
+ add_custom_command(
+   OUTPUT "${OpenCL_DIR}/kernels.cl.inc"
+-  COMMAND include-bin
++  COMMAND ${GLOW_BINARY_DIR}/bin/include-bin
+           "${CMAKE_CURRENT_SOURCE_DIR}/kernels.cl"
+           "${OpenCL_DIR}/kernels.cl.inc"
+-  DEPENDS make_opencl_dir include-bin "${CMAKE_CURRENT_SOURCE_DIR}/kernels.cl")
++  DEPENDS make_opencl_dir ${GLOW_BINARY_DIR}/bin/include-bin "${CMAKE_CURRENT_SOURCE_DIR}/kernels.cl")
+
+ add_custom_command(
+   OUTPUT "${OpenCL_DIR}/kernels_fwd_conv.cl.inc"
+-  COMMAND include-bin
++  COMMAND ${GLOW_BINARY_DIR}/bin/include-bin
+           "${CMAKE_CURRENT_SOURCE_DIR}/kernels_fwd_conv.cl"
+           "${OpenCL_DIR}/kernels_fwd_conv.cl.inc"
+-  DEPENDS make_opencl_dir include-bin
++  DEPENDS make_opencl_dir ${GLOW_BINARY_DIR}/bin/include-bin
+           "${CMAKE_CURRENT_SOURCE_DIR}/kernels_fwd_conv.cl")
+
+ add_custom_command(
+   OUTPUT "${OpenCL_DIR}/kernels_fwd_quantized_conv.cl.inc"
+-  COMMAND include-bin
++  COMMAND ${GLOW_BINARY_DIR}/bin/include-bin
+           "${CMAKE_CURRENT_SOURCE_DIR}/kernels_fwd_quantized_conv.cl"
+           "${OpenCL_DIR}/kernels_fwd_quantized_conv.cl.inc"
+-  DEPENDS make_opencl_dir include-bin
++  DEPENDS make_opencl_dir ${GLOW_BINARY_DIR}/bin/include-bin
+           "${CMAKE_CURRENT_SOURCE_DIR}/kernels_fwd_quantized_conv.cl")
+
+ add_library(OpenCLBackend
+diff --git a/lib/Graph/CMakeLists.txt b/lib/Graph/CMakeLists.txt
+index 84589761..f0976259 100644
+--- a/lib/Graph/CMakeLists.txt
++++ b/lib/Graph/CMakeLists.txt
+@@ -7,8 +7,7 @@ add_custom_command(OUTPUT
+                    "${NODES_HDR}"
+                    "${NODES_SRC}"
+                    "${NODES_DEF}"
+-                   COMMAND NodeGen ${NODES_HDR} ${NODES_SRC} ${NODES_DEF}
+-                   DEPENDS NodeGen
++                   COMMAND ${GLOW_BINARY_DIR}/bin/NodeGen ${NODES_HDR} ${NODES_SRC} ${NODES_DEF}
+                    COMMENT "NodeGen: Generating nodes." VERBATIM)
+ add_custom_target(AutoGenNode
+                    DEPENDS
+diff --git a/lib/IR/CMakeLists.txt b/lib/IR/CMakeLists.txt
+index 7660308d..d5861bbb 100644
+--- a/lib/IR/CMakeLists.txt
++++ b/lib/IR/CMakeLists.txt
+@@ -13,10 +13,9 @@ add_custom_command(OUTPUT
+                     "${INSTR_BLD_HDR}"
+                     "${INSTR_BLD_SRC}"
+                     "${INSTR_IR_GEN}"
+-                    COMMAND InstrGen
++                    COMMAND ${GLOW_BINARY_DIR}/bin/InstrGen
+                       "${INSTR_HDR}" "${INSTR_SRC}" "${INSTR_DEF}"
+                       "${INSTR_BLD_HDR}" "${INSTR_BLD_SRC}" "${INSTR_IR_GEN}"
+-                    DEPENDS InstrGen
+                     COMMENT "InstrGen: Generating instructions." VERBATIM)
+ add_custom_target(AutoGenInstr
+                    DEPENDS
+--
+2.17.1
+
recipes-devtools/glow/glow_git.bb +3 -4
index 3aea4b1..3024230 100644
@@ -8,13 +8,12 @@ PV = "0.1+git${SRCPV}"
  PR = "r0"
  SRCREV_FORMAT = "glow"
 
-DEPENDS_class-native    = "zlib zlib-native llvm-glow-native ninja-native protobuf-native libpng-native protobuf-native protobuf-c-native gflags-native glog-native"
-DEPENDS_class-nativesdk = "ncurses protobuf libpng glow-native zlib llvm-glow-native ninja-native protobuf-native libpng-native protobuf-c-native gflags-native glog-native"
+DEPENDS_class-native    = "zlib zlib-native llvm-glow-native ninja-native protobuf-native libpng-native protobuf-native protobuf-c-native gflags-native glog-native patchelf-native "
+DEPENDS_class-nativesdk = "ncurses protobuf zlib protobuf-c gflags glog ninja llvm-glow-native glow-native libpng-native patchelf-native "
 
-RDEPENDS_${PN}_class-nativesdk = "libpng ncurses glog"
+RDEPENDS_${PN}_class-nativesdk = "libpng ncurses glog protobuf "
 
  SRC_URI = "git://github.com/pytorch/glow.git;protocol=https;destsuffix=git;name=glow \
-           file://0001-Fix-path-and-dependencies-to-intermediate-executable.patch  \
             git://github.com/stp/OutputCheck.git;protocol=https;destsuffix=git/tests/OutputCheck;name=outcheck \
             git://github.com/google/benchmark.git;protocol=https;destsuffix=git/tests/googlebenchmark;name=gbench \
             git://github.com/google/googletest.git;protocol=https;destsuffix=git/tests/googletest;name=gtest \

recipes-devtools/glow/glow_git.bb SRC_URI = "git://github.com/pytorch/glow.git;protocol=https;destsuffix=git;name= · line 31

Quoted 7 lines
recipes-devtools/glow/glow_git.bb +4 -0
@@ -26,6 +25,11 @@ SRC_URI = "git://github.com/pytorch/glow.git;protocol=https;destsuffix=git;name=
             git://github.com/wjakob/clang-cindex-python3.git;protocol=https;destsuffix=git/thirdparty/onnx/third_party/pybind11/tools/clang;name=onnxclang \
            "
 
+SRC_URI_append_class-native = " file://0001-Fix-path-and-dependencies-to-intermediate-executable.patch \
+                              "
+SRC_URI_append_class-nativesdk = "file://0002-Skip-compilation-of-native-helper-tools.patch \
+                              "

This seems a little odd. Is there no target to build only the host tools?

recipes-devtools/glow/glow_git.bb S = "${WORKDIR}/git" · line 48

Quoted 10 lines
recipes-devtools/glow/glow_git.bb +2 -1
+
  SRCREV_glow = "ba8061367aea0b472b596448018107ca6e87929e"
  SRCREV_outcheck = "eab62a5dd5129f6a4ebfbe4bbe41d35611f7c48d"
  SRCREV_gbench = "090faecb454fbd6e6e17a75ef8146acb037118d4"
@@ -41,21 +45,43 @@ S = "${WORKDIR}/git"
 
  inherit pkgconfig cmake
 
-EXTRA_OECMAKE += " -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 " "
+EXTRA_OECMAKE_class-native += " -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 " "

Do we really need to specify the dynamic linker?

recipes-devtools/glow/glow_git.bb S = "${WORKDIR}/git" · line 59

Quoted 11 lines
recipes-devtools/glow/glow_git.bb +11 -0
+EXTRA_OECMAKE_class-nativesdk += " -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-Wl,-z,origin " "
+
+do_compile_class-native() {
+   cmake_runcmake_build --target ${OECMAKE_TARGET_COMPILE}
+}
+
+do_install_class-native() {
+   install -d ${D}${datadir}/glow/bin
+   install -d ${D}${datadir}/glow/tests/images
+   chrpath -d ${WORKDIR}/build/bin/*
+   cp -Prf --preserve=mode,timestamps  ${WORKDIR}/build/bin/include-bin ${D}${datadir}/glow/bin

Can you use relative paths? The PWD should be "${WORKDIR}/build" (i.e. "${B}").

Quoted 5 lines
recipes-devtools/glow/glow_git.bb +5 -0
+   cp -Prf --preserve=mode,timestamps  ${WORKDIR}/build/bin/InstrGen ${D}${datadir}/glow/bin
+   cp -Prf --preserve=mode,timestamps  ${WORKDIR}/build/bin/NodeGen ${D}${datadir}/glow/bin
+   cp -Prf --preserve=mode,timestamps  ${WORKDIR}/build/bin/image-classifier ${D}${datadir}/glow/bin
+   ${STAGING_DIR_NATIVE}/usr/bin/patchelf --set-rpath  "\$ORIGIN/../../../lib:\$ORIGIN/../../../../lib" ${D}${datadir}/glow/bin/image-classifier
+   cp -Prf --preserve=mode,timestamps  ${WORKDIR}/build/tests/images/imagenet ${D}${datadir}/glow/tests/images

recipes-devtools/glow/glow_git.bb S = "${WORKDIR}/git" · line 73

Quoted 10 lines
recipes-devtools/glow/glow_git.bb +8 -1
+   cp -Prf --preserve=mode,timestamps  ${WORKDIR}/build/tests/images/imagenet_299 ${D}${datadir}/glow/tests/images
+   cp -Prf --preserve=mode,timestamps  ${WORKDIR}/build/tests/images/mnist ${D}${datadir}/glow/tests/images
+}
 
-do_compile() {
+do_compile_class-nativesdk() {
+   install -d ${WORKDIR}/build/bin
+   cp ${STAGING_DIR_NATIVE}/usr/share/glow/bin/include-bin ${WORKDIR}/build/bin
+   cp ${STAGING_DIR_NATIVE}/usr/share/glow/bin/NodeGen ${WORKDIR}/build/bin
+   cp ${STAGING_DIR_NATIVE}/usr/share/glow/bin/InstrGen ${WORKDIR}/build/bin

Would it not be simpler to add to the PATH?

Quoted 24 lines
recipes-devtools/glow/glow_git.bb +4 -5
     cmake_runcmake_build --target ${OECMAKE_TARGET_COMPILE}
  }
 
-do_install () {
-   install -d ${D}${datadir}/glow
+do_install_class-nativesdk() {
+   install -d ${D}${datadir}/glow/bin
     install -d ${D}${datadir}/glow/tests/images
-   cp -Prf --preserve=mode,timestamps  ${WORKDIR}/build/bin ${D}${datadir}/glow
-   cp -Prf --preserve=mode,timestamps  ${WORKDIR}/build/tests/images/EmotionSampleImages ${D}${datadir}/glow/tests/images
+   cp -Prf --preserve=mode,timestamps  ${WORKDIR}/build/bin/image-classifier ${D}${datadir}/glow/bin
+   ${STAGING_DIR_NATIVE}/usr/bin/patchelf --set-rpath  "\$ORIGIN/../../../lib:\$ORIGIN/../../../../lib" ${D}${datadir}/glow/bin/image-classifier
     cp -Prf --preserve=mode,timestamps  ${WORKDIR}/build/tests/images/imagenet ${D}${datadir}/glow/tests/images
     cp -Prf --preserve=mode,timestamps  ${WORKDIR}/build/tests/images/imagenet_299 ${D}${datadir}/glow/tests/images
     cp -Prf --preserve=mode,timestamps  ${WORKDIR}/build/tests/images/mnist ${D}${datadir}/glow/tests/images
-   cp -Prf --preserve=mode,timestamps  ${WORKDIR}/build/tests/images/other ${D}${datadir}/glow/tests/images
  }
 
  BBCLASSEXTEND = "native nativesdk"
recipes-devtools/glow/llvm-glow_git.bb +0 -0
index 58d392b..4c0d29e 100644

recipes-devtools/glow/llvm-glow_git.bb DESCRIPTION = "LLVM release suggested for pytorch glow neural network compiler" · line 6

Quoted 8 lines
recipes-devtools/glow/llvm-glow_git.bb +2 -3
@@ -2,16 +2,16 @@ DESCRIPTION = "LLVM release suggested for pytorch glow neural network compiler"
  HOMEPAGE = "https://github.com/llvm-mirror/llvm"
  SECTION = "devel"
  LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=c6b766a4e85dd28301eeed54a6684648"
-PV = "8.0"
-PR = "r0"
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=c520ed40e11887bb1d24d86f7f5b1f05"
+PV = "7.0"

Commit log states "7.1"

recipes-devtools/glow/llvm-glow_git.bb DESCRIPTION = "LLVM release suggested for pytorch glow neural network compiler" · line 15

Quoted 11 lines
recipes-devtools/glow/llvm-glow_git.bb +3 -2
+PR = "r1"
 
  DEPENDS = "ninja-native protobuf-native libpng-native protobuf-native protobuf-c-native gflags-native glog-native"
 
  SOLIBVER = "1"
 
-SRC_URI = "git://github.com/llvm-mirror/llvm.git;protocol=https;branch=release_80;rev=5563a6a769b48912b9c8052124520610966eda28;destsuffix=git/llvm \
-           git://github.com/llvm-mirror/clang.git;protocol=https;branch=release_80;rev=ccfe04576c13497b9c422ceef0b6efe99077a392;destsuffix=git/clang \
+SRC_URI = "git://github.com/llvm-mirror/llvm.git;protocol=https;branch=release_70;rev=dd3329aeb25d87d4ac6429c0af220f92e1ba5f26;destsuffix=git/llvm \
+           git://github.com/llvm-mirror/clang.git;protocol=https;branch=release_70;rev=4519e2637fcc4bf6e3049a0a80e6a5e7b97667cb;destsuffix=git/clang \
             "

I have not seen any examples of "rev" used in SRC_URI. I understand that it works OK, but can you use SRCREV for consistency?

Quoted 2 lines