summaryrefslogtreecommitdiff
path: root/scripts/cmake
diff options
context:
space:
mode:
authorKshitij Sisodia <kshitij.sisodia@arm.com>2021-06-25 09:55:14 +0100
committerIsabella Gottardi <isabella.gottardi@arm.com>2021-07-01 18:15:26 +0000
commit1da52aeb4468ad97c09e383400bbabc8c3c77227 (patch)
treed343f44adeee5beea565e1dedfd5be74bf35b039 /scripts/cmake
parentd475f09826e838c2563ea634dafcbdff901c61b8 (diff)
downloadml-embedded-evaluation-kit-1da52aeb4468ad97c09e383400bbabc8c3c77227.tar.gz
MLECO-718: Minor imporovements to source gen
Changes: * minor speed up for tflite to C++ file generation * virtual env's pip upgrade before installation of packages Change-Id: If8cef85779b7381f444f608b565da0b8f994d364
Diffstat (limited to 'scripts/cmake')
-rw-r--r--scripts/cmake/source_gen_utils.cmake22
1 files changed, 19 insertions, 3 deletions
diff --git a/scripts/cmake/source_gen_utils.cmake b/scripts/cmake/source_gen_utils.cmake
index 92ec53d..9d27b4d 100644
--- a/scripts/cmake/source_gen_utils.cmake
+++ b/scripts/cmake/source_gen_utils.cmake
@@ -272,22 +272,38 @@ function(setup_source_generator)
message(STATUS "Using existing python at ${PYTHON}")
return()
endif ()
+
message(STATUS "Configuring python environment at ${PYTHON}")
+
execute_process(
COMMAND ${PY_EXEC} -m venv ${CMAKE_BINARY_DIR}/pyenv
RESULT_VARIABLE return_code
)
+ if (NOT return_code STREQUAL "0")
+ message(FATAL_ERROR "Failed to setup python3 environment. Return code: ${return_code}")
+ endif ()
+
+ execute_process(
+ COMMAND ${PYTHON} -m pip install --upgrade pip
+ RESULT_VARIABLE return_code
+ )
if (NOT return_code EQUAL "0")
- message(FATAL_ERROR "Failed to setup python3 environment")
+ message(FATAL_ERROR "Failed to upgrade pip")
endif ()
- execute_process(COMMAND ${PYTHON} -m pip install wheel)
+ execute_process(
+ COMMAND ${PYTHON} -m pip install wheel
+ RESULT_VARIABLE return_code
+ )
+ if (NOT return_code EQUAL "0")
+ message(FATAL_ERROR "Failed to install wheel")
+ endif ()
execute_process(
COMMAND ${PYTHON} -m pip install -r ${SCRIPTS_DIR}/py/requirements.txt
RESULT_VARIABLE return_code
)
if (NOT return_code EQUAL "0")
- message(FATAL_ERROR "Failed to setup python3 environment")
+ message(FATAL_ERROR "Failed to install requirements")
endif ()
endfunction()