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

**URL:** https://discourse.cmake.org/t/access-is-denied-error-while-running-cmake-command-in-windows-11-command-line/8750
**Category:** Usage
**Tags:** os:windows
**Created:** [August 16, 2023, 2:01pm UTC](https://discourse.cmake.org/t/access-is-denied-error-while-running-cmake-command-in-windows-11-command-line/8750 "2023-08-16T14:01:34Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![SrinivasRagolu-AlifS](https://discourse.cmake.org/user_avatar/discourse.cmake.org/srinivasragolu-alifs/32/3723_2.png) [@SrinivasRagolu-AlifS](https://discourse.cmake.org/u/SrinivasRagolu-AlifS)
#### Post date: [August 16, 2023, 2:01pm UTC](https://discourse.cmake.org/t/access-is-denied-error-while-running-cmake-command-in-windows-11-command-line/8750/1 "2023-08-16T14:01:34Z")

</div>

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.](https://github.com/alifsemi/alif_ml-embedded-evaluation-kit)

```auto
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

```auto
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.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [August 16, 2023, 2:10pm UTC](https://discourse.cmake.org/t/access-is-denied-error-while-running-cmake-command-in-windows-11-command-line/8750/2 "2023-08-16T14:10:51Z")

</div>

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

---

<div class="post-metadata">

### Author: ![SrinivasRagolu-AlifS](https://discourse.cmake.org/user_avatar/discourse.cmake.org/srinivasragolu-alifs/32/3723_2.png) [@SrinivasRagolu-AlifS](https://discourse.cmake.org/u/SrinivasRagolu-AlifS)
#### Post date: [August 16, 2023, 2:16pm UTC](https://discourse.cmake.org/t/access-is-denied-error-while-running-cmake-command-in-windows-11-command-line/8750/3 "2023-08-16T14:16:13Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [August 16, 2023, 2:20pm UTC](https://discourse.cmake.org/t/access-is-denied-error-while-running-cmake-command-in-windows-11-command-line/8750/4 "2023-08-16T14:20:22Z")

</div>

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

---

<div class="post-metadata">

### Author: ![SrinivasRagolu-AlifS](https://discourse.cmake.org/user_avatar/discourse.cmake.org/srinivasragolu-alifs/32/3723_2.png) [@SrinivasRagolu-AlifS](https://discourse.cmake.org/u/SrinivasRagolu-AlifS)
#### Post date: [August 16, 2023, 2:29pm UTC](https://discourse.cmake.org/t/access-is-denied-error-while-running-cmake-command-in-windows-11-command-line/8750/5 "2023-08-16T14:29:34Z")

</div>

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

---

<div class="post-metadata">

### Author: ![scivision](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a87d85/32.png) [@scivision](https://discourse.cmake.org/u/scivision)
#### Post date: [August 16, 2023, 4:41pm UTC](https://discourse.cmake.org/t/access-is-denied-error-while-running-cmake-command-in-windows-11-command-line/8750/6 "2023-08-16T16:41:04Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![scivision](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a87d85/32.png) [@scivision](https://discourse.cmake.org/u/scivision)
#### Post date: [August 16, 2023, 4:43pm UTC](https://discourse.cmake.org/t/access-is-denied-error-while-running-cmake-command-in-windows-11-command-line/8750/7 "2023-08-16T16:43:11Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![scivision](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/s/a87d85/32.png) [@scivision](https://discourse.cmake.org/u/scivision)
#### Post date: [August 16, 2023, 4:44pm UTC](https://discourse.cmake.org/t/access-is-denied-error-while-running-cmake-command-in-windows-11-command-line/8750/8 "2023-08-16T16:44:29Z")

</div>

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.
