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

bazel compile error #82

Closed
qm1004 opened this issue Nov 10, 2015 · 10 comments
Closed

bazel compile error #82

qm1004 opened this issue Nov 10, 2015 · 10 comments

Comments

@qm1004
Copy link

qm1004 commented Nov 10, 2015

with gcc (GCC) 4.8.2.
git clone ;
cd bazel ;
./compile.sh;
Is there any requirement of gcc version?
I get this:

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/tools/build-runfiles.cc:
gcc: unrecognized option '-no-canonical-prefixes'
src/main/tools/build-runfiles.cc: In member function 'void RunfilesCreator::EnsureDirReadAndWritePerms(const std::string&)':
src/main/tools/build-runfiles.cc:342: warning: comparison between signed and unsigned integer expressions
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-free-nonheap-object"
INFO: From Compiling src/main/cpp/util/port.cc:
gcc: unrecognized option '-no-canonical-prefixes'
INFO: From Compiling src/main/cpp/util/errors.cc:
gcc: unrecognized option '-no-canonical-prefixes'
INFO: From Compiling src/main/native/process.cc:
gcc: unrecognized option '-no-canonical-prefixes'
INFO: From Linking src/main/tools/build-runfiles:
gcc: unrecognized option '-no-canonical-prefixes'
INFO: From Compiling src/main/cpp/util/strings.cc:
gcc: unrecognized option '-no-canonical-prefixes'
src/main/cpp/util/strings.cc: In function 'void blaze_util::JoinStrings(const std::vector, std::allocator >, std::allocator, std::allocator > > >&, char, std::string*)':
src/main/cpp/util/strings.cc:90: error: expected initializer before ':' token
src/main/cpp/util/strings.cc:305: error: expected primary-expression at end of input
src/main/cpp/util/strings.cc:305: error: expected ';' at end of input
src/main/cpp/util/strings.cc:305: error: expected primary-expression at end of input
src/main/cpp/util/strings.cc:305: error: expected ')' at end of input
src/main/cpp/util/strings.cc:305: error: expected statement at end of input
src/main/cpp/util/strings.cc:89: warning: unused variable 'first'
src/main/cpp/util/strings.cc:305: error: expected '}' at end of input
src/main/cpp/util/strings.cc: At global scope:
src/main/cpp/util/strings.cc:305: error: expected '}' at end of input
cc1plus: warning: unrecognized command line option "-Wno-free-nonheap-object"
ERROR: /data/qianmin/project/bazel/src/main/cpp/util/BUILD:31:1: C++ compilation of rule '//src/main/cpp/util:strings' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++0x' -DBLAZE_OPENSOURCE -iquote . ... (remaining 18 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: 7.541s, Critical Path: 1.41s
@jendap
Copy link
Contributor

jendap commented Nov 10, 2015

It should work with gcc 4.8.1 as it is the one in ubuntu 14.04 LTS which is definitely supported.

Have you tried to compile it from master branch or have you run git checkout tags/0.1.0 after clone?

If you have problems compile bazel you can try download their binaries (no copilation needed) [https://github.com/bazelbuild/bazel/releases]. And if bazel does not build on latest ubuntu lts (gcc 4.8.1) you should report it to [https://github.com/bazelbuild/bazel/issues].

@davidzchen
Copy link
Contributor

Bazel contributor here. As @jendap mentioned, feel free to report any Bazel-related issues you encounter at https://github.com/bazelbuild/bazel/issues

@piergiaj
Copy link

I get a similar error using gcc 4.8.1 when I run the command

bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer

I have built bazel 0.1.0 following the instructions and it didn't give any errors. It successfully clones all the repos, but as soon as it starts to compile I get these errors:

INFO: Found 1 target...
INFO: From Compiling google/protobuf/src/google/protobuf/util/internal/json_stream_parser.cc:
gcc: unrecognized option '-no-canonical-prefixes'
cc1plus: error: unrecognized command line option "-Wunused-but-set-parameter"
cc1plus: error: unrecognized command line option "-Wno-free-nonheap-object"
cc1plus: error: unrecognized command line option "-Wno-builtin-macro-redefined"
tensorflow/google/protobuf/BUILD:63:1: C++ compilation of rule '//google/protobuf:protobuf' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections ... (remaining 31 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
Target //tensorflow/cc:tutorials_example_trainer failed to build

@jendap
Copy link
Contributor

jendap commented Nov 11, 2015

@piergiaj that is weird. Don't you have two gcc version in the system? Quick googling for those flags are old. They are around for many years before gcc 4.8.1.

BTW: They are warnings, you can simply comment them out in third_party/gpus/crosstool/CROSSTOOL. But you can expect a lot more problems since it seems to be picking some very old compiler.

@qm1004
Copy link
Author

qm1004 commented Nov 11, 2015

Thank you @jendap .
I found I have 2 gcc in my system.
My default gcc is 4.8.2. But in /usr/bin/gcc is 4.4.2.
I found there are some hard code in compile file which use "gcc:/usr/bin/gcc".

@jendap
Copy link
Contributor

jendap commented Nov 11, 2015

You're welcome!

Yes, the hardcoded default paths should be (will be) changed to pick the one on $PATH.

@piergiaj
Copy link

@jendap I do have several versions of gcc on my system. The default one is 4.8.1, but the one in /usr/bin/gcc is 4.3.4

This seems to be caused because of the settings in tools/cpp/CROSSTOOL

tool_path { name: "gcc" path: "/usr/bin/gcc" }
cxx_flag: "-std=c++0x"
linker_flag: "-lstdc++"
linker_flag: "-B/usr/bin/"

TODO(bazel-team): In theory, the path here ought to exactly match the path
used by gcc. That works because bazel currently doesn't track files at
absolute locations and has no remote execution, yet. However, this will need
to be fixed, maybe with auto-detection?

After I changed those to point to gcc 4.8.1, it compiled several files until it failed compiling protobuf (which is a separate issue). This seems to be a known bazel issue.

@nzamb1
Copy link

nzamb1 commented Feb 28, 2017

I have the same issue on RHEL with gcc 4.4.7

@saurabhvyas
Copy link

I have the same issue just following this tutorial https://www.tensorflow.org/tutorials/image_retraining

@diegobrunoLRM
Copy link

How to solve this problem? I need help

E tensorflow/examples/label_image/main.cc:305] Running model failed: Not found: FeedInputs: unable to find feed output input

Thank you

lissyx added a commit to lissyx/tensorflow that referenced this issue Oct 11, 2018
tensorflow-copybara pushed a commit that referenced this issue Aug 20, 2019
- fix missing check while simplifying an expression with floordiv to a
  mod
- fixes issue #82

Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>

Closes #84

COPYBARA_INTEGRATE_REVIEW=tensorflow/mlir#84 from bondhugula:quickfix 26d0d70d4aeaa909e0ad93094fe15b385a618b80
PiperOrigin-RevId: 264338353
antkillerfarm added a commit to antkillerfarm/tensorflow that referenced this issue Mar 16, 2022
copybara-service bot pushed a commit that referenced this issue May 17, 2022
PiperOrigin-RevId: 449122006
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants