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
Cannot make tensorflow to use a local gcc installation? #649
Comments
Try modifying the CROSSTOOL file: https://github.com/bazelbuild/bazel/blob/master/tools/cpp/CROSSTOOL#L86. This is where Bazel configures how to find gcc. |
Hi, |
The CROSSTOOL file isn't actually compiled into Bazel. You have to replace /usr/local/lib/bazel/base_workspace/tools/cpp/CROSSTOOL with your custom version for bazel to pick up on the change (and you shouldn't need to recompile Bazel). |
Hi casiciaco, I faced a similar problem. I have included this here, in reply to a Bazel issue because the challenges of this build may provide some more general insight into the Bazel build experience for new users outside of the Google ecosystem. Note: This is just a dump of steps offered in case it saves someone time. I have made no effort to optimize (e.g., factor out cut-and-pasted paths) and I had not previously used Bazel -- my interest was in compiling TensorFlow. No doubt there are much better ways to do this. EnvironmentFor all steps that followed, I set my Whenever I ran Bazel , I ran with the Compiling BazelYou already did this, but for completeness, here's how I did it. To fix up the paths hard-coded into Bazel, I ran the script below from the root of the Bazel tarball. This seems to work for both Bazel 0.1.0 and 0.1.1.
Compiling TensorFlowNot having experience with Bazel, I found I had to copy the I had to again fix up some hard-coded paths, modifying the script used for Bazel:
(Again, I've not optimized this script, just cut and paste bits from my earlier script with a few mods.) I also had linker errors requiring references to
This seems to be an oversight at least a few others bumped into (see tensorflow/tensorflow#332). Perhaps those libraries are indirectly referenced elsewhere in the preferred Google environment. I found I had to modify
When building the PIP package, I had to modify This produced a working GPU-capable build of TensorFlow. Hope this helps, |
Hi thanks ,
The error is the following:
If I add LD_LIBRARY_PATH after |
Hi,
However, I get another error now :
Any ideas of what is happening ? Thanks !! |
Yes you are using a recent version of Bazel and we are fixing those bug in the tensorflow build. You can workaround by using bazel 0.1.1 |
Hi,
Then I get the following error:
executing the code below:
Can you help ? |
Somebody with Bazel experience will be able to give you more guidance on a fix, but presumably, if (You may also want to look at whether you need such a recent Good luck! |
@casiciaco did @sethbruder answer helped? Do you still need help? |
Hi @damienmg , I also struggling to compile TF on Centos 6.6. I managed to build bazel, but when use bazel to build TF, I got the following error:
I met the similar problem when compiling bazel, the way is to pass |
btw, I'm with bazel 0.1.2 |
@ffmpbgrnn I'll try and let you know. Perhaps it will take me 2~3 workdays due to too many chores at the end of the year. |
Hi @damienmg , when bazel build tensorflow, which line generates |
Hi, |
Hi, I solved the runtime linking problem by simply adding
to |
ping ? Does this still need attention? |
Actually, you also need to modify the compile.sh
You can also add there your exports for CC CXX JAVA_HOME, etc. With that I was able to compile bazel.0.1.1 |
In what part of the CROSSTOOL file did you add the following code
And should existing linker_flag's in the file be removed? |
You can add them anywhere, it looks like |
The link provided by @kchodorow seem to be dead. I'd like to add an updated link, (even though, of course, it is still easy to understand where this file is from the link itself). Also, I'd like to mention, that this modification might be not the only one you need. |
NFO: You can skip this first step by providing a path to the bazel binary as second argument: |
Hi,
I am bound to an old installation on a machine. I had to install a local gcc 4.8.1 and thanks to the community I managed to compile bazel (#629) . However, now I am unable to compile tensorflow. This is the error I get:
I guess it is not getting the correct gcc, since if I run :
All is ok, but if I run
I get the same error"
If I add the
--verbose_failures
option, I get this additional information:How can I make it use the correct gcc ? Tensorflow comunity redirected me to bazel comunity :
tensorflow/tensorflow#336
Thanks,
The text was updated successfully, but these errors were encountered: