-
Notifications
You must be signed in to change notification settings - Fork 74k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Windows builds through clang #14425
Comments
This sounds potentially useful for development, but it's unlikely anyone on the team will take this on soon, because we already have a supported configuration that works well enough. Marking it as contributions welcome, in the hope that somebody wants to take it on. |
sounds greatly interesting, I'll try to investigate into this. |
I see that @gunan has written a windows clang toolchain under third_party/toolchains/preconfig/win/bazel_211, I'll probably assemble a new configuration with that and appropriate platform with new constraints. Right now I'm stuck on getting bazel working on my local machine, similar to #31608, where undname.exe couldn't be found under VC directory |
That toolchain was constructed for MSVC 2019. AFAICR, all clang references to it are placeholders |
I don't think you need one. I've been using the default one provided by bazel. |
@Artem-B Just that will do? I had seen those instructions, but was wondering if that's too simple for a "tricky" problem, then I realized this issue was opened back in 2017, perhaps Bazel didn't support this option back then. But the platform target still need to be manually added by users afterwards right? I don't see it written anywhere in the source code. Do you think it would be still useful for me to add it somewhere and make a new config for clang on windows by incorporating those options and modifying the Another thing, MSVC seems to be the only option for CUDA compiler, I'm not sure how relatable is it to this issue or if it's already an open issue somewhere, but it might also be useful to include clang in CUDA configuration for windows? |
BUILD/WORKSPACE files will need to have these modifications, though I think they will eventually make it into TF. As for CUDA compilation, clang should be able to do it in principle, but TF build needs a bit of work to put things together.
Do you mean NVCC? MSVC can't compile CUDA. That said, if you build with clang, your only choice is to whether enable CUDA or not. You can't (well, shouldn't, really) use NVCC in this case. I vaguely recall having to tweak config.py to force-enable CUDA for the build w/ clang. |
This issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Thank you. |
CC @angerson @learning-to-play as there is some testing to use clang for building. |
This issue is stale because it has been open for 180 days with no activity. It will be closed if no further activity occurs. Thank you. |
According to the release page, clang is now used for the official TF builds of version 2.16.1. |
Hi @japm48, Thank you for your patience. The documentation will be available soon. Please follow the steps below to build TensorFlow with CLANG on Windows Install LLVM Note: To build with Clang on Windows, it is required to install both LLVM and Visual C++ Build tools as although Windows uses clang-cl.exe as the compiler, Visual C++ Build tools are needed to link to Visual C++ libraries Environmental set up
|
Thanks @mraunak ! I got this error: So, I tried with Also, the Apart from that, For the record, the complete setup is as follows (all commands executed in an "as admin"
Now to build it (again, using
And finally:
I would say this should be documented in the build instructions page before closing this issue (you can copy any of the above if necessary). |
Hi @japm48, Thank you very much! I will incorporate the changes suggested by you. We recently changed the target to build the TensorFlow(https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/pip_package/BUILD#L265) |
@mraunak I will try again with the latest dev version when I have the time and resources, and will report back. The issue with the missing wheel dependency is perhaps fixed in that version. Just a quick question: given the presence of the new "hermetic Python", is it no longer necessary to manually install Python itself on the build system? |
yes, the Hermetic Python will disregard all Python package installations on the machine and you will get the same behavior if your machine is plain and doesn't have Python (or its packages) installed. |
Right now, the tested configurations for Linux, Mac and Windows use gcc, clang and MSVC, as seen at
https://www.tensorflow.org/install/install_sources#tested_source_configurations
Linux can be made to compile with clang, too, if you use the right magic trick (
--config=cuda_clang
). All that's left is Windows, which is probably the trickiest of the three.Bonus points for allowing to cross-build for Windows under Linux. The main problem there might be with CUDA and getting its SDK installed on a Linux system (just a wild guess).
(Forked from an existing discussion under #12052)
The text was updated successfully, but these errors were encountered: