tensorflow: TensorFlow 2.10.0 build for C++ using Bazel failed with error "Link.exe 1120 failed: error executing command " in Windows 10
Issue type
Build/Install
Have you reproduced the bug with TensorFlow Nightly?
No
Source
source
TensorFlow version
2.10.0
Custom code
No
OS platform and distribution
Windows 10 Pro
Mobile device
Windows 10 Pro
Python version
3.9.13
Bazel version
5.1.1
GCC/compiler version
No response
CUDA/cuDNN version
11.2/8.1
GPU model and memory
No response
Current behavior?
Steps followed:
- Installed Bazel version 5.1.1 and set the environment variables.
- Installed msys2 and set the environment variables.
- Installed visual studio professional 2019 for C++ build .
- Installed python 3.9.13
- Installed python dependencies like numpy, wheel, keras
- Downloaded tensorflow 2.10.0 source from tensorflow github repository
- Configured TensorFlow with default configuration using ‘./configure’
- Build TensorFlow using the command ‘bazel --host_jvm_args=-Xmx4g --output_base=D:\0 build --jvmopt=“-server -Xms2g” --config=opt tensorflow:tensorflow_cc’
While tried to build ‘tensorflow_cc’ with the above command, the compilation is success but the linking failed with error 1120.
The following versions of tools are used for building: Tensorflow - 2.10.0 Python - 3.9.13 Visual studio - Professional 2019 Bazel - 5.1.1 MSYS - 2 Tried the GPU build with ‘Cuda 11.2 and Cudnn 8.1’ also but the result is same.
Note: Earlier tried to build tensorflow.dll (not tensorflow_cc), for which the compilation and linking was success and tensorflow.dll got generated. But while linking the tensorflow.dll to visual studio cpp project, I got ‘unresolved external symbol errors’. It seems the dll generated by this method has the ‘C’ symbols instead of ‘CPP’ symbols in it.
Standalone code to reproduce the issue
Tensorflow source from github and tried to build from windows for c++.
Relevant log output
Getting link errors
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 30 (4 by maintainers)
@hidon Is this link error. Link error is expected one because not all the symbols exported to tensorflow_cc.dll. We need to manually export (using TF_EXPORT) needed symbols to dll. Please look into the following tutorial for reference https://medium.com/vitrox-publication/deep-learning-frameworks-tensorflow-build-from-source-on-windows-python-c-cpu-gpu-d3aa4d0772d8
@ajithrp123
I have double confirmed with the Team. The target tensorflow_cc is not support Windows platform. You can check these files:
https://github.com/tensorflow/tensorflow/blob/3d79c0e4a663a4dd846c38cb5cdc0beeb3292d83/tensorflow/python/BUILD#L630-L640 https://github.com/tensorflow/tensorflow/blob/1dbc8d1b0126dcac5edea9a65a1fddbfe5e337ce/tensorflow/compiler/mlir/lite/experimental/tac/py_wrapper/BUILD#L37-L41
The Windows platform has no dependency files.
Hi @ajithrp123, got it, thank you, could you please share the steps you are following and the errors you are getting while running TF 2.10.0? No WSL is not needed for TF 2.10.0