Skip to contentSkip to conversation

neo-ai-dlr: fix dlr runtime problem

PATCH New Jianzhong Xu 1 participant 1 message Nov 26, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 neo-ai-dlr: fix dlr runtime problem

* bump up neo-ai-dlr SRCREV
* add a patch to skip git cloning during cmake configuration
* move libdlr.so to python site-packages dlr folder
* add neo-ai-dlr-tests to target file system
* change testing scripts' path to be the same as in source code

---
 .../packagegroup-arago-tisdk-addons.bbappend  |  2 +-
 ...akeLists-skip-cloning-of-googletests.patch | 50 +++++++++++++++++++
 recipes-support/neo-ai/neo-ai-dlr_git.bb      | 24 +++++----
 3 files changed, 66 insertions(+), 10 deletions(-)
 create mode 100644 recipes-support/neo-ai/files/0001-CMakeLists-skip-cloning-of-googletests.patch
recipes-core/packagegroups/packagegroup-arago-tisdk-addons.bbappend +1 -1
index 2a298e0..aa0a182 100644
@@ -17,7 +17,7 @@ EXTRA_PACKAGES_append_k3 = " watchdog"
 
 EXTRA_PACKAGES_append_omapl138 = " ccief-basic"
 
-NEO_AI_PACKAGES = "neo-ai-dlr"
+NEO_AI_PACKAGES = "neo-ai-dlr neo-ai-dlr-tests"
 NEO_AI_PACKAGES_armv5 = ""
 
 EXTRA_PACKAGES_append = " hidapi \
recipes-support/neo-ai/files/0001-CMakeLists-skip-cloning-of-googletests.patch new file +50 -0

50 lines not on this page · raw message

recipes-support/neo-ai/neo-ai-dlr_git.bb +15 -9
index cbf4447..636714a 100644
@@ -26,9 +26,10 @@ SRC_URI = "git://github.com/neo-ai/neo-ai-dlr;protocol=https;branch=${BRANCH};na
            git://github.com/neo-ai/treelite;protocol=https;branch=master;destsuffix=${S}/3rdparty/treelite;name=neo-ai-treelite \
            git://github.com/dmlc/dmlc-core;protocol=https;branch=master;destsuffix=${S}/3rdparty/treelite/dmlc-core;name=neo-ai-treelite-dmlc-core \
            git://github.com/fmtlib/fmt;protocol=https;nobranch=1;destsuffix=${S}/3rdparty/treelite/3rdparty/fmt;name=neo-ai-treelite-fmt \
+           file://0001-CMakeLists-skip-cloning-of-googletests.patch \
 "
 
-SRCREV_neo-ai-dlr = "dd9c8e806065b2c0fca97209c8bfd1cce0749ea9"
+SRCREV_neo-ai-dlr = "35ed4fa2607056608451d85508fea70f458a14a6"
 SRCREV_neo-ai-tvm = "44779571412930681eef9e8b9d32aa845b8cc5ad"
 SRCREV_neo-ai-tvm-dmlc-core = "4d49691f1a9d944c3b0aa5e63f1db3cad1f941f8"
 SRCREV_neo-ai-tvm-dlpack = "bee4d1dd8dc1ee4a1fd8fa6a96476c2f8b7492a3"
@@ -41,26 +42,31 @@ S = "${WORKDIR}/git"
 
 inherit setuptools3 cmake python3native
 
+# Set B so that DLR Python installation can find the library
+B = "${S}/build"
+
 do_install() {
     # This does not do anything
     #cmake_do_install
 
-    install -d ${D}${libdir}
-    install -m 0644 ${S}/lib/* ${D}${libdir}
-
-    install -d ${D}${includedir}
-    install -m 0644 ${S}/include/* ${D}${includedir}
+    install -d ${D}${includedir}/dlr_tflite
+    install -m 0644 ${S}/include/*.h ${D}${includedir}
+    install -m 0644 ${S}/include/dlr_tflite/*.h ${D}${includedir}/dlr_tflite
 
+    # Install DLR Python binding
     cd ${S}/python
     distutils3_do_install
-    cd ${B}
 
     # setup.py install some libs under datadir, but we don't need them, so remove.
     rm ${D}${datadir}/dlr/*.so
 
+    # Install DLR library to Python import search path
+    install -m 0644 ${S}/build/lib/libdlr.so ${D}${PYTHON_SITEPACKAGES_DIR}/dlr
+
     # Now install python test scripts
-    install -d ${D}${datadir}/dlr/tests
-    install -m 0644 ${S}/tests/python/integration/*.py ${D}${datadir}/dlr/tests/
+    install -d ${D}${datadir}/dlr/tests/python/integration
+    install -m 0644 ${S}/tests/python/integration/*.py ${D}${datadir}/dlr/tests/python/integration
+    install -m 0644 ${S}/tests/python/integration/*.npy ${D}${datadir}/dlr/tests/python/integration
 }
 
 PACKAGES =+ "${PN}-tests"
Signature · 1 line
2.17.1