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

Faile to install bazel in linux #1152

Closed
liumilan opened this issue Apr 16, 2016 · 59 comments
Closed

Faile to install bazel in linux #1152

liumilan opened this issue Apr 16, 2016 · 59 comments
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) type: bug
Milestone

Comments

@liumilan
Copy link

The error as below:
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO: compile.sh compile /path/to/bazel
Building Bazel from scratch......
Building Bazel with Bazel.
WARNING: /search/david/bazel-master/src/main/native/BUILD:46:16: in includes attribute of cc_binary rule //src/main/native:libunix.so: '.' resolves to 'src/main/native' not in 'third_party'. This will be an error in the future.
WARNING: /search/david/bazel-master/src/main/protobuf/BUILD:36:1: in includes attribute of cc_library rule //src/main/protobuf:command_server_cc_proto: '.' resolves to 'src/main/protobuf' not in 'third_party'. This will be an error in the future. Since this rule was created by the macro 'cc_grpc_library', the error might have been caused by the macro implementation in /search/david/bazel-master/tools/build_rules/genproto.bzl:104:18.
INFO: Found 1 target...
ERROR: /search/david/bazel-master/src/main/cpp/BUILD:53:1: C++ compilation of rule '//src/main/cpp:blaze_abrupt_exit' failed: gcc -std=gnu99 failed: error executing command
(cd /tmp/bazel.MM2za3vz/out/bazel-master && \
exec env - \
PATH=/usr/local/cuda-7.0/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/go/bin:/home/david/bin \
'/tmp/bazel.MM2za3vz/out/external/local_config_cc/gcc -std=gnu99' -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++0x' -iquote . -iquote bazel-out/local-fastbuild/genfiles -iquote external/bazel_tools -iquote bazel-out/local-fastbuild/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local-fastbuild/bin/src/main/cpp/_objs/blaze_abrupt_exit/src/main/cpp/blaze_abrupt_exit.pic.o' -MD -MF bazel-out/local-fastbuild/bin/src/main/cpp/_objs/blaze_abrupt_exit/src/main/cpp/blaze_abrupt_exit.pic.d -fPIC -c src/main/cpp/blaze_abrupt_exit.cc -o bazel-out/local-fastbuild/bin/src/main/cpp/_objs/blaze_abrupt_exit/src/main/cpp/blaze_abrupt_exit.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 127.
/tmp/bazel.MM2za3vz/out/bazel-master/_bin/process-wrapper: line 12: /tmp/bazel.MM2za3vz/out/external/local_config_cc/gcc -std=gnu99: No such file or directory
Target //src:bazel failed to build
INFO: Elapsed time: 3.054s, Critical Path: 0.19s

The bazel.MM2za3vz is created tmp.And the gcc is not in this dir.How can be fixed

@damienmg
Copy link
Contributor

what does your CC environment variable contains?

echo $CC?

@liumilan
Copy link
Author

Now I git clone again,
git clone https://github.com/bazelbuild/bazel.git
git checkout tags/0.1.0
And it report that

g++ -I. -std=c++0x -c -DBLAZE_JAVA_CPU="k8" -DBLAZE_OPENSOURCE=1 -o /tmp/bazel.yc0Q2G6i/objs/blaze_startup_options.cc.o src/main/cpp/blaze_startup_options.cc
scripts/bootstrap/buildenv.sh: line 63: g++ : command not found
g++ version has been installed.

[@sjs_88_78 bazel]$ echo $CC
gcc
[@sjs_88_78 bazel]$ echo $CXX
g++

[@sjs_88_78 bazel]$ gcc --version
gcc (GCC) 4.8.2 20140120 (Red Hat 4.8.2-15)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[@sjs_88_78 bazel]$ ls -rlt /usr/bin/g++
lrwxrwxrwx 1 root root 37 Aug 5 2015 /usr/bin/g++ -> /opt/rh/devtoolset-2/root/usr/bin/g++

@damienmg
Copy link
Contributor

Use 0.2.1 instead: git checkout tags/0.2.1

@liumilan
Copy link
Author

Now it report that
gcc: error trying to exec 'cc1plus': execvp: No such file or directory

@damienmg
Copy link
Contributor

Oh I know that error, it is the same as #760

@damienmg damienmg added type: bug P2 We'll consider working on this in future. (Assignee optional) category: skylark remote repositories and removed under investigation labels Apr 19, 2016
@damienmg
Copy link
Contributor

Can you retry with git checkout master && git pull?

@liumilan
Copy link
Author

ok,i try it now

@liumilan
Copy link
Author

still failed.
ERROR: /search/liudewei/tensorflow/bazel/src/main/cpp/BUILD:53:1: C++ compilation of rule '//src/main/cpp:blaze_abrupt_exit' failed: gcc failed: error executing command
(cd /tmp/bazel.Y42A4NIH/out/bazel &&
exec env -
PATH=/usr/local/cuda-7.0/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/go/bin:/home/liudewei/bin:/usr/local/go/bin
'/tmp/bazel.Y42A4NIH/out/external/local_config_cc/gcc ' -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++0x' -iquote . -iquote bazel-out/local-fastbuild/genfiles -iquote external/bazel_tools -iquote bazel-out/local-fastbuild/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local-fastbuild/bin/src/main/cpp/_objs/blaze_abrupt_exit/src/main/cpp/blaze_abrupt_exit.pic.o' -MD -MF bazel-out/local-fastbuild/bin/src/main/cpp/_objs/blaze_abrupt_exit/src/main/cpp/blaze_abrupt_exit.pic.d -fPIC -c src/main/cpp/blaze_abrupt_exit.cc -o bazel-out/local-fastbuild/bin/src/main/cpp/_objs/blaze_abrupt_exit/src/main/cpp/blaze_abrupt_exit.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 127.
/tmp/bazel.Y42A4NIH/out/bazel/_bin/process-wrapper: line 12: /tmp/bazel.Y42A4NIH/out/external/local_config_cc/gcc : No such file or directory
Target //src:bazel failed to build

@liumilan
Copy link
Author

do i have the correct step?
I just git checkout master and git pull based on version 0.2.1.And now this error is the same as initial issue.No gcc in tmp dir was found!

@damienmg
Copy link
Contributor

what does git log -1 --oneline returns?

@liumilan
Copy link
Author

[@bjzw_28_31bazel]$ git log -1 --oneline
0b26f44 cc_configure: Add piii to the list of supported cpu_value

@damienmg
Copy link
Contributor

/tmp/bazel.Y42A4NIH/out/external/local_config_cc/gcc this path is dubious, it should not happen.

@damienmg
Copy link
Contributor

oh I see, unset CC then ./compile.sh again?

@liumilan
Copy link
Author

unset CC,and
gcc: error trying to exec 'cc1plus': execvp: No such file or directory....
The same as before

@liumilan
Copy link
Author

INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO: compile.sh compile /path/to/bazel
馃崈 Building Bazel from scratch......
馃崈 Building Bazel with Bazel.
WARNING: /search/liudewei/tensorflow/bazel/src/main/native/BUILD:46:16: in includes attribute of cc_binary rule //src/main/native:libunix.so: '.' resolves to 'src/main/native' not in 'third_party'. This will be an error in the future.
WARNING: /search/liudewei/tensorflow/bazel/src/main/protobuf/BUILD:36:1: in includes attribute of cc_library rule //src/main/protobuf:command_server_cc_proto: '.' resolves to 'src/main/protobuf' not in 'third_party'. This will be an error in the future. Since this rule was created by the macro 'cc_grpc_library', the error might have been caused by the macro implementation in /search/liudewei/tensorflow/bazel/tools/build_rules/genproto.bzl:104:18.
INFO: Found 1 target...
ERROR: /search/liudewei/tensorflow/bazel/src/main/cpp/util/BUILD:24:1: C++ compilation of rule '//src/main/cpp/util:md5' failed: gcc failed: error executing command
(cd /tmp/bazel.eBXvSkC5/out/bazel &&
exec env -
PATH=/usr/local/cuda-7.0/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/go/bin:/home/liudewei/bin:/usr/local/go/bin
/usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -iquote . -iquote bazel-out/local-fastbuild/genfiles -iquote external/bazel_tools -iquote bazel-out/local-fastbuild/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local-fastbuild/bin/src/main/cpp/util/_objs/md5/src/main/cpp/util/md5.pic.o' -MD -MF bazel-out/local-fastbuild/bin/src/main/cpp/util/_objs/md5/src/main/cpp/util/md5.pic.d -fPIC -c src/main/cpp/util/md5.cc -o bazel-out/local-fastbuild/bin/src/main/cpp/util/_objs/md5/src/main/cpp/util/md5.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
Target //src:bazel failed to build
INFO: Elapsed time: 3.783s, Critical Path: 0.38s

Building output/bazel

@damienmg
Copy link
Contributor

can you comment this line on your clone: https://github.com/bazelbuild/bazel/blob/master/scripts/bootstrap/buildenv.sh#L96

then rerun compile.sh and you will get another of:

(cd /tmp/bazel.eBXvSkC5/out/bazel && \
exec env - \
PATH=/usr/local/cuda-7.0/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/go/bin:/home/liudewei/bin:/usr/local/go/bin \
/usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -iquote . -iquote bazel-out/local-fastbuild/genfiles -iquote external/bazel_tools -iquote bazel-out/local-fastbuild/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local-fastbuild/bin/src/main/cpp/util/_objs/md5/src/main/cpp/util/md5.pic.o' -MD -MF bazel-out/local-fastbuild/bin/src/main/cpp/util/_objs/md5/src/main/cpp/util/md5.pic.d -fPIC -c src/main/cpp/util/md5.cc -o bazel-out/local-fastbuild/bin/src/main/cpp/util/_objs/md5/src/main/cpp/util/md5.pic.o)

then copy-pasting the command and adding the -B/usr/bin flag?

Also what is your system distribution?

@liumilan
Copy link
Author

I don't get what you mean.
I have comment this line,and compile.sh again,and it failed again.
And how will i do next? copy and pasting the error and adding the -B/usr/bin?And run?
I have no idea above it .
My os is
Linux sjs_88_78 2.6.32-504.23.4.el6.x86_64 #1 SMP Fri May 29 10:16:43 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux

@liumilan
Copy link
Author

ERROR: /search/liudewei/tensorflow/bazel/src/main/tools/BUILD:26:1: C++ compilation of rule '//src/main/tools:build-runfiles' failed: gcc failed: error executing command
(cd /tmp/bazel.FiLNjMId/out/bazel &&
exec env -
PATH=/usr/local/cuda-7.0/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/go/bin:/home/liudewei/bin
'/tmp/bazel.FiLNjMId/out/external/local_config_cc/gcc ' -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++0x' -iquote . -iquote bazel-out/local-fastbuild/genfiles -iquote external/bazel_tools -iquote bazel-out/local-fastbuild/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local-fastbuild/bin/src/main/tools/_objs/build-runfiles/src/main/tools/build-runfiles.pic.o' -MD -MF bazel-out/local-fastbuild/bin/src/main/tools/_objs/build-runfiles/src/main/tools/build-runfiles.pic.d -fPIC -c src/main/tools/build-runfiles.cc -o bazel-out/local-fastbuild/bin/src/main/tools/_objs/build-runfiles/src/main/tools/build-runfiles.pic.o -B/usr/bin): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 127.
/tmp/bazel.FiLNjMId/out/bazel/_bin/process-wrapper: line 12: /tmp/bazel.FiLNjMId/out/external/local_config_cc/gcc : No such file or directory
Target //src:bazel failed to build
INFO: Elapsed time: 2.911s, Critical Path: 0.06s

@liumilan
Copy link
Author

it is redhat6.

@damienmg
Copy link
Contributor

(cd /tmp/bazel.FiLNjMId/out/bazel && \
exec env - \
PATH=/usr/local/cuda-7.0/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/go/bin:/home/liudewei/bin \
'/tmp/bazel.FiLNjMId/out/external/local_config_cc/gcc ' -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++0x' -iquote . -iquote bazel-out/local-fastbuild/genfiles -iquote external/bazel_tools -iquote bazel-out/local-fastbuild/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local-fastbuild/bin/src/main/tools/_objs/build-runfiles/src/main/tools/build-runfiles.pic.o' -MD -MF bazel-out/local-fastbuild/bin/src/main/tools/_objs/build-runfiles/src/main/tools/build-runfiles.pic.d -fPIC -c src/main/tools/build-runfiles.cc -o bazel-out/local-fastbuild/bin/src/main/tools/_objs/build-runfiles/src/main/tools/build-runfiles.pic.o -B/usr/bin)

<-- just running that

@liumilan
Copy link
Author

env: /tmp/bazel.FiLNjMId/out/external/local_config_cc/gcc : No such file or directory
after running that ,the client will be logged out

@damienmg
Copy link
Contributor

echo ${CC-x} ?

@liumilan
Copy link
Author

[@sjs_88_78 ]$ echo ${CC-x}
gcc

@damienmg
Copy link
Contributor

I am totally at lost, here the code that does the gcc detection: https://github.com/bazelbuild/bazel/blob/master/tools/cpp/cc_configure.bzl#L265

can you add a line with print("PATH=%s, CC=%s" % (repository_ctx.os.environ["PATH"], cc_name)) before https://github.com/bazelbuild/bazel/blob/master/tools/cpp/cc_configure.bzl#L273 and rerun ./compile.sh and tell the output?

Totally sorry for that mess, it is way more tricky that expected.

@liumilan
Copy link
Author

[@sjs_88_78 bazel]$ sh compile.sh
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO: compile.sh compile /path/to/bazel
馃崈 Building Bazel from scratch......
馃崈 Building Bazel with Bazel.
WARNING: /tmp/bazel.H9li0DY0/out/external/bazel_tools/tools/cpp/cc_configure.bzl:273:3: PATH=/usr/local/cuda-7.0/bin:/usr/local/cuda-7.0/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/go/bin:/home/liudewei/bin, CC=gcc .
ERROR: /tmp/bazel.H9li0DY0/out/external/bazel_tools/tools/cpp/cc_configure.bzl:330:3: no such package '@local_config_cc//': Traceback (most recent call last):
File "/tmp/bazel.H9li0DY0/out/external/bazel_tools/tools/cpp/cc_configure.bzl", line 303
_find_cc(repository_ctx)
File "/tmp/bazel.H9li0DY0/out/external/bazel_tools/tools/cpp/cc_configure.bzl", line 276, in _find_cc
fail("Cannot find gcc, either correct...")
Cannot find gcc, either correct your path or set the CC environment variable and referenced by '//external:cc_toolchain'.
ERROR: Loading failed; build aborted.
INFO: Elapsed time: 2.013s

@damienmg
Copy link
Contributor

damienmg commented Apr 26, 2016

Thanks, I think I understand that precise issue. The space after CC=gcc looks suspicious so I think your CC environment variable contains a trailing space which we do not handle correctly.

To check, can you do: echo "x${CC}x" and gives the result? Can you also retry ./compile.sh after unset CC?

Sorry again for all the troubles.

@liumilan
Copy link
Author

[@sjs_88_78 bazel]$ echo "x${CC}x"
xgcc x

[@sjs_88_78 bazel]$ unset CC
[@sjs_88_78 bazel]$ sh compile.sh
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO: compile.sh compile /path/to/bazel
馃崈 Building Bazel from scratch......
馃崈 Building Bazel with Bazel.
WARNING: /tmp/bazel.TSZBzmpC/out/external/bazel_tools/tools/cpp/cc_configure.bzl:273:3: PATH=/usr/local/cuda-7.0/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/go/bin:/home/liudewei/bin, CC=gcc.
WARNING: /search/liudewei/tensorflow/bazel/src/main/native/BUILD:46:16: in includes attribute of cc_binary rule //src/main/native:libunix.so: '.' resolves to 'src/main/native' not in 'third_party'. This will be an error in the future.
WARNING: /search/liudewei/tensorflow/bazel/src/main/protobuf/BUILD:37:1: in includes attribute of cc_library rule //src/main/protobuf:command_server_cc_proto: '.' resolves to 'src/main/protobuf' not in 'third_party'. This will be an error in the future. Since this rule was created by the macro 'cc_grpc_library', the error might have been caused by the macro implementation in /search/liudewei/tensorflow/bazel/tools/build_rules/genproto.bzl:104:18.
INFO: Found 1 target...
ERROR: /search/liudewei/tensorflow/bazel/src/main/cpp/util/BUILD:24:1: C++ compilation of rule '//src/main/cpp/util:md5' failed: gcc failed: error executing command
(cd /tmp/bazel.TSZBzmpC/out/bazel &&
exec env -
PATH=/usr/local/cuda-7.0/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/go/bin:/home/liudewei/bin
/usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wl,-z,-relro,-z,now -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -iquote . -iquote bazel-out/local-fastbuild/genfiles -iquote external/bazel_tools -iquote bazel-out/local-fastbuild/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 -no-canonical-prefixes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local-fastbuild/bin/src/main/cpp/util/_objs/md5/src/main/cpp/util/md5.pic.o' -MD -MF bazel-out/local-fastbuild/bin/src/main/cpp/util/_objs/md5/src/main/cpp/util/md5.pic.d -fPIC -c src/main/cpp/util/md5.cc -o bazel-out/local-fastbuild/bin/src/main/cpp/util/_objs/md5/src/main/cpp/util/md5.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
Target //src:bazel failed to build
INFO: Elapsed time: 2.922s, Critical Path: 0.04s

@damienmg
Copy link
Contributor

Ok sorry for all the trouble again, I need to figure out a better way to get the -B directory

@damienmg
Copy link
Contributor

seems like it is in the output of gcc -E in the COMPILER_PATH variable. Will try to come up with a fix.

@damienmg
Copy link
Contributor

Ok bug #1201 gave a workaround (I should have though of it): export CC=/opt/rh/devtoolset-2/root/usr/bin/gcc; ./compile.sh

We should cover for that use-case anyway, so two thing to fix:

  • strip spaces on CC
  • use gcc -E to get compiler_path and ld_library_path

@damienmg
Copy link
Contributor

damienmg commented Apr 29, 2016

@liumilan: Did the export CC=/opt/rh/devtoolset-2/root/usr/bin/gcc; ./compile.sh workaround fixed your issue?

Still looking at how to do it correctly for both clang and gcc

@liumilan
Copy link
Author

liumilan commented May 1, 2016

Not yet.
And I just update from redhat6 to redhat7,and now it workerd.
Maybe it is OS issue
Thanks for your help

@damienmg
Copy link
Contributor

damienmg commented May 2, 2016

Glad you find a workaround. I have all the information I needed I think I can reproduce this bug but I need to think a bit more about the solution.

@liumilan
Copy link
Author

liumilan commented May 5, 2016

The workaround is I install tensorflow using pip,not bazel
Now I tried to install bazel in rehat7,And it failed again.
Why?

@kchodorow
Copy link
Contributor

What's the error you're getting?

@damienmg damienmg modified the milestone: 0.5 Jun 14, 2016
mzeren-vmw added a commit to mzeren-vmw/bazel that referenced this issue Oct 11, 2018
- Putting -B/usr/bin on the link line breaks use of custom C/C++
  toolchain since support binaries such as ld, as, etc., will
  incorrectly "leak" to the build machine.

- Fixes issue bazelbuild#5634

It looks like this logic was originally added here:

  810d60a Apr 22 2016 dmarting@google.com
  "cc_configure: Add -B to compiler flag too"

And that that was done to get Tensor Flow building on some (but failing
on other?) versions of RedHat. bazelbuild#1152.

Also this may have "fixed" the hombrew builds for
bazelbuild#1177.

Testing Done: local build of envoy on older host using non-host
crosscompiler. Build fails without the fix and succeeds with the fix.
mzeren-vmw added a commit to mzeren-vmw/bazel that referenced this issue Oct 11, 2018
Putting -B/usr/bin on the link line breaks use of custom C/C++ toolchain
since support binaries such as ld, as, etc., will incorrectly "leak" to
the build machine.

Fixes issue bazelbuild#5634

Archeaology: It looks like this logic was originally added here:

  810d60a Apr 22 2016 dmarting@google.com
  "cc_configure: Add -B to compiler flag too"

.. and that that was done to get Tensor Flow building on some (but failing
on other?) versions of RedHat. bazelbuild#1152.

This may have also "fixed" the hombrew builds for
bazelbuild#1177.

Testing Done:

* Building envoy on older Centos host using non-host
  crosscompiler. Build fails without the fix and succeeds with the fix.

* bazel test //src/test/java/com/google/devtools/build/lib:all
  1 flaky test failed before and after:
  bazel test //src/test/java/com/google/devtools/build/lib:vfs_test
mzeren-vmw added a commit to mzeren-vmw/bazel that referenced this issue Oct 11, 2018
Putting -B/usr/bin on the link line breaks use of custom C/C++ toolchain
since support binaries such as ld, as, etc., will incorrectly "leak" to
the build machine.

Fixes bazelbuild#5634

Archeaology: It looks like this logic was originally added here:

  810d60a Apr 22 2016 dmarting@google.com
  "cc_configure: Add -B to compiler flag too"

.. and that that was done to get Tensor Flow building on some (but failing
on other?) versions of RedHat. bazelbuild#1152.

This may have also "fixed" the hombrew builds for
bazelbuild#1177.

Testing Done:

* Building envoy on older Centos host using non-host
  crosscompiler. Build fails without the fix and succeeds with the fix.

* bazel test //src/test/java/com/google/devtools/build/lib:all
  1 flaky test failed before and after:
  bazel test //src/test/java/com/google/devtools/build/lib:vfs_test
mzeren-vmw added a commit to mzeren-vmw/bazel that referenced this issue Oct 11, 2018
Putting -B/usr/bin on the link line breaks use of custom C/C++ toolchain
since support binaries such as ld, as, etc., will incorrectly "leak" to
the build machine.

Fixes bazelbuild#5634

Archeaology: It looks like this logic was originally added here:

  810d60a Apr 22 2016 dmarting@google.com
  "cc_configure: Add -B to compiler flag too"

.. and that that was done to get Tensor Flow building on some (but failing
on other?) versions of RedHat. bazelbuild#1152.

This may have also "fixed" the hombrew builds for
bazelbuild#1177.

Testing Done:

* Building envoy on older Centos host using non-host
  crosscompiler. Build fails without the fix and succeeds with the fix.

* bazel test //src/test/java/com/google/devtools/build/lib:all
  1 flaky test failed before and after:
  bazel test //src/test/java/com/google/devtools/build/lib:vfs_test
mzeren-vmw added a commit to mzeren-vmw/bazel that referenced this issue Oct 11, 2018
Putting -B/usr/bin on the link line breaks use of custom C/C++ toolchain
since support binaries such as ld, as, etc., will incorrectly "leak" to
the build machine.

Fixes bazelbuild#5634

Archeaology: It looks like this logic was originally added here:

  810d60a Apr 22 2016 dmarting@google.com
  "cc_configure: Add -B to compiler flag too"

.. and that that was done to get Tensor Flow building on some (but failing
on other?) versions of RedHat. bazelbuild#1152.

This may have also "fixed" the hombrew builds for
bazelbuild#1177.

Testing Done:

* Building envoy on older Centos host using non-host
  crosscompiler. Build fails without the fix and succeeds with the fix.

* bazel test //src/test/java/com/google/devtools/build/lib:all
  1 flaky test failed before and after:
  bazel test //src/test/java/com/google/devtools/build/lib:vfs_test
bazel-io pushed a commit that referenced this issue Oct 16, 2018
Putting -B/usr/bin on the link line breaks use of custom C/C++ toolchain
since support binaries such as ld, as, etc., will incorrectly "leak" to
the build machine.

Fixes #5634

Archeaology: It looks like this logic was originally added here:

  810d60a Apr 22 2016 dmarting@google.com
  "cc_configure: Add -B to compiler flag too"

.. and that that was done to get Tensor Flow building on some (but failing
on other?) versions of RedHat. #1152.

This may have also "fixed" the hombrew builds for
#1177.

Testing Done:

* Building envoy on older Centos host using non-host
  crosscompiler. Build fails without the fix and succeeds with the fix.

* bazel test //src/test/java/com/google/devtools/build/lib:all
  1 flaky test failed before and after:
  bazel test //src/test/java/com/google/devtools/build/lib:vfs_test

Closes #6360.

PiperOrigin-RevId: 217338797
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) type: bug
Projects
None yet
Development

No branches or pull requests

3 participants