Skip to content

bazel compile error #82

Description

@qm1004

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

Activity

  1. jendap commented on Nov 10, 2015

    @jendap
    Contributor

    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].

  2. davidzchen commented on Nov 10, 2015

    @davidzchen
    Contributor

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

  3. piergiaj commented on Nov 11, 2015

    @piergiaj

    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
    
  4. jendap commented on Nov 11, 2015

    @jendap
    Contributor

    @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.

  5. qm1004 commented on Nov 11, 2015

    @qm1004
    Author

    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".

  6. jendap commented on Nov 11, 2015

    @jendap
    Contributor

    You're welcome!

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

  7. piergiaj commented on Nov 11, 2015

    @piergiaj

    @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.

  8. added a commit that references this issue on Mar 9, 2016
  9. nzamb1 commented on Feb 28, 2017

    @nzamb1

    I have the same issue on RHEL with gcc 4.4.7

  10. saurabhvyas commented on Mar 26, 2017

    @saurabhvyas

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

  11. diegobrunoLRM commented on Apr 19, 2017

    @diegobrunoLRM

    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

  12. added a commit that references this issue on Oct 11, 2018
  13. added a commit that references this issue on May 17, 2022
  14. added 5 commits that reference this issue on Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions