bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23k stars 4.03k forks source link

How to setup ICC and Bazel on Windows #10390

Open MMcKester opened 4 years ago

MMcKester commented 4 years ago

Hi, I setup my bazel environment on Windows, which uses clang by default. I found that CROSSTOOL allows me to set a compiler, but the documentation is very poor on this. Is there any resource available that explains how I can change the default compiler of Bazel to ICC on Windows?

The most promising solution I found is simply setting CC but CC=icc.exe doesn't invoke the compiler as expected and still uses clang. Any help is highly appreciated!

Lotte1990 commented 4 years ago

I would like to know as well. The current documentation is quite limited.

jsharpe commented 4 years ago

One thing I needed to do for icc on linux was add build --action_env=INTEL_LICENSE_FILE to my .bazelrc - this of course depends on how your ICC install is licensed.

meteorcloudy commented 4 years ago

Hi @Githubber2021 , is this still an issue for you?

We have moved away from CROSSTOOL file and now uses Starlark to write the C++ toolchain. I think you can try to write your own C++ toolchain based on Bazel's preconfigured one. Try follow the steps here: https://github.com/meteorcloudy/my_tests/tree/master/preconfigure_msvc_toolchain

sgowroji commented 2 years ago

Hello @MMcKester, Did you get a chance to check this comment. Let us know if still looking resolution for the above request. Thanks!

Lotte1990 commented 2 years ago

@sgowroji Step number 3 "Modify the toolchain" is a bit vague... Which options I can modify? How do I modify them? These are some crucial details... A bit more explanation would be nice.