"Access is denied" error while running cmake command in windows 11 command line

Hi,
I have been using below versions for build machine learning code

  1. CMake → 3.27.1
  2. Ninja —> 1.11.1
  3. Python → 3.9.0
  4. Make → 3.81

while building below commands for GitHub - alifsemi/alif_ml-embedded-evaluation-kit: Alif Semiconductor Repository forked from the ARM ml-embedded-evaluation-kit from https://git.mlplatform.org/ml/ethos-u/ml-embedded-evaluation-kit.git.

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 "Ninja" ..

is successful
2) ninja ethos-u-alif_kws giving below error and unable to solve it

D:\alif_ml-embedded-evaluation-kit\build_he>ninja ethos-u-alif_kws
[1/27] Building TensorFlow Lite Micro library...
FAILED: CMakeFiles/tensorflow_build D:/alif_ml-embedded-evaluation-kit/dependencies/tensorflow/tensorflow/tensorflow/lite/micro/tools/make/downloads lib/libtensorflow-microlite.a tensorflow/lib/libtensorflow-microlite.a D:/alif_ml-embedded-evaluation-kit/build_he/CMakeFiles/tensorflow_build D:/alif_ml-embedded-evaluation-kit/build_he/lib/libtensorflow-microlite.a D:/alif_ml-embedded-evaluation-kit/build_he/tensorflow/lib/libtensorflow-microlite.a
cmd.exe /C "cd /D 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.81-bin\bin C:\make-3.81-dep\bin 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 && C:\CMake\bin\cmake.exe -E copy D:/alif_ml-embedded-evaluation-kit/build_he/tensorflow//lib/libtensorflow-microlite.a D:/alif_ml-embedded-evaluation-kit/build_he/lib/libtensorflow-microlite.a"
Access is denied
[2/27] Linking C static library lib\libplatform_drivers_core.a
ninja: build stopped: subcommand failed.

I request you please help me in resolving this issue.

Thanks,
Srinivas.

Can you try running those commands individually manually to see which subcommand is actually having problems?

  1. cd /D D:\alif_ml-embedded-evaluation-kit\dependencies\tensorflow → successful
  2. C:\python\Lib\site-packages\cmake\data\bin\cmake.exe -E env PATH=D:/alif_ml-embedded-evaluation-kit/resources_downloaded/env/bin:C:\python C:\python\Scripts C:\CMake\bin C:\ArmCompilerforEmbedded6.18\bin C:\ninja-win C:\ProgramData\chocolatey\bin C:\make-3.81\bin C:\make-3.81-dep\bin → failing with error “Access is denied”. Even I have not run the "make "

Any issue here?

Some quoting may need to be involved there, but PATH really should have \ as directory separators since not everything in that codepath supports / separators.

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.81-bin\bin C:\make-3.81-dep\bin " C:\python"
Access is denied

even changing to backward slash also giving error

By inspection of the command line in your output starting with “cmd.exe” I can see the script is using Unix command line semantics on Windows, which will always fail. Specifically I see colon : being used as a path separator and then mixed with “;”, so then CMake expands that into trying to execute a directory as a binary, which gives the Access Denied error.

Their CMakeLists.txt seems to be making assumptions it’s on a Unix-like machine. So the “alifsemi” project probably needs to fix and test their CMakeLists.txt overall on Windows.

The line with all the env Python paths should be one semicolon separated value. Right now the spaces tell Windows command prompt to run as an executable.

That CMake -E env PATH= needs those several paths as one value, enclosed in double quotes and semicolon separated. This problem probably comes from their CMakeLists.txt not correct syntax for Windows as well as Unix.