0

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?

2 Answers 2

1

First thing - just making sure you restarted after editing the registry?

Next I would try enabling developer mode in the GUI.

If you can't get developer mode to work, then I would personally try with --nowindows_enable_symlinks (a startup flag) and disabling runfiles with --noenable_runfiles. However, that goes against this comment in the tensorflow .bazelrc, so YMMV if you're building the pip package.

1

So apparently Bazel 6.2.1 does not work with tflite 2.16. I just upgraded to 6.5 and it worked.

Not the answer you're looking for? Browse other questions tagged or ask your own question.