Skip to content

crosstool_wrapper_driver_is_not_gcc failed: error executing command #817

Closed

Description

@fancyerii

I am using the master branch of tensorflow and also build bazel master
/home/xxxxx/bazel/output/bazel build -c opt --config=cuda //tensorflow/cc:tutorials_example_trainer --verbose_failures

ERROR: /home/xxxxx/.cache/bazel/bazel_lli/716dd78c923ec9441d6903ce812e1d6e/external/gemmlowp/BUILD:77:1: C++ compilation of rule '@gemmlowp//:eight_bit_int_gemm' failed: crosstool_wrapper_driver_is_not_gcc failed: error executing command
(cd /home/lli/.cache/bazel/bazel_lli/716dd78c923ec9441d6903ce812e1d6e/tensorflow &&
exec env -
PATH='/.local/bin:/.local/bin:~/.local/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/lli/bin:/home/lli/bin:/home/lli/bin'
third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++11' -iquote external/gemmlowp -iquote bazel-out/local_linux-opt/genfiles/external/gemmlowp -iquote external/bazel_tools -iquote bazel-out/local_linux-opt/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE
="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -fno-canonical-system-headers '-frandom-seed=bazel-out/local_linux-opt/bin/external/gemmlowp/objs/eight_bit_int_gemm/external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.o' -MD -MF bazel-out/local_linux-opt/bin/external/gemmlowp/objs/eight_bit_int_gemm/external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.d -c external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.cc -o bazel-out/local_linux-opt/bin/external/gemmlowp/objs/eight_bit_int_gemm/external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.o): crosstool_wrapper_driver_is_not_gcc failed: error executing command
(cd /home/lli/.cache/bazel/bazel_lli/716dd78c923ec9441d6903ce812e1d6e/tensorflow &&
exec env -
PATH='/.local/bin:/.local/bin:~/.local/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/lli/bin:/home/lli/bin:/home/lli/bin'
third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++11' -iquote external/gemmlowp -iquote bazel-out/local_linux-opt/genfiles/external/gemmlowp -iquote external/bazel_tools -iquote bazel-out/local_linux-opt/genfiles/external/bazel_tools -isystem external/bazel_tools/tools/cpp/gcc3 -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE
="redacted"' '-D__TIMESTAMP
="redacted"' '-D__TIME__="redacted"' -fno-canonical-system-headers '-frandom-seed=bazel-out/local_linux-opt/bin/external/gemmlowp/_objs/eight_bit_int_gemm/external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.o' -MD -MF bazel-out/local_linux-opt/bin/external/gemmlowp/_objs/eight_bit_int_gemm/external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.d -c external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.cc -o bazel-out/local_linux-opt/bin/external/gemmlowp/_objs/eight_bit_int_gemm/external/gemmlowp/eight_bit_int_gemm/eight_bit_int_gemm.o).
src/main/tools/namespace-sandbox.c:645: execvp(argv[0], argv): No such file or directory
Target //tensorflow/cc:tutorials_example_trainer failed to build

Activity

  1. josh11b commented on Jan 20, 2016

    @josh11b
    Contributor

    Can you try

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

    and if that doesn't work, post the entire logs?

  2. fancyerii commented on Jan 21, 2016

    @fancyerii
    Author

    /home/lli/bazel/output/bazel build -c opt --config=cuda --spawn_strategy=standalone //tensorflow/cc:tutorials_example_trainer
    INFO: Found 1 target...
    ERROR: /home/lli/tensorflow/google/protobuf/BUILD:270:1: Linking of rule '//google/protobuf:protoc' failed: crosstool_wrapper_driver_is_not_gcc failed: error executing command third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -o bazel-out/host/bin/google/protobuf/protoc ... (remaining 15 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
    /usr/bin/ld: bazel-out/host/bin/google/protobuf/_objs/protoc/google/protobuf/src/google/protobuf/compiler/main.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
    bazel-out/host/bin/google/protobuf/_objs/protoc/google/protobuf/src/google/protobuf/compiler/main.o: error adding symbols: Bad value
    collect2: error: ld returned 1 exit status
    Target //tensorflow/cc:tutorials_example_trainer failed to build
    Use --verbose_failures to see the command lines of failed build steps.
    INFO: Elapsed time: 23.745s, Critical Path: 3.69s

  3. vrv commented on Jan 21, 2016

    @vrv
  4. damienmg commented on Jan 21, 2016

    @damienmg
    Contributor

    /home/lli/bazel/output/bazel build -c opt --config=cuda --spawn_strategy=standalone --verbose_failure //tensorflow/cc:tutorials_example_trainer

    Then you will get the failing command completely.

    Maybe try a bazel clean --expunge first

  5. damienmg commented on Jan 21, 2016

    @damienmg
    Contributor

    btw, @davidzchen is the one you wanted to ping (with a z not a x)

  6. fancyerii commented on Jan 22, 2016

    @fancyerii
    Author

    I tried but no luck. BTW, I can't use verbose_failure with my built bazel. Unrecognized option: --verbose_failure
    lli@mobvoi-rhea-01:/jdk1.8.0_65$ /home/lli/bazel/output/bazel clean --expunge
    The 'clean' command is only supported from within a workspace.
    lli@mobvoi-rhea-01:
    /jdk1.8.0_65$ cd
    lli@mobvoi-rhea-01:$ cd tensorflow/
    lli@mobvoi-rhea-01:
    /tensorflow$ /home/lli/bazel/output/bazel clean --expunge
    ................
    INFO: Starting clean (this may take a while). Consider using --expunge_async if the clean takes more than several minutes.
    lli@mobvoi-rhea-01:/tensorflow$ /home/lli/bazel/output/bazel build -c opt --config=cuda --spawn_strategy=standalone --verbose_failure //tensorflow/cc:tutorials_example_trainer
    .............
    Unrecognized option: --verbose_failure
    lli@mobvoi-rhea-01:
    /tensorflow$ /home/lli/bazel/output/bazel build -c opt --config=cuda --spawn_strategy=standalone //tensorflow/cc:tutorials_example_trainer
    INFO: Found 1 target...
    ERROR: /home/lli/tensorflow/google/protobuf/BUILD:270:1: Linking of rule '//google/protobuf:protoc' failed: crosstool_wrapper_driver_is_not_gcc failed: error executing command third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -o bazel-out/host/bin/google/protobuf/protoc ... (remaining 15 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
    /usr/bin/ld: bazel-out/host/bin/google/protobuf/_objs/protoc/google/protobuf/src/google/protobuf/compiler/main.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
    bazel-out/host/bin/google/protobuf/_objs/protoc/google/protobuf/src/google/protobuf/compiler/main.o: error adding symbols: Bad value
    collect2: error: ld returned 1 exit status
    Target //tensorflow/cc:tutorials_example_trainer failed to build
    Use --verbose_failures to see the command lines of failed build steps.
    INFO: Elapsed time: 166.539s, Critical Path: 18.48s

  7. damienmg commented on Jan 22, 2016

    @damienmg
    Contributor

    My bad the correct option is --verbose_failures

    On Fri, Jan 22, 2016, 8:53 AM LiLi [email protected] wrote:

    I tried but no luck. BTW, I can't use verbose_failure with my built bazel.
    Unrecognized option: --verbose_failure
    lli@mobvoi-rhea-01:/jdk1.8.0_65$ /home/lli/bazel/output/bazel clean
    --expunge
    The 'clean' command is only supported from within a workspace.
    lli@mobvoi-rhea-01:
    /jdk1.8.0_65$ cd
    lli@mobvoi-rhea-01:$ cd tensorflow/
    lli@mobvoi-rhea-01:
    /tensorflow$ /home/lli/bazel/output/bazel clean
    --expunge
    ................
    INFO: Starting clean (this may take a while). Consider using
    --expunge_async if the clean takes more than several minutes.
    lli@mobvoi-rhea-01:/tensorflow$ /home/lli/bazel/output/bazel build -c
    opt --config=cuda --spawn_strategy=standalone --verbose_failure
    //tensorflow/cc:tutorials_example_trainer
    .............
    Unrecognized option: --verbose_failure
    lli@mobvoi-rhea-01:
    /tensorflow$ /home/lli/bazel/output/bazel build -c
    opt --config=cuda --spawn_strategy=standalone
    //tensorflow/cc:tutorials_example_trainer
    INFO: Found 1 target...
    ERROR: /home/lli/tensorflow/google/protobuf/BUILD:270:1: Linking of rule
    '//google/protobuf:protoc' failed: crosstool_wrapper_driver_is_not_gcc
    failed: error executing command
    third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -o
    bazel-out/host/bin/google/protobuf/protoc ... (remaining 15 argument(s)
    skipped): com.google.devtools.build.lib.shell.BadExitStatusException:
    Process exited with status 1.
    /usr/bin/ld:
    bazel-out/host/bin/google/protobuf/_objs/protoc/google/protobuf/src/google/protobuf/compiler/main.o:
    relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making
    a shared object; recompile with -fPIC
    bazel-out/host/bin/google/protobuf/_objs/protoc/google/protobuf/src/google/protobuf/compiler/main.o:
    error adding symbols: Bad value
    collect2: error: ld returned 1 exit status
    Target //tensorflow/cc:tutorials_example_trainer failed to build
    Use --verbose_failures to see the command lines of failed build steps.
    INFO: Elapsed time: 166.539s, Critical Path: 18.48s

    —
    Reply to this email directly or view it on GitHub
    #817 (comment)
    .

  8. fancyerii commented on Jan 22, 2016

    @fancyerii
    Author

    lli@mobvoi-rhea-01:~/tensorflow$ /home/lli/bazel/output/bazel build -c opt --config=cuda --spawn_strategy=standalone --verbose_failures //tensorflow/cc:tutorials_example_trainer
    .............
    INFO: Found 1 target...
    ERROR: /home/lli/tensorflow/google/protobuf/BUILD:270:1: Linking of rule '//google/protobuf:protoc' failed: crosstool_wrapper_driver_is_not_gcc failed: error executing command
    (cd /home/lli/.cache/bazel/_bazel_lli/716dd78c923ec9441d6903ce812e1d6e/tensorflow &&
    exec env -
    third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -o bazel-out/host/bin/google/protobuf/protoc bazel-out/host/bin/google/protobuf/_objs/protoc/google/protobuf/src/google/protobuf/compiler/main.o bazel-out/host/bin/google/protobuf/libprotoc_lib.a bazel-out/host/bin/google/protobuf/libprotobuf.a bazel-out/host/bin/google/protobuf/libprotobuf_lite.a -lpthread -lstdc++ -B/usr/bin/ -pie -Wl,-z,relro,-z,now -no-canonical-prefixes -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,-S -Wl,--gc-sections): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1: crosstool_wrapper_driver_is_not_gcc failed: error executing command
    (cd /home/lli/.cache/bazel/_bazel_lli/716dd78c923ec9441d6903ce812e1d6e/tensorflow &&
    exec env -
    third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -o bazel-out/host/bin/google/protobuf/protoc bazel-out/host/bin/google/protobuf/_objs/protoc/google/protobuf/src/google/protobuf/compiler/main.o bazel-out/host/bin/google/protobuf/libprotoc_lib.a bazel-out/host/bin/google/protobuf/libprotobuf.a bazel-out/host/bin/google/protobuf/libprotobuf_lite.a -lpthread -lstdc++ -B/usr/bin/ -pie -Wl,-z,relro,-z,now -no-canonical-prefixes -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,-S -Wl,--gc-sections): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
    /usr/bin/ld: bazel-out/host/bin/google/protobuf/_objs/protoc/google/protobuf/src/google/protobuf/compiler/main.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
    bazel-out/host/bin/google/protobuf/_objs/protoc/google/protobuf/src/google/protobuf/compiler/main.o: error adding symbols: Bad value
    collect2: error: ld returned 1 exit status
    Target //tensorflow/cc:tutorials_example_trainer failed to build
    INFO: Elapsed time: 16.794s, Critical Path: 5.31s

  9. damienmg commented on Jan 22, 2016

    @damienmg
    Contributor

    relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    Adding -fPIC to the options in the cuda crosstool might do the trick. Sorry I cannot do much here, it's a C++ related issue, not really related to bazel

  10. fancyerii commented on Jan 23, 2016

    @fancyerii
    Author

    @damienmg
    so which file should I modify and how?

  11. fancyerii commented on Jan 29, 2016

    @fancyerii
    Author

    thanks, it works.
    I have successfully built cifar10 by /home/lli/bazel/output/bazel build -c opt --config=cuda --spawn_strategy=standalone --verbose_failures //tensorflow/models/image/cifar10:cifar10
    but how can I run it?
    $python cifar10_train.py --data_dir=/home/lli/cifar10_data
    Traceback (most recent call last):
    File "cifar10_train.py", line 43, in
    import tensorflow.python.platform
    ImportError: No module named tensorflow.python.platform
    How can I build all thing like it's installed by pip?

  12. tobegit3hub commented on Jun 20, 2016

    @tobegit3hub
    Contributor

    Is it fixed because we have the similar problem? @fancyerii

  13. snarb commented on Jul 31, 2016

    @snarb

    The same problem

  14. added a commit that references this issue on May 6, 2026
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