I'm trying to build tensorflow lite 2.16.2 (c++) for windows 10 and I'm getting this error when I run this command bazel build -c opt //tensorflow/lite:tensorflowlite
I have installed msys2, added to path, installed bazel 6.2.1 and added it to path, installed LLVM on to my machine, ran python ./configure.py
saying no to everything and finally ran the bazel build command.
When I run it I get the following error:
ERROR: An error occurred during the fetch of repository 'python_x86_64-pc-windows-msvc':
Traceback (most recent call last):
File "C:/users/tyler/_bazel_tyler/rkret32s/external/rules_python/python/repositories.bzl", line 377, column 17, in _python_repository_impl
rctx.symlink(python_bin, "python")
Error in symlink: java.io.IOException: Could not create symlink from C:/users/tyler/_bazel_tyler/rkret32s/external/python_x86_64-pc-windows-msvc/python.exe to C:/users/tyler/_bazel_tyler/rkret32s/external/python_x86_64-pc-windows-msvc/python: Cannot create symlink (name=C:\users\tyler\_bazel_tyler\rkret32s\external\python_x86_64-pc-windows-msvc\python, target=C:\users\tyler\_bazel_tyler\rkret32s\external\python_x86_64-pc-windows-msvc\python.exe): ERROR: src/main/native/windows/file-jni.cc(140): nativeCreateSymlink(\\?\C:\users\tyler\_bazel_tyler\rkret32s\external\python_x86_64-pc-windows-msvc\python, \\?\C:\users\tyler\_bazel_tyler\rkret32s\external\python_x86_64-pc-windows-msvc\python.exe): ERROR: src/main/native/windows/file.cc(523): CreateSymlink(\\?\C:\users\tyler\_bazel_tyler\rkret32s\external\python_x86_64-pc-windows-msvc\python.exe): createSymbolicLinkW failed (permission denied). Either Windows developer mode or admin privileges are required.
ERROR: C:/users/tyler/downloads/tensorflow-2.16.2/WORKSPACE:36:27: fetching python_repository rule //external:python_x86_64-pc-windows-msvc: Traceback (most recent call last):
File "C:/users/tyler/_bazel_tyler/rkret32s/external/rules_python/python/repositories.bzl", line 377, column 17, in _python_repository_impl
rctx.symlink(python_bin, "python")
Error in symlink: java.io.IOException: Could not create symlink from C:/users/tyler/_bazel_tyler/rkret32s/external/python_x86_64-pc-windows-msvc/python.exe to C:/users/tyler/_bazel_tyler/rkret32s/external/python_x86_64-pc-windows-msvc/python: Cannot create symlink (name=C:\users\tyler\_bazel_tyler\rkret32s\external\python_x86_64-pc-windows-msvc\python, target=C:\users\tyler\_bazel_tyler\rkret32s\external\python_x86_64-pc-windows-msvc\python.exe): ERROR: src/main/native/windows/file-jni.cc(140): nativeCreateSymlink(\\?\C:\users\tyler\_bazel_tyler\rkret32s\external\python_x86_64-pc-windows-msvc\python, \\?\C:\users\tyler\_bazel_tyler\rkret32s\external\python_x86_64-pc-windows-msvc\python.exe): ERROR: src/main/native/windows/file.cc(523): CreateSymlink(\\?\C:\users\tyler\_bazel_tyler\rkret32s\external\python_x86_64-pc-windows-msvc\python.exe): createSymbolicLinkW failed (permission denied). Either Windows developer mode or admin privileges are required.
ERROR: Error computing the main repository mapping: Encountered error while reading extension file 'requirements.bzl': no such package '@pypi//': no such package '@python_x86_64-pc-windows-msvc//': java.io.IOException: Could not create symlink from C:/users/tyler/_bazel_tyler/rkret32s/external/python_x86_64-pc-windows-msvc/python.exe to C:/users/tyler/_bazel_tyler/rkret32s/external/python_x86_64-pc-windows-msvc/python: Cannot create symlink (name=C:\users\tyler\_bazel_tyler\rkret32s\external\python_x86_64-pc-windows-msvc\python, target=C:\users\tyler\_bazel_tyler\rkret32s\external\python_x86_64-pc-windows-msvc\python.exe): ERROR: src/main/native/windows/file-jni.cc(140): nativeCreateSymlink(\\?\C:\users\tyler\_bazel_tyler\rkret32s\external\python_x86_64-pc-windows-msvc\python, \\?\C:\users\tyler\_bazel_tyler\rkret32s\external\python_x86_64-pc-windows-msvc\python.exe): ERROR: src/main/native/windows/file.cc(523): CreateSymlink(\\?\C:\users\tyler\_bazel_tyler\rkret32s\external\python_x86_64-pc-windows-msvc\python.exe): createSymbolicLinkW failed (permission denied). Either Windows developer mode or admin privileges are required.
I saw the permission error at the end and tried running cmd as admin but it didn't work. I don't know the windows equivalent of chmod and which folder to give to.
I've also tried enabling developer mode with this command:
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
What can I do to fix this?