summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKshitij Sisodia <kshitij.sisodia@arm.com>2022-04-21 09:48:10 +0100
committerKshitij Sisodia <kshitij.sisodia@arm.com>2022-04-21 09:51:03 +0100
commitb1904b11d15da48c7ead4e6bb85c3e671956ab03 (patch)
tree4512cea36b3bae2d9789908b97533d637d298eac /scripts
parentc20be97af1c3e4d569d37587cd22d343193c7563 (diff)
downloadml-embedded-evaluation-kit-b1904b11d15da48c7ead4e6bb85c3e671956ab03.tar.gz
MLECO-3110: Fix for warnings from TensorFlow Lite Micro
Changes to fix "Pillow not found" warnings from TensorFlow Lite Micro build. Change-Id: I42a9b3f6df746ac3e34585e0c79ffdf35da97aef Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cmake/source_gen_utils.cmake1
-rw-r--r--scripts/cmake/tensorflow.cmake11
2 files changed, 10 insertions, 2 deletions
diff --git a/scripts/cmake/source_gen_utils.cmake b/scripts/cmake/source_gen_utils.cmake
index cd2698c..29efc93 100644
--- a/scripts/cmake/source_gen_utils.cmake
+++ b/scripts/cmake/source_gen_utils.cmake
@@ -277,6 +277,7 @@ function(setup_source_generator)
set(PYTHON ${DEFAULT_VENV_DIR}/bin/${PY_EXEC})
endif()
set(PYTHON ${PYTHON} PARENT_SCOPE)
+ set(PYTHON_VENV ${DEFAULT_VENV_DIR} PARENT_SCOPE)
if (EXISTS ${PYTHON})
message(STATUS "Using existing python at ${PYTHON}")
diff --git a/scripts/cmake/tensorflow.cmake b/scripts/cmake/tensorflow.cmake
index 127724b..2374c86 100644
--- a/scripts/cmake/tensorflow.cmake
+++ b/scripts/cmake/tensorflow.cmake
@@ -72,11 +72,18 @@ endif()
list(APPEND MAKE_TARGETS_LIST "microlite")
message(STATUS "TensorFlow Lite Micro build to be called for these targets: ${MAKE_TARGETS_LIST}")
+# Add virtual environment's Python directory path to the system path.
+# NOTE: This path is passed to the TensorFlow Lite Micro's make env
+# as it depends on some basic Python packages (like Pillow) installed
+# and the system-wide Python installation might not have them.
+set(ENV_PATH "${PYTHON_VENV}/bin:$ENV{PATH}")
+
# Commands and targets
add_custom_target(tensorflow_build ALL
# Command to build the TensorFlow Lite Micro library
- COMMAND make -j${J} -f ${TENSORFLOW_LITE_MICRO_PATH}/tools/make/Makefile ${MAKE_TARGETS_LIST}
+ COMMAND ${CMAKE_COMMAND} -E env PATH=${ENV_PATH}
+ make -j${J} -f ${TENSORFLOW_LITE_MICRO_PATH}/tools/make/Makefile ${MAKE_TARGETS_LIST}
TARGET_TOOLCHAIN_ROOT=${TENSORFLOW_LITE_MICRO_TARGET_TOOLCHAIN_ROOT}
TOOLCHAIN=${TENSORFLOW_LITE_MICRO_TOOLCHAIN}
GENDIR=${TENSORFLOW_LITE_MICRO_GENDIR}
@@ -127,4 +134,4 @@ target_include_directories(tensorflow-lite-micro
target_compile_definitions(tensorflow-lite-micro
INTERFACE
- TF_LITE_STATIC_MEMORY) \ No newline at end of file
+ TF_LITE_STATIC_MEMORY)