Skip to content
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

Can't build Bazel with Intel compiler (2) #663

Closed
mj-harvey opened this issue Nov 30, 2015 · 8 comments
Closed

Can't build Bazel with Intel compiler (2) #663

mj-harvey opened this issue Nov 30, 2015 · 8 comments
Labels
category: misc > misc P3 We're not considering working on this, but happy to review a PR. (No assignee) platform: other type: feature request
Milestone

Comments

@mj-harvey
Copy link

Following on from case #662
Commenting out the static_asserts() that break the build, the compile then breaks at:

'''
$ ./compile.sh
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO: ./compile.sh build /path/to/bazel
🍃 Building Bazel from scratch............
🍃 Building Bazel with Bazel.
.Extracting Bazel installation...
...........
WARNING: Sandboxed execution is not supported on your system and thus hermeticity of actions cannot be guaranteed. See http://bazel.io/docs/bazel-user-manual.html#sandboxing for more information. You can turn off this warning via --ignore_unsupported_sandboxing.
INFO: Found 1 target...
INFO: From Compiling src/main/cpp/blaze_util.cc:

Error: A license for CCompL could not be obtained (-1,359,2).

Is your license file in the right location and readable?
The location of your license file should be specified via
the $INTEL_LICENSE_FILE environment variable.

License file(s) used were (in this order):
1. Trusted Storage
** 2. /raid-1/apps/intel/2013/composer_xe_2013.0.079/Licenses
** 3. /opt/intel/licenses
** 4. /Users/Shared/Library/Application Support/Intel/Licenses
* 5. /raid-1/apps/intel/2013/composer_xe_2013.0.079/bin/intel64/.lic

Please visit http://software.intel.com/sites/support/ if you require technical assistance.

icpc: error #10052: could not checkout FLEXlm license
ERROR: /raid-1/apps/bazelbuild/bazel/src/main/cpp/BUILD:7:1: C++ compilation of rule '//src/main/cpp:blaze_util' failed: icpc failed: error executing command /apps/intel/2013/bin/icpc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -DBLAZE_OPENSOURCE ... (remaining 24 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Target //src:bazel failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 8.513s, Critical Path: 2.18s

Building output/bazel
'''

You are running the compiler in such a way that the value of the required environment variable INTEL_LICENSE_FILE is not being propagated. the compiler thus can't find its license server.

@damienmg damienmg added type: feature request P3 We're not considering working on this, but happy to review a PR. (No assignee) labels Dec 1, 2015
@ulfjack
Copy link
Contributor

ulfjack commented Dec 2, 2015

Well, we intentionally don't propagate environment variables from outside the bazel binary; generally speaking, they can cause builds to be non-deterministic and non-reproducible. However, we probably want to add a mechanism to poke specific holes into that policy to allow things such as license files (it's not just the Intel C++ compiler). As a workaround, you can change your crosstool to use a wrapper script that sets the env variable and then calls through to the actual binary.

If we make C++-specific changes here, we'll want to make sure that we can also handle the Apple C++ toolchain requirements for iOS and OSX builds.

@damienmg damienmg modified the milestone: 1.0 Jun 14, 2016
@GearFear
Copy link

Is there a work-around to solve the issue?

@ulfjack
Copy link
Contributor

ulfjack commented Jul 20, 2017

You should try setting --action_env=INTEL_LICENSE_FILE on the command line (or in your bazelrc file). It may not work yet, since not all actions handle --action_env correctly (#3320) in which case I'll prioritize getting it to work for the relevant C++ actions.

@GearFear
Copy link

I tried - unfortunately, it did not help :( I really need to build TensorFlow with ICC, but I can't deal with this issue.

@mj-harvey
Copy link
Author

mj-harvey commented Jul 25, 2017 via email

@hlopko
Copy link
Member

hlopko commented Mar 21, 2018

Is this issue still valid?

@euler89
Copy link

euler89 commented Sep 13, 2018

Can you confirm this is still an issue?

@mj-harvey
Copy link
Author

It turned out to be trivially worked-around by shimming the compiler in a wrapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: misc > misc P3 We're not considering working on this, but happy to review a PR. (No assignee) platform: other type: feature request
Projects
None yet
Development

No branches or pull requests

8 participants