Build support of ml evaluation kit on windows

Hi All,

I recently started working on ml-embedded-evaluation-kit and it works fine on reference board. But now requirement is to have build on windows without using VM or WSL.

I have installed all the dependencies in windows 11, but struggling to build sample applications. Could you please provide any pointers to move on building part on windows?

Thanks and Regards,
Srinivas.

Hi Srinivas,

We haven’t really tested building and running on Windows natively, but it is definitely something we can take a look at now. To help us out you say you have all the dependencies installed now, what exactly is the issue you are running into when building the sample applications?

Best regards,
Richard

Hi,

After downloading the dependencies on windows and run the cmake command, I got following output

image001.png

Think your image wasn’t uploaded correctly, would you be able to post it again?

Srinivasa Rao Ragolu@DESKTOP-L4PCEH6 MINGW64 /c/AIML/alif_ml-embedded-evaluation-kit/build_he (main)
$ cmake -DTARGET_PLATFORM=ensemble -DTARGET_SUBSYSTEM=RTSS-HE -DTARGET_BOARD=AppKit_Alpha2 -DCMAKE_TOOLCHAIN_FILE=scripts/cmake/toolchains/bare-metal-armclang.cmake -DGLCD_UI=NO -DLINKER_SCRIPT_NAME=ensemble-RTSS-HE-TCM -DCMAKE_BUILD_TYPE=Release -DLOG_LEVEL=LOG_LEVEL_DEBUG -G “MinGW Makefiles” …
– Build type is set to Release
– Source directory: C:/AIML/alif_ml-embedded-evaluation-kit
– Binary directory: C:/AIML/alif_ml-embedded-evaluation-kit/build_he
– Assessing common user options…
– User option LOG_LEVEL is set to LOG_LEVEL_DEBUG
– User option TENSORFLOW_SRC_PATH is set to C:/AIML/alif_ml-embedded-evaluation-kit/dependencies/tensorflow
– User option TARGET_PLATFORM is set to ensemble
– User option TARGET_SUBSYSTEM is set to RTSS-HE
– User option ETHOS_U_NPU_ENABLED is set to ON
– User option USE_CASE_BUILD is set to all
– User option CPU_PROFILE_ENABLED is set to OFF
– User option TENSORFLOW_LITE_MICRO_BUILD_TYPE is set to $<IF:$CONFIG:RELEASE,release_with_logs,debug>
– User option TENSORFLOW_LITE_MICRO_CLEAN_DOWNLOADS is set to OFF
– User option TENSORFLOW_LITE_MICRO_CLEAN_BUILD is set to ON
– User option USE_SINGLE_INPUT is set to OFF
– User option CMSIS_SRC_PATH is set to C:/AIML/alif_ml-embedded-evaluation-kit/dependencies/cmsis
– User option CMSIS_DSP_SRC_PATH is set to C:/AIML/alif_ml-embedded-evaluation-kit/dependencies/cmsis-dsp
– User option CMSIS_NN_SRC_PATH is set to C:/AIML/alif_ml-embedded-evaluation-kit/dependencies/cmsis-nn
– User option LVGL_SRC_PATH is set to C:/AIML/alif_ml-embedded-evaluation-kit/dependencies/lvgl
– User option ARM_2D_SRC_PATH is set to C:/AIML/alif_ml-embedded-evaluation-kit/dependencies/Arm-2D
– User option ETHOS_U_NPU_TIMING_ADAPTER_SRC_PATH is set to C:/AIML/alif_ml-embedded-evaluation-kit/dependencies/core-platform/drivers/timing_adapter
– User option ETHOS_U_NPU_DRIVER_SRC_PATH is set to C:/AIML/alif_ml-embedded-evaluation-kit/dependencies/core-driver
– User option ETHOS_U_NPU_ID is set to U55
– User option ETHOS_U_NPU_MEMORY_MODE is set to Shared_Sram
– User option ETHOS_U_NPU_CONFIG_ID is set to H128
– User option ETHOS_U_NPU_TIMING_ADAPTER_ENABLED is set to ON
– User option TA_CONFIG_FILE is set to C:/AIML/alif_ml-embedded-evaluation-kit/scripts/cmake/timing_adapter/ta_config_u55_high_end.cmake
– User option BUILD_FVP_TESTS is set to OFF
– Searching for ensemble build configuration
– Found build configuration: C:/AIML/alif_ml-embedded-evaluation-kit/scripts/cmake/platforms/ensemble
– Board: Alif Semiconductor AppKit_Alpha2
– Platform: Ensemble RTSS-HE
– Forced ETHOS_U_NPU_CONFIG_ID to H128
– Using CMAKE_TOOLCHAIN_FILE: scripts/cmake/toolchains/bare-metal-armclang.cmake
– The C compiler identification is unknown
– The CXX compiler identification is unknown
– The ASM compiler identification is ARMCC
– Found assembler: C:/Program Files/ArmCompilerforEmbedded6.18/bin/armasm.exe
– Detecting C compiler ABI info
– Detecting C compiler ABI info - failed
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - failed
CMake Error at scripts/cmake/toolchains/bare-metal-armclang.cmake:182 (message):
Arm compiler version must be 6.16 or greater.
Call Stack (most recent call first):
CMakeLists.txt:101 (enforce_compiler_version)

– Configuring incomplete, errors occurred!

Looks like CMake couldn’t find your installed compiler and that might be causing issues here.

You could also try with GNU compiler to see if that helps to get past this CMake configuration stage? We expect that their may be issues when building TensorFlow Lite Micro but will be good to get to that stage first.

I have installed ARMCompiler6.18_standalone_win-x86_64.zip, setup.exe and also added the PATH env variable. Able to detect when I run from command line.

But unable to understand why cmake is not picking up this compiler.

Yep from a quick search it is hard to find an exact cause for this. We will try to get this tested ourselves on a Windows machine to try and replicate the issue with ARMCompiler.

In the meantime would you be able to try with the GNU Compiler to see if you get the same issue or not?

I could able to fix this issue by doing below chages in the build

  1. Added additional option to cmake " -G “MinGW Makefiles”
    cmake -DTARGET_PLATFORM=ensemble -DTARGET_SUBSYSTEM=RTSS-HE -DTARGET_BOARD=AppKit_Alpha2 -DCMAKE_TOOLCHAIN_FILE=scripts/cmake/toolchains/bare-metal-armclang.cmake -DGLCD_UI=NO -DLINKER_SCRIPT_NAME=ensemble-RTSS-HE-TCM -DCMAKE_BUILD_TYPE=Release -DLOG_LEVEL=LOG_LEVEL_DEBUG -G “MinGW Makefiles” …

  2. exported License file
    export ARMLMD_LICENSE_FILE="/c/AIML/license.lic"

Now failing in the linking phase
[ 88%] Building C object math/CMakeFiles/cmsis-dsp.dir///dependencies/cmsis-dsp/Source/BasicMathFunctions/arm_sub_q7.o
[ 88%] Linking C static library …\lib\libcmsis-dsp.a
[ 88%] Built target cmsis-dsp
make[1]: *** [CMakeFiles/ethos-u-alif_kws.dir/rule] Error 2
make: *** [ethos-u-alif_kws] Error 2

Thanks ,
Srinivas

By any chance regarding any leads towards windows native support ?

Thanks,
Srinivas.

Hi Srinivas,

Apologies for the slow response. We have the MLEK set up in a Windows environment and are actively working to reproduce the issues you’re running into. We’ll report back to you as soon as we can!

Thanks,

Alex

1 Like

Thanks, Alex,

I have changed the MingW build engine to “Ninja” and faced specific issues while linking. Today I also tried with the "-G “Unix Makefiles” option. But still at the last moment, at the linking phase, it is failing.

I could tell that primarily due to differences between Unix and Windows usage such as Bash/Bat kind differences. Makefiles are mostly Unix-supported and partially Windows NT. Windows syntax errors.

My request is to you all, If you could provide your working beta copy, I will start working on it. Like a beta copy of the source code.

Thanks,
Srinivas.

Hi Srinivas,

I’ve been taking a look at the MLEK on Windows and I wanted to ask how far you got with certain parts of the build process.

As Richard mentioned above, we certainly expected issues with the TensorFlow Lite Micro build. Were you able to get this building successfully? I have found that it is necessary to have some kind of Bash available on the system (for example Git Bash) with other required tooling installed (e.g. wget).

Since the Makefile for TensorFlow Lite Micro is part of the TFLite Micro repository, we can’t make it any more “Windows friendly” so we have to support it as-is.

How did you fix the issue you were having with the compiler version? Did you progress any further with the linking issue?

Hi Alex,

I was successful till the linking phase(made changes to a few scripts in the root directory) and got stuck over there due to a couple of issues mostly related to the compatibility such as the env PATH setting using cmake.exe in Windows format and later few bash scripts used in the generated makefiles. Windows native support is expected in the Tensorflow lite, I guess so far. I have not used even git-bash as I wanted to stick to Windows strictly. But you can try git-bash as well.

Log

[ 8%] Building TensorFlow Lite Micro library…
make[3]: Entering directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
make[3]: Nothing to be done for ‘npu/CMakeFiles/ethos_u_npu.dir/build’.
make[3]: Leaving directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
cd D:/alif_ml-embedded-evaluation-kit/dependencies/tensorflow && C:/CMake/bin/cmake.exe -E env PATH=D:/alif_ml-embedded-evaluation-kit/resources_downloaded/env/bin:C:\python C:\CMake\bin C:\ArmCompilerforEmbedded6.18\bin C:\ninja-win C:\Git\cmd C:\make-3.82\bin C:\python\Scripts “C:\Program Files\PuTTY” make -j8 -f D:/alif_ml-embedded-evaluation-kit/dependencies/tensorflow/tensorflow/lite/micro/tools/make/Makefile clean microlite TARGET_TOOLCHAIN_ROOT=C:/ArmCompilerforEmbedded6.18/bin/ TOOLCHAIN=armclang GENDIR=D:/alif_ml-embedded-evaluation-kit/build_he/tensorflow/ TARGET=cortex_m_generic TARGET_ARCH=cortex-m55 BUILD_TYPE=release_with_logs CMSIS_PATH=D:/alif_ml-embedded-evaluation-kit/dependencies/cmsis CMSIS_NN_PATH=D:/alif_ml-embedded-evaluation-kit/dependencies/cmsis-nn ETHOSU_ARCH=u55 ETHOSU_DRIVER_PATH=D:/alif_ml-embedded-evaluation-kit/dependencies/core-driver ETHOSU_DRIVER_LIBS=D:/alif_ml-embedded-evaluation-kit/build_he/lib/libethosu_core_driver.a CORE_OPTIMIZATION_LEVEL=-Ofast KERNEL_OPTIMIZATION_LEVEL=-Ofast THIRD_PARTY_KERNEL_OPTIMIZATION_LEVEL=-Ofast OPTIMIZED_KERNEL_DIR=cmsis_nn CO_PROCESSOR=ethos_u
make[3]: Entering directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
make[3]: Nothing to be done for ‘math/CMakeFiles/cmsis-dsp.dir/build’.
make[3]: Leaving directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
make[3]: Entering directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
make[3]: Nothing to be done for ‘cmsis_device/CMakeFiles/cmsis_ensemble.dir/build’.
make[3]: Leaving directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
[ 8%] Built target ethos_u_npu
[ 80%] Built target cmsis-dsp
[ 88%] Built target cmsis_ensemble
make -f math/CMakeFiles/arm_math.dir/build.make math/CMakeFiles/arm_math.dir/depend
make -f platform_driver/CMakeFiles/platform_drivers_core.dir/build.make platform_driver/CMakeFiles/platform_drivers_core.dir/depend
Access is deniedmake -f image/CMakeFiles/image_ensemble.dir/build.make image/CMakeFiles/image_ensemble.dir/depend

make[3]: *** [CMakeFiles/tensorflow_build.dir/build.make:74: CMakeFiles/tensorflow_build] Error 1
make[3]: Leaving directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
make[2]: *** [CMakeFiles/Makefile2:624: CMakeFiles/tensorflow_build.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs…


After setting PATH properly

Log 2


cd D:/alif_ml-embedded-evaluation-kit/dependencies/tensorflow && C:/CMake/bin/cmake.exe -E env PATH=“D:/alif_ml-embedded-evaluation-kit/resources_downloaded/env/bin:C:\python C:\CMake\bin C:\ArmCompilerforEmbedded6.18\bin C:\ninja-win C:\Git\cmd C:\make-3.82\bin C:\python\Scripts C:\Program Files\PuTTY” make -j8 -f D:/alif_ml-embedded-evaluation-kit/dependencies/tensorflow/tensorflow/lite/micro/tools/make/Makefile clean microlite TARGET_TOOLCHAIN_ROOT=C:/ArmCompilerforEmbedded6.18/bin/ TOOLCHAIN=armclang GENDIR=D:/alif_ml-embedded-evaluation-kit/build_he/tensorflow/ TARGET=cortex_m_generic TARGET_ARCH=cortex-m55 BUILD_TYPE=release_with_logs CMSIS_PATH=D:/alif_ml-embedded-evaluation-kit/dependencies/cmsis CMSIS_NN_PATH=D:/alif_ml-embedded-evaluation-kit/dependencies/cmsis-nn ETHOSU_ARCH=u55 ETHOSU_DRIVER_PATH=D:/alif_ml-embedded-evaluation-kit/dependencies/core-driver ETHOSU_DRIVER_LIBS=D:/alif_ml-embedded-evaluation-kit/build_he/lib/libethosu_core_driver.a CORE_OPTIMIZATION_LEVEL=-Ofast KERNEL_OPTIMIZATION_LEVEL=-Ofast THIRD_PARTY_KERNEL_OPTIMIZATION_LEVEL=-Ofast OPTIMIZED_KERNEL_DIR=cmsis_nn CO_PROCESSOR=ethos_u
[ 80%] Built target cmsis-dsp
make -f math/CMakeFiles/arm_math.dir/build.make math/CMakeFiles/arm_math.dir/depend
[ 80%] Built target ethos_u_npu
[ 88%] Built target cmsis_ensemble
make -f platform_driver/CMakeFiles/platform_drivers_core.dir/build.make platform_driver/CMakeFiles/platform_drivers_core.dir/depend
make -f image/CMakeFiles/image_ensemble.dir/build.make image/CMakeFiles/image_ensemble.dir/depend
make[3]: Entering directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
C:/CMake/bin/cmake.exe -E cmake_depends “Unix Makefiles” D:/alif_ml-embedded-evaluation-kit D:/alif_ml-embedded-evaluation-kit/source/math D:/alif_ml-embedded-evaluation-kit/build_he D:/alif_ml-embedded-evaluation-kit/build_he/math D:/alif_ml-embedded-evaluation-kit/build_he/math/CMakeFiles/arm_math.dir/DependInfo.cmake “–color=”
make[3]: Entering directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
C:/CMake/bin/cmake.exe -E cmake_depends “Unix Makefiles” D:/alif_ml-embedded-evaluation-kit D:/alif_ml-embedded-evaluation-kit/source/hal/source/platform/ensemble D:/alif_ml-embedded-evaluation-kit/build_he D:/alif_ml-embedded-evaluation-kit/build_he/platform_driver D:/alif_ml-embedded-evaluation-kit/build_he/platform_driver/CMakeFiles/platform_drivers_core.dir/DependInfo.cmake “–color=”
make[3]: Entering directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
C:/CMake/bin/cmake.exe -E cmake_depends “Unix Makefiles” D:/alif_ml-embedded-evaluation-kit D:/alif_ml-embedded-evaluation-kit/source/hal/source/components/image D:/alif_ml-embedded-evaluation-kit/build_he D:/alif_ml-embedded-evaluation-kit/build_he/image D:/alif_ml-embedded-evaluation-kit/build_he/image/CMakeFiles/image_ensemble.dir/DependInfo.cmake “–color=”
make[3]: Leaving directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
make[3]: Leaving directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
make[3]: Leaving directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
make -f platform_driver/CMakeFiles/platform_drivers_core.dir/build.make platform_driver/CMakeFiles/platform_drivers_core.dir/build
make -f math/CMakeFiles/arm_math.dir/build.make math/CMakeFiles/arm_math.dir/build
cmake -E env: no command given
make -f image/CMakeFiles/image_ensemble.dir/build.make image/CMakeFiles/image_ensemble.dir/build
make[3]: *** [CMakeFiles/tensorflow_build.dir/build.make:74: CMakeFiles/tensorflow_build] Error 1
make[3]: Leaving directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
make[2]: *** [CMakeFiles/Makefile2:624: CMakeFiles/tensorflow_build.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs…
make[3]: Entering directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
make[3]: Nothing to be done for ‘platform_driver/CMakeFiles/platform_drivers_core.dir/build’.
make[3]: Leaving directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
make[3]: Entering directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
make[3]: Nothing to be done for ‘image/CMakeFiles/image_ensemble.dir/build’.
make[3]: Leaving directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
make[3]: Entering directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
make[3]: Nothing to be done for ‘math/CMakeFiles/arm_math.dir/build’.
make[3]: Leaving directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
[ 88%] Built target platform_drivers_core
[ 91%] Built target image_ensemble
[ 94%] Built target arm_math
make[2]: Leaving directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’
make[1]: *** [CMakeFiles/Makefile2:961: CMakeFiles/ethos-u-alif_kws.dir/rule] Error 2
make[1]: Leaving directory ‘D:/alif_ml-embedded-evaluation-kit/build_he’


Also observed certain static libraries are not in the specified path. Will look into it once I get free. You can continue and let me know if you find something useful. But for sure some native support work is required.

Thanks
Srinivas